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

Latest commit

 

History

History
151 lines (121 loc) · 6.3 KB

File metadata and controls

151 lines (121 loc) · 6.3 KB

petstore_api.paths.foo.operation

Operation Method Name

Method Name Api Class Notes
foo_get DefaultApi This api is only for tag=default
get ApiForGet This api is only for this endpoint
get Foo This api is only for path=/foo

Table of Contents

General Info

Field Value
Path "/foo"
HTTP Method get

Arguments

Name Type Description Notes
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]
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

Return Types

HTTP Status Code Class Description
n/a api_response.ApiResponseWithoutDeserialization When skip_deserialization is True this response is returned
default Default.ApiResponse response

Default

Description

response

Default ApiResponse

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

Default Body

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

Body Details

Default content ApplicationJson Schema

type: schemas.Schema
validate method
Input Type Return Type Notes
SchemaDictInput, SchemaDict SchemaDict
Default content ApplicationJson Schema SchemaDictInput
type: typing.Mapping[str, schemas.INPUT_TYPES_ALL]
Key Type Description Notes
string foo.FooDictInput, foo.FooDict [optional]
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]
Default content ApplicationJson Schema SchemaDict
base class: schemas.immutabledict[str, schemas.OUTPUT_BASE_TYPES]

__new__ method
Keyword Argument Type Description Notes
string foo.FooDictInput, foo.FooDict, schemas.Unset [optional]
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
string foo.FooDict, schemas.Unset [optional]
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

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
1 Server1

Server0

Url

https://path-server-test.petstore.local/v2

Server1

Url

https://petstore.swagger.io/{version}

Variables

Key Type Description Notes
version str must be one of ["v1", "v2"] if omitted the client will use the default value of v1

Code Sample

import petstore_api
from petstore_api.configurations import api_configuration
from petstore_api.apis.tags import default_api
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 = default_api.DefaultApi(api_client)

    # example, this endpoint has no required or optional parameters
    try:
        api_response = api_instance.foo_get()
        pprint(api_response)
    except petstore_api.ApiException as e:
        print("Exception when calling DefaultApi->foo_get: %s\n" % e)

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