Esempio n. 1
0

request_path_username = api_client.PathParameter(
    name="username",
    style=api_client.ParameterStyle.SIMPLE,
    schema=UsernameSchema,
    required=True,
)
# body param
SchemaForRequestBodyApplicationJson = User


request_body_user = api_client.RequestBody(
    content={
        'application/json': api_client.MediaType(
            schema=SchemaForRequestBodyApplicationJson),
    },
    required=True,
)
_path = '/user/{username}'
_method = 'PUT'


@dataclass
class ApiResponseFor400(api_client.ApiResponse):
    response: urllib3.HTTPResponse
    body: Unset = unset
    headers: Unset = unset


_response_for_400 = api_client.OpenApiResponse(
Esempio n. 2
0
        _configuration: typing.Optional[Configuration] = None,
        **kwargs: typing.Type[Schema],
    ) -> 'SchemaForRequestBodyApplicationXWwwFormUrlencoded':
        return super().__new__(
            cls,
            *args,
            enum_form_string_array=enum_form_string_array,
            enum_form_string=enum_form_string,
            _configuration=_configuration,
            **kwargs,
        )


request_body_body = api_client.RequestBody(
    content={
        'application/x-www-form-urlencoded': api_client.MediaType(
            schema=SchemaForRequestBodyApplicationXWwwFormUrlencoded),
    },
)
_path = '/fake'
_method = 'GET'


@dataclass
class ApiResponseFor400(api_client.ApiResponse):
    response: urllib3.HTTPResponse
    body: Unset = unset
    headers: Unset = unset


_response_for_400 = api_client.OpenApiResponse(
    response_cls=ApiResponseFor400,
Esempio n. 3
0
        *args: typing.Union[dict, frozendict, ],
        additionalMetadata: typing.Union[additionalMetadata, Unset] = unset,
        _instantiation_metadata: typing.Optional[InstantiationMetadata] = None,
        **kwargs: typing.Type[Schema],
    ):
        return super().__new__(
            cls,
            *args,
            additionalMetadata=additionalMetadata,
            _instantiation_metadata=_instantiation_metadata,
            **kwargs,
        )


request_body_body = api_client.RequestBody(content={
    'multipart/form-data':
    api_client.MediaType(schema=SchemaForRequestBodyMultipartFormData),
}, )
_path = '/fake/uploadFile'
_method = 'POST'
SchemaFor200ResponseBodyApplicationJson = ApiResponse


@dataclass
class ApiResponseFor200(api_client.ApiResponse):
    response: urllib3.HTTPResponse
    body: typing.Union[SchemaFor200ResponseBodyApplicationJson, ]
    headers: Unset = unset


_response_for_200 = api_client.OpenApiResponse(
    response_cls=ApiResponseFor200,
Esempio n. 4
0
    BinaryBase,
    Schema,
    _SchemaValidator,
    _SchemaTypeChecker,
    _SchemaEnumMaker
)

from petstore_api.model.array_of_enums import ArrayOfEnums

# body param
SchemaForRequestBodyApplicationJson = ArrayOfEnums


request_body_array_of_enums = api_client.RequestBody(
    content={
        'application/json': api_client.MediaType(
            schema=SchemaForRequestBodyApplicationJson),
    },
)
_path = '/fake/refs/array-of-enums'
_method = 'POST'
SchemaFor200ResponseBodyApplicationJson = ArrayOfEnums


@dataclass
class ApiResponseFor200(api_client.ApiResponse):
    response: urllib3.HTTPResponse
    body: typing.Union[
        SchemaFor200ResponseBodyApplicationJson,
    ]
    headers: Unset = unset
Esempio n. 5
0
    AnyTypeSchema, ComposedSchema, DictSchema, ListSchema, StrSchema,
    IntSchema, Int32Schema, Int64Schema, Float32Schema, Float64Schema,
    NumberSchema, UUIDSchema, DateSchema, DateTimeSchema, DecimalSchema,
    BoolSchema, BinarySchema, NoneSchema, none_type, Configuration, Unset,
    unset, ComposedBase, ListBase, DictBase, NoneBase, StrBase, IntBase,
    Int32Base, Int64Base, Float32Base, Float64Base, NumberBase, UUIDBase,
    DateBase, DateTimeBase, BoolBase, BinaryBase, Schema, _SchemaValidator,
    _SchemaTypeChecker, _SchemaEnumMaker)

# body param
SchemaForRequestBodyApplicationOctetStream = BinarySchema

request_body_body = api_client.RequestBody(
    content={
        'application/octet-stream':
        api_client.MediaType(
            schema=SchemaForRequestBodyApplicationOctetStream),
    },
    required=True,
)
_path = '/fake/uploadDownloadFile'
_method = 'POST'
SchemaFor200ResponseBodyApplicationOctetStream = BinarySchema


@dataclass
class ApiResponseFor200(api_client.ApiResponse):
    response: urllib3.HTTPResponse
    body: typing.Union[SchemaFor200ResponseBodyApplicationOctetStream, ]
    headers: Unset = unset

Esempio n. 6
0
        someProp: typing.Union[someProp, Unset] = unset,
        _instantiation_metadata: typing.Optional[InstantiationMetadata] = None,
        **kwargs: typing.Type[Schema],
    ) -> 'SchemaForRequestBodyMultipartFormData':
        return super().__new__(
            cls,
            *args,
            someProp=someProp,
            _instantiation_metadata=_instantiation_metadata,
            **kwargs,
        )


request_body_any_type = api_client.RequestBody(content={
    'application/json':
    api_client.MediaType(schema=SchemaForRequestBodyApplicationJson),
    'multipart/form-data':
    api_client.MediaType(schema=SchemaForRequestBodyMultipartFormData),
}, )
_path = '/fake/inlineComposition/'
_method = 'POST'


class SchemaFor200ResponseBodyApplicationJson(ComposedSchema):
    @classmethod
    @property
    def _composed_schemas(cls):
        # we need this here to make our import statements work
        # we must store _composed_schemas in here so the code is only run
        # when we invoke this method. If we kept this at the class
        # level we would get an error because the class level
        # code would be run when this module is imported, and these composed
    AnyTypeSchema, ComposedSchema, DictSchema, ListSchema, StrSchema,
    IntSchema, Int32Schema, Int64Schema, Float32Schema, Float64Schema,
    NumberSchema, DateSchema, DateTimeSchema, DecimalSchema, BoolSchema,
    BinarySchema, NoneSchema, none_type, InstantiationMetadata, Unset, unset,
    ComposedBase, ListBase, DictBase, NoneBase, StrBase, IntBase, Int32Base,
    Int64Base, Float32Base, Float64Base, NumberBase, DateBase, DateTimeBase,
    BoolBase, BinaryBase, Schema, _SchemaValidator, _SchemaTypeChecker,
    _SchemaEnumMaker)

from petstore_api.model.composed_one_of_different_types import ComposedOneOfDifferentTypes

# body param
SchemaForRequestBodyApplicationJson = ComposedOneOfDifferentTypes

request_body_composed_one_of_different_types = api_client.RequestBody(content={
    'application/json':
    api_client.MediaType(schema=SchemaForRequestBodyApplicationJson),
}, )
_path = '/fake/refs/composed_one_of_number_with_validations'
_method = 'POST'
SchemaFor200ResponseBodyApplicationJson = ComposedOneOfDifferentTypes


@dataclass
class ApiResponseFor200(api_client.ApiResponse):
    response: urllib3.HTTPResponse
    body: typing.Union[SchemaFor200ResponseBodyApplicationJson, ]
    headers: Unset = unset


_response_for_200 = api_client.OpenApiResponse(
    response_cls=ApiResponseFor200,