Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Latest commit

 

History

History
331 lines (284 loc) · 16.1 KB

File metadata and controls

331 lines (284 loc) · 16.1 KB

petstore_api.paths.fake.operation

Operation Method Name

Method Name Api Class Notes
enum_parameters FakeApi This api is only for tag=fake
get ApiForGet This api is only for this endpoint
get Fake This api is only for path=/fake

Table of Contents

General Info

Field Value
Summary To test enum parameters
Description To test enum parameters
Path "/fake"
HTTP Method get

Arguments

Name Type Description Notes
body typing.Union[schema.SchemaDictInput, schema.SchemaDict, schemas.Unset] optional, default is unset
query_params QueryParametersDictInput, QueryParametersDict
header_params HeaderParametersDictInput, HeaderParametersDict
content_type str optional, default is 'application/x-www-form-urlencoded' Selects the schema and serialization of the request body. value must be one of ['application/x-www-form-urlencoded']
accept_content_types typing.Tuple[str] default is ("application/json", ) Tells the server the content type(s) that are accepted by the client
server_index typing.Optional[int] default is None Allows one to select a different server. If not None, must be one of [0, 1, 2]
stream bool default is False if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout typing.Optional[typing.Union[int, typing.Tuple]] default is None the timeout used by the rest client
skip_deserialization bool default is False when True, headers and body will be unset and an instance of api_response.ApiResponseWithoutDeserialization will be returned

RequestBody

Content Type To Schema

Content-Type Schema
"application/x-www-form-urlencoded" content.application_x_www_form_urlencoded.Schema

RequestBody content ApplicationXWwwFormUrlencoded Schema

type: schemas.Schema
validate method
Input Type Return Type Notes
SchemaDictInput, SchemaDict SchemaDict
RequestBody content ApplicationXWwwFormUrlencoded Schema SchemaDictInput
type: typing.Mapping[str, schemas.INPUT_TYPES_ALL]
Key Type Description Notes
enum_form_string_array EnumFormStringArrayTupleInput, EnumFormStringArrayTuple Form parameter enum test (string array) [optional]
enum_form_string typing.Literal["_abc", "-efg", "(xyz)"] Form parameter enum test (string) [optional] must be one of ["_abc", "-efg", "(xyz)"] if omitted the server will use the default value of -efg
any_string_name dict, schemas.immutabledict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.FileIO any string name can be used but the value must be the correct type [optional]
RequestBody content ApplicationXWwwFormUrlencoded Schema SchemaDict
base class: schemas.immutabledict[str, schemas.OUTPUT_BASE_TYPES]

__new__ method
Keyword Argument Type Description Notes
enum_form_string_array EnumFormStringArrayTupleInput, EnumFormStringArrayTuple, schemas.Unset Form parameter enum test (string array) [optional]
enum_form_string typing.Literal["_abc", "-efg", "(xyz)"], schemas.Unset Form parameter enum test (string) [optional] must be one of ["_abc", "-efg", "(xyz)"] if omitted the server will use the default value of -efg
kwargs schemas.immutabledict, tuple, float, int, str, bool, None, bytes, schemas.FileIO any string name can be used but the value must be the correct type [optional] typed value is accessed with the get_additional_property_ method
properties
Property Type Description Notes
enum_form_string_array EnumFormStringArrayTuple, schemas.Unset Form parameter enum test (string array) [optional]
enum_form_string typing.Literal["_abc", "-efg", "(xyz)"], schemas.Unset Form parameter enum test (string) [optional] must be one of ["_abc", "-efg", "(xyz)"] if omitted the server will use the default value of -efg
methods
Method Input Type Return Type Notes
from_dict_ SchemaDictInput, SchemaDict SchemaDict a constructor
get_additional_property_ str schemas.immutabledict, tuple, float, int, str, bool, None, bytes, schemas.FileIO, schemas.Unset provides type safety for additional properties

RequestBody content ApplicationXWwwFormUrlencoded Schema

type: schemas.Schema
Description

Form parameter enum test (string array)

validate method
Input Type Return Type Notes
EnumFormStringArrayTupleInput, EnumFormStringArrayTuple EnumFormStringArrayTuple
RequestBody content ApplicationXWwwFormUrlencoded Schema EnumFormStringArrayTupleInput
type: typing.Union[
    typing.List[
        typing.Literal[
            ">",
            "$"
        ],
    ],
    typing.Tuple[
        typing.Literal[
            ">",
            "$"
        ],
        ...
    ]
]
List/Tuple Item Type Description Notes
typing.Literal[">", "$"] must be one of [">", "$"] if omitted the server will use the default value of $
RequestBody content ApplicationXWwwFormUrlencoded Schema EnumFormStringArrayTuple
base class: typing.Tuple[
    typing.Literal[">", "$"],
    ...
]
__new__ method
Argument Type
arg EnumFormStringArrayTupleInput, EnumFormStringArrayTuple
configuration typing.Optional[schema_configuration.SchemaConfiguration] = None
methods
Method Input Type Return Type Notes
__getitem__ int typing.Literal[">", "$"] must be one of [">", "$"] if omitted the server will use the default value of $ This method is used under the hood when instance[0] is called

query_params

QueryParameters

type: schemas.Schema

validate method

Input Type Return Type Notes
QueryParametersDictInput, QueryParametersDict QueryParametersDict

QueryParameters QueryParametersDictInput

type: typing.TypedDict
Key Type Description Notes
enum_query_double float, int [optional]
enum_query_string typing.Literal["_abc", "-efg", "(xyz)"] [optional]
enum_query_integer typing.Literal[1, -2] [optional]
enum_query_string_array schema.SchemaTupleInput, schema_4.SchemaTuple [optional]

QueryParameters QueryParametersDict

base class: schemas.immutabledict[str, schemas.OUTPUT_BASE_TYPES]

__new__ method
Keyword Argument Type Description Notes
enum_query_double float, int, schemas.Unset [optional]
enum_query_string typing.Literal["_abc", "-efg", "(xyz)"], schemas.Unset [optional]
enum_query_integer typing.Literal[1, -2], schemas.Unset [optional]
enum_query_string_array schema.SchemaTupleInput, schema_4.SchemaTuple, schemas.Unset [optional]
properties
Property Type Description Notes
enum_query_double float, int, schemas.Unset [optional]
enum_query_string typing.Literal["_abc", "-efg", "(xyz)"], schemas.Unset [optional]
enum_query_integer typing.Literal[1, -2], schemas.Unset [optional]
enum_query_string_array schema.SchemaTuple, schemas.Unset [optional]
methods
Method Input Type Return Type Notes
from_dict_ QueryParametersDictInput, QueryParametersDict QueryParametersDict a constructor

header_params

HeaderParameters

type: schemas.Schema

validate method

Input Type Return Type Notes
HeaderParametersDictInput, HeaderParametersDict HeaderParametersDict

HeaderParameters HeaderParametersDictInput

type: typing.TypedDict
Key Type Description Notes
enum_header_string typing.Literal["_abc", "-efg", "(xyz)"] [optional]
enum_header_string_array schema.SchemaTupleInput, schema_2.SchemaTuple [optional]

HeaderParameters HeaderParametersDict

base class: schemas.immutabledict[str, schemas.OUTPUT_BASE_TYPES]

__new__ method
Keyword Argument Type Description Notes
enum_header_string typing.Literal["_abc", "-efg", "(xyz)"], schemas.Unset [optional]
enum_header_string_array schema.SchemaTupleInput, schema_2.SchemaTuple, schemas.Unset [optional]
properties
Property Type Description Notes
enum_header_string typing.Literal["_abc", "-efg", "(xyz)"], schemas.Unset [optional]
enum_header_string_array schema.SchemaTuple, schemas.Unset [optional]
methods
Method Input Type Return Type Notes
from_dict_ HeaderParametersDictInput, HeaderParametersDict HeaderParametersDict a constructor

Return Types

HTTP Status Code Class Description
n/a api_response.ApiResponseWithoutDeserialization When skip_deserialization is True this response is returned
200 SuccessDescriptionOnly.ApiResponse Success
404 ResponseFor404.ApiResponse Not found

ResponseFor404

Description

Not found

ResponseFor404 ApiResponse

Name Type Description Notes
response urllib3.HTTPResponse Raw response
body schemas.immutabledict
headers Unset headers were not defined

ResponseFor404 Body

Content-Type Schema
"application/json" content.application_json.Schema

Body Details

ResponseFor404 content ApplicationJson Schema

type: schemas.Schema
validate method
Input Type Return Type Notes
dict, schemas.immutabledict schemas.immutabledict

Servers

Set the available servers by defining your used servers in ApiConfiguration.server_info Then select your server by setting a server index in ApiConfiguration.server_index_info or by passing server_index in to the endpoint method.

server_index Class Description
0 Server0 petstore server
1 Server1 The local server
2 Server2 staging server with no variables

Code Sample

import petstore_api
from petstore_api.configurations import api_configuration
from petstore_api.apis.tags import fake_api
from petstore_api.paths.fake.get import operation
from pprint import pprint
used_configuration = api_configuration.ApiConfiguration(
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(used_configuration) as api_client:
    # Create an instance of the API class
    api_instance = fake_api.FakeApi(api_client)

    # example passing only optional values
    query_params: operation.QueryParametersDictInput = {
        'enum_query_string_array': [
        "$"
    ],
        'enum_query_string': "-efg",
        'enum_query_integer': 1,
        'enum_query_double': 1.1,
    }
    header_params: operation.HeaderParametersDictInput = {
        'enum_header_string_array': [
        "$"
    ],
        'enum_header_string': "-efg",
    }
    body = {
        "enum_form_string_array": [
            "$"
        ],
        "enum_form_string": "-efg",
    }
    try:
        # To test enum parameters
        api_response = api_instance.enum_parameters(
            query_params=query_params,
            header_params=header_params,
            body=body,
        )
        pprint(api_response)
    except petstore_api.ApiException as e:
        print("Exception when calling FakeApi->enum_parameters: %s\n" % e)

[Back to top] [Back to FakeApi API] [Back to Endpoints] [Back to README]