Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ from .headers import {{jsonPathPiece.snakeCase}}


@dataclasses.dataclass
class _ApiResponse(api_client.ApiResponse):
class Api{{jsonPathPiece.camelCase}}(api_client.ApiResponse):
response: urllib3.HTTPResponse
{{#and headers content}}
{{#if hasContentSchema}}
Expand Down Expand Up @@ -99,8 +99,8 @@ class _ApiResponse(api_client.ApiResponse):
{{/unless}}


class {{jsonPathPiece.camelCase}}(api_client.OpenApiResponse[_ApiResponse]):
response_cls = _ApiResponse
class {{jsonPathPiece.camelCase}}(api_client.OpenApiResponse[Api{{jsonPathPiece.camelCase}}]):
response_cls = Api{{jsonPathPiece.camelCase}}
{{#each content}}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,72 +417,10 @@ class BaseApi(api_client.Api):

class {{operationId.camelCase}}(BaseApi):
# this class is used by api classes that refer to endpoints with operationId.snakeCase fn names

{{#if requestBody}}
{{#each getContentTypeToOperation}}
@typing.overload
def {{operationId.snakeCase}}(
{{> paths/path/verb/_helper_operation_args isOverload=true skipDeserialization="False" contentType=@key}}

{{/each}}
@typing.overload
def {{operationId.snakeCase}}(
{{> paths/path/verb/_helper_operation_args isOverload=true skipDeserialization="False" contentType="null"}}

{{else}}
@typing.overload
def {{operationId.snakeCase}}(
{{> paths/path/verb/_helper_operation_args isOverload=true skipDeserialization="False" contentType="null"}}
{{/if}}

@typing.overload
def {{operationId.snakeCase}}(
{{> paths/path/verb/_helper_operation_args isOverload=true skipDeserialization="True" contentType="null"}}

@typing.overload
def {{operationId.snakeCase}}(
{{> paths/path/verb/_helper_operation_args isOverload=true skipDeserialization="null" contentType="null"}}

def {{operationId.snakeCase}}(
{{> paths/path/verb/_helper_operation_args isOverload=false skipDeserialization="null" contentType="null"}}
return self._{{operationId.snakeCase}}(
{{> paths/path/verb/_helper_operation_args_passed }}
)
{{operationId.snakeCase}} = BaseApi._{{operationId.snakeCase}}


class ApiFor{{httpMethod.camelCase}}(BaseApi):
# this class is used by api classes that refer to endpoints by path and http method names

{{#if requestBody}}
{{#each getContentTypeToOperation}}
@typing.overload
def {{httpMethod.original}}(
{{> paths/path/verb/_helper_operation_args rootSecurity=../security isOverload=true skipDeserialization="False" contentType=@key}}

{{/each}}
@typing.overload
def {{httpMethod.original}}(
{{> paths/path/verb/_helper_operation_args rootSecurity=../security isOverload=true skipDeserialization="False" contentType="null"}}

{{else}}
@typing.overload
def {{httpMethod.original}}(
{{> paths/path/verb/_helper_operation_args rootSecurity=../security isOverload=true skipDeserialization="False" contentType="null"}}
{{/if}}

@typing.overload
def {{httpMethod.original}}(
{{> paths/path/verb/_helper_operation_args rootSecurity=../security isOverload=true skipDeserialization="True" contentType="null"}}

@typing.overload
def {{httpMethod.original}}(
{{> paths/path/verb/_helper_operation_args rootSecurity=../security isOverload=true skipDeserialization="null" contentType="null"}}

def {{httpMethod.original}}(
{{> paths/path/verb/_helper_operation_args rootSecurity=../security isOverload=false skipDeserialization="null" contentType="null"}}
return self._{{operationId.snakeCase}}(
{{> paths/path/verb/_helper_operation_args_passed rootSecurity=../security }}
)


{{httpMethod.original}} = BaseApi._{{operationId.snakeCase}}
{{/with}}
Original file line number Diff line number Diff line change
Expand Up @@ -181,181 +181,9 @@ class instances

class PostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody(BaseApi):
# this class is used by api classes that refer to endpoints with operationId.snakeCase fn names

@typing.overload
def post_additionalproperties_allows_a_schema_which_should_validate_request_body(
self,
body: typing.Union[
request_body.RequestBody.content["application/json"].schema,
dict,
frozendict.frozendict
],
content_type: typing_extensions.Literal["application/json"] = ...,
server_index: typing.Optional[int] = None,
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: typing_extensions.Literal[False] = ...,
) -> response_200.ResponseFor200.response_cls: ...

@typing.overload
def post_additionalproperties_allows_a_schema_which_should_validate_request_body(
self,
body: typing.Union[
request_body.RequestBody.content["application/json"].schema,
dict,
frozendict.frozendict
],
content_type: str = ...,
server_index: typing.Optional[int] = None,
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: typing_extensions.Literal[False] = ...,
) -> response_200.ResponseFor200.response_cls: ...


@typing.overload
def post_additionalproperties_allows_a_schema_which_should_validate_request_body(
self,
body: typing.Union[
request_body.RequestBody.content["application/json"].schema,
dict,
frozendict.frozendict
],
skip_deserialization: typing_extensions.Literal[True],
content_type: str = ...,
server_index: typing.Optional[int] = None,
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
) -> api_client.ApiResponseWithoutDeserialization: ...

@typing.overload
def post_additionalproperties_allows_a_schema_which_should_validate_request_body(
self,
body: typing.Union[
request_body.RequestBody.content["application/json"].schema,
dict,
frozendict.frozendict
],
content_type: str = ...,
server_index: typing.Optional[int] = None,
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: bool = ...,
) -> typing.Union[
response_200.ResponseFor200.response_cls,
api_client.ApiResponseWithoutDeserialization,
]: ...

def post_additionalproperties_allows_a_schema_which_should_validate_request_body(
self,
body: typing.Union[
request_body.RequestBody.content["application/json"].schema,
dict,
frozendict.frozendict
],
content_type: str = 'application/json',
server_index: typing.Optional[int] = None,
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: bool = False,
):
return self._post_additionalproperties_allows_a_schema_which_should_validate_request_body(
body=body,
content_type=content_type,
server_index=server_index,
stream=stream,
timeout=timeout,
skip_deserialization=skip_deserialization
)
post_additionalproperties_allows_a_schema_which_should_validate_request_body = BaseApi._post_additionalproperties_allows_a_schema_which_should_validate_request_body


class ApiForPost(BaseApi):
# this class is used by api classes that refer to endpoints by path and http method names

@typing.overload
def post(
self,
body: typing.Union[
request_body.RequestBody.content["application/json"].schema,
dict,
frozendict.frozendict
],
content_type: typing_extensions.Literal["application/json"] = ...,
server_index: typing.Optional[int] = None,
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: typing_extensions.Literal[False] = ...,
) -> response_200.ResponseFor200.response_cls: ...

@typing.overload
def post(
self,
body: typing.Union[
request_body.RequestBody.content["application/json"].schema,
dict,
frozendict.frozendict
],
content_type: str = ...,
server_index: typing.Optional[int] = None,
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: typing_extensions.Literal[False] = ...,
) -> response_200.ResponseFor200.response_cls: ...


@typing.overload
def post(
self,
body: typing.Union[
request_body.RequestBody.content["application/json"].schema,
dict,
frozendict.frozendict
],
skip_deserialization: typing_extensions.Literal[True],
content_type: str = ...,
server_index: typing.Optional[int] = None,
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
) -> api_client.ApiResponseWithoutDeserialization: ...

@typing.overload
def post(
self,
body: typing.Union[
request_body.RequestBody.content["application/json"].schema,
dict,
frozendict.frozendict
],
content_type: str = ...,
server_index: typing.Optional[int] = None,
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: bool = ...,
) -> typing.Union[
response_200.ResponseFor200.response_cls,
api_client.ApiResponseWithoutDeserialization,
]: ...

def post(
self,
body: typing.Union[
request_body.RequestBody.content["application/json"].schema,
dict,
frozendict.frozendict
],
content_type: str = 'application/json',
server_index: typing.Optional[int] = None,
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: bool = False,
):
return self._post_additionalproperties_allows_a_schema_which_should_validate_request_body(
body=body,
content_type=content_type,
server_index=server_index,
stream=stream,
timeout=timeout,
skip_deserialization=skip_deserialization
)


post = BaseApi._post_additionalproperties_allows_a_schema_which_should_validate_request_body
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@


@dataclasses.dataclass
class _ApiResponse(api_client.ApiResponse):
class ApiResponseFor200(api_client.ApiResponse):
response: urllib3.HTTPResponse
body: schemas.Unset = schemas.unset
headers: schemas.Unset = schemas.unset


class ResponseFor200(api_client.OpenApiResponse[_ApiResponse]):
response_cls = _ApiResponse
class ResponseFor200(api_client.OpenApiResponse[ApiResponseFor200]):
response_cls = ApiResponseFor200
Loading