mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-10 23:02:43 +00:00
Merge remote-tracking branch 'origin/5.1.x' into 6.0.x
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
README.md
|
||||
config/config.exs
|
||||
lib/openapi_petstore/api/another_fake.ex
|
||||
lib/openapi_petstore/api/default.ex
|
||||
lib/openapi_petstore/api/fake.ex
|
||||
lib/openapi_petstore/api/fake_classname_tags123.ex
|
||||
lib/openapi_petstore/api/pet.ex
|
||||
@@ -9,21 +10,13 @@ lib/openapi_petstore/api/store.ex
|
||||
lib/openapi_petstore/api/user.ex
|
||||
lib/openapi_petstore/connection.ex
|
||||
lib/openapi_petstore/deserializer.ex
|
||||
lib/openapi_petstore/model/additional_properties_any_type.ex
|
||||
lib/openapi_petstore/model/additional_properties_array.ex
|
||||
lib/openapi_petstore/model/additional_properties_boolean.ex
|
||||
lib/openapi_petstore/model/_special_model_name_.ex
|
||||
lib/openapi_petstore/model/additional_properties_class.ex
|
||||
lib/openapi_petstore/model/additional_properties_integer.ex
|
||||
lib/openapi_petstore/model/additional_properties_number.ex
|
||||
lib/openapi_petstore/model/additional_properties_object.ex
|
||||
lib/openapi_petstore/model/additional_properties_string.ex
|
||||
lib/openapi_petstore/model/animal.ex
|
||||
lib/openapi_petstore/model/api_response.ex
|
||||
lib/openapi_petstore/model/array_of_array_of_number_only.ex
|
||||
lib/openapi_petstore/model/array_of_number_only.ex
|
||||
lib/openapi_petstore/model/array_test.ex
|
||||
lib/openapi_petstore/model/big_cat.ex
|
||||
lib/openapi_petstore/model/big_cat_all_of.ex
|
||||
lib/openapi_petstore/model/capitalization.ex
|
||||
lib/openapi_petstore/model/cat.ex
|
||||
lib/openapi_petstore/model/cat_all_of.ex
|
||||
@@ -37,26 +30,29 @@ lib/openapi_petstore/model/enum_class.ex
|
||||
lib/openapi_petstore/model/enum_test.ex
|
||||
lib/openapi_petstore/model/file.ex
|
||||
lib/openapi_petstore/model/file_schema_test_class.ex
|
||||
lib/openapi_petstore/model/foo.ex
|
||||
lib/openapi_petstore/model/format_test.ex
|
||||
lib/openapi_petstore/model/has_only_read_only.ex
|
||||
lib/openapi_petstore/model/health_check_result.ex
|
||||
lib/openapi_petstore/model/inline_response_default.ex
|
||||
lib/openapi_petstore/model/list.ex
|
||||
lib/openapi_petstore/model/map_test.ex
|
||||
lib/openapi_petstore/model/mixed_properties_and_additional_properties_class.ex
|
||||
lib/openapi_petstore/model/model_200_response.ex
|
||||
lib/openapi_petstore/model/name.ex
|
||||
lib/openapi_petstore/model/nullable_class.ex
|
||||
lib/openapi_petstore/model/number_only.ex
|
||||
lib/openapi_petstore/model/order.ex
|
||||
lib/openapi_petstore/model/outer_composite.ex
|
||||
lib/openapi_petstore/model/outer_enum.ex
|
||||
lib/openapi_petstore/model/outer_enum_default_value.ex
|
||||
lib/openapi_petstore/model/outer_enum_integer.ex
|
||||
lib/openapi_petstore/model/outer_enum_integer_default_value.ex
|
||||
lib/openapi_petstore/model/pet.ex
|
||||
lib/openapi_petstore/model/read_only_first.ex
|
||||
lib/openapi_petstore/model/return.ex
|
||||
lib/openapi_petstore/model/special_model_name.ex
|
||||
lib/openapi_petstore/model/tag.ex
|
||||
lib/openapi_petstore/model/type_holder_default.ex
|
||||
lib/openapi_petstore/model/type_holder_example.ex
|
||||
lib/openapi_petstore/model/user.ex
|
||||
lib/openapi_petstore/model/xml_item.ex
|
||||
lib/openapi_petstore/request_builder.ex
|
||||
mix.exs
|
||||
test/test_helper.exs
|
||||
|
||||
@@ -18,19 +18,19 @@ defmodule OpenapiPetstore.Api.AnotherFake do
|
||||
## Parameters
|
||||
|
||||
- connection (OpenapiPetstore.Connection): Connection to server
|
||||
- body (Client): client model
|
||||
- client (Client): client model
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenapiPetstore.Model.Client{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, OpenapiPetstore.Model.Client.t} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec call_123_test_special_tags(Tesla.Env.client, OpenapiPetstore.Model.Client.t, keyword()) :: {:ok, OpenapiPetstore.Model.Client.t} | {:error, Tesla.Env.t}
|
||||
def call_123_test_special_tags(connection, body, _opts \\ []) do
|
||||
def call_123_test_special_tags(connection, client, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:patch)
|
||||
|> url("/another-fake/dummy")
|
||||
|> add_param(:body, :body, body)
|
||||
|> add_param(:body, :body, client)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
# https://openapi-generator.tech
|
||||
# Do not edit the class manually.
|
||||
|
||||
defmodule OpenapiPetstore.Api.Default do
|
||||
@moduledoc """
|
||||
API calls for all endpoints tagged `Default`.
|
||||
"""
|
||||
|
||||
alias OpenapiPetstore.Connection
|
||||
import OpenapiPetstore.RequestBuilder
|
||||
|
||||
|
||||
@doc """
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenapiPetstore.Connection): Connection to server
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, OpenapiPetstore.Model.InlineResponseDefault.t} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec foo_get(Tesla.Env.client, keyword()) :: {:ok, OpenapiPetstore.Model.InlineResponseDefault.t} | {:error, Tesla.Env.t}
|
||||
def foo_get(connection, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:get)
|
||||
|> url("/foo")
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ :default, %OpenapiPetstore.Model.InlineResponseDefault{}}
|
||||
])
|
||||
end
|
||||
end
|
||||
@@ -12,25 +12,55 @@ defmodule OpenapiPetstore.Api.Fake do
|
||||
|
||||
|
||||
@doc """
|
||||
creates an XmlItem
|
||||
this route creates an XmlItem
|
||||
Health check endpoint
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenapiPetstore.Connection): Connection to server
|
||||
- xml_item (XmlItem): XmlItem Body
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, OpenapiPetstore.Model.HealthCheckResult.t} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec create_xml_item(Tesla.Env.client, OpenapiPetstore.Model.XmlItem.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def create_xml_item(connection, xml_item, _opts \\ []) do
|
||||
@spec fake_health_get(Tesla.Env.client, keyword()) :: {:ok, OpenapiPetstore.Model.HealthCheckResult.t} | {:error, Tesla.Env.t}
|
||||
def fake_health_get(connection, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:post)
|
||||
|> url("/fake/create_xml_item")
|
||||
|> add_param(:body, :body, xml_item)
|
||||
|> method(:get)
|
||||
|> url("/fake/health")
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, %OpenapiPetstore.Model.HealthCheckResult{}}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
test http signature authentication
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenapiPetstore.Connection): Connection to server
|
||||
- pet (Pet): Pet object that needs to be added to the store
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
- :query1 (String.t): query parameter
|
||||
- :header1 (String.t): header parameter
|
||||
## Returns
|
||||
|
||||
{:ok, nil} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec fake_http_signature_test(Tesla.Env.client, OpenapiPetstore.Model.Pet.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def fake_http_signature_test(connection, pet, opts \\ []) do
|
||||
optional_params = %{
|
||||
:"query_1" => :query,
|
||||
:"header_1" => :headers
|
||||
}
|
||||
%{}
|
||||
|> method(:get)
|
||||
|> url("/fake/http-signature-test")
|
||||
|> add_param(:body, :body, pet)
|
||||
|> add_optional_params(optional_params, opts)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
@@ -48,8 +78,8 @@ defmodule OpenapiPetstore.Api.Fake do
|
||||
- :body (boolean()): Input boolean as post body
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenapiPetstore.Model.boolean(){}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, boolean()} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec fake_outer_boolean_serialize(Tesla.Env.client, keyword()) :: {:ok, Boolean.t} | {:error, Tesla.Env.t}
|
||||
def fake_outer_boolean_serialize(connection, opts \\ []) do
|
||||
@@ -60,6 +90,7 @@ defmodule OpenapiPetstore.Api.Fake do
|
||||
|> method(:post)
|
||||
|> url("/fake/outer/boolean")
|
||||
|> add_optional_params(optional_params, opts)
|
||||
|> ensure_body()
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
@@ -77,8 +108,8 @@ defmodule OpenapiPetstore.Api.Fake do
|
||||
- :body (OuterComposite): Input composite as post body
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenapiPetstore.Model.OuterComposite{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, OpenapiPetstore.Model.OuterComposite.t} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec fake_outer_composite_serialize(Tesla.Env.client, keyword()) :: {:ok, OpenapiPetstore.Model.OuterComposite.t} | {:error, Tesla.Env.t}
|
||||
def fake_outer_composite_serialize(connection, opts \\ []) do
|
||||
@@ -89,6 +120,7 @@ defmodule OpenapiPetstore.Api.Fake do
|
||||
|> method(:post)
|
||||
|> url("/fake/outer/composite")
|
||||
|> add_optional_params(optional_params, opts)
|
||||
|> ensure_body()
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
@@ -106,8 +138,8 @@ defmodule OpenapiPetstore.Api.Fake do
|
||||
- :body (float()): Input number as post body
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenapiPetstore.Model.float(){}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, float()} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec fake_outer_number_serialize(Tesla.Env.client, keyword()) :: {:ok, Float.t} | {:error, Tesla.Env.t}
|
||||
def fake_outer_number_serialize(connection, opts \\ []) do
|
||||
@@ -118,6 +150,7 @@ defmodule OpenapiPetstore.Api.Fake do
|
||||
|> method(:post)
|
||||
|> url("/fake/outer/number")
|
||||
|> add_optional_params(optional_params, opts)
|
||||
|> ensure_body()
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
@@ -135,8 +168,8 @@ defmodule OpenapiPetstore.Api.Fake do
|
||||
- :body (String.t): Input string as post body
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenapiPetstore.Model.String.t{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, String.t} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec fake_outer_string_serialize(Tesla.Env.client, keyword()) :: {:ok, String.t} | {:error, Tesla.Env.t}
|
||||
def fake_outer_string_serialize(connection, opts \\ []) do
|
||||
@@ -147,6 +180,7 @@ defmodule OpenapiPetstore.Api.Fake do
|
||||
|> method(:post)
|
||||
|> url("/fake/outer/string")
|
||||
|> add_optional_params(optional_params, opts)
|
||||
|> ensure_body()
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
@@ -160,19 +194,19 @@ defmodule OpenapiPetstore.Api.Fake do
|
||||
## Parameters
|
||||
|
||||
- connection (OpenapiPetstore.Connection): Connection to server
|
||||
- body (FileSchemaTestClass):
|
||||
- file_schema_test_class (FileSchemaTestClass):
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, nil} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec test_body_with_file_schema(Tesla.Env.client, OpenapiPetstore.Model.FileSchemaTestClass.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def test_body_with_file_schema(connection, body, _opts \\ []) do
|
||||
def test_body_with_file_schema(connection, file_schema_test_class, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:put)
|
||||
|> url("/fake/body-with-file-schema")
|
||||
|> add_param(:body, :body, body)
|
||||
|> add_param(:body, :body, file_schema_test_class)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
@@ -186,20 +220,20 @@ defmodule OpenapiPetstore.Api.Fake do
|
||||
|
||||
- connection (OpenapiPetstore.Connection): Connection to server
|
||||
- query (String.t):
|
||||
- body (User):
|
||||
- user (User):
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, nil} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec test_body_with_query_params(Tesla.Env.client, String.t, OpenapiPetstore.Model.User.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def test_body_with_query_params(connection, query, body, _opts \\ []) do
|
||||
def test_body_with_query_params(connection, query, user, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:put)
|
||||
|> url("/fake/body-with-query-params")
|
||||
|> add_param(:query, :"query", query)
|
||||
|> add_param(:body, :body, body)
|
||||
|> add_param(:body, :body, user)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
@@ -214,19 +248,19 @@ defmodule OpenapiPetstore.Api.Fake do
|
||||
## Parameters
|
||||
|
||||
- connection (OpenapiPetstore.Connection): Connection to server
|
||||
- body (Client): client model
|
||||
- client (Client): client model
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenapiPetstore.Model.Client{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, OpenapiPetstore.Model.Client.t} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec test_client_model(Tesla.Env.client, OpenapiPetstore.Model.Client.t, keyword()) :: {:ok, OpenapiPetstore.Model.Client.t} | {:error, Tesla.Env.t}
|
||||
def test_client_model(connection, body, _opts \\ []) do
|
||||
def test_client_model(connection, client, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:patch)
|
||||
|> url("/fake")
|
||||
|> add_param(:body, :body, body)
|
||||
|> add_param(:body, :body, client)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
@@ -235,8 +269,8 @@ defmodule OpenapiPetstore.Api.Fake do
|
||||
end
|
||||
|
||||
@doc """
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
|
||||
## Parameters
|
||||
|
||||
@@ -258,8 +292,8 @@ defmodule OpenapiPetstore.Api.Fake do
|
||||
- :callback (String.t): None
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, nil} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec test_endpoint_parameters(Tesla.Env.client, float(), float(), String.t, binary(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def test_endpoint_parameters(connection, number, double, pattern_without_delimiter, byte, opts \\ []) do
|
||||
@@ -309,8 +343,8 @@ defmodule OpenapiPetstore.Api.Fake do
|
||||
- :enum_form_string (String.t): Form parameter enum test (string)
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, nil} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec test_enum_parameters(Tesla.Env.client, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def test_enum_parameters(connection, opts \\ []) do
|
||||
@@ -352,8 +386,8 @@ defmodule OpenapiPetstore.Api.Fake do
|
||||
- :int64_group (integer()): Integer in group parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, nil} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec test_group_parameters(Tesla.Env.client, integer(), boolean(), integer(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def test_group_parameters(connection, required_string_group, required_boolean_group, required_int64_group, opts \\ []) do
|
||||
@@ -382,19 +416,19 @@ defmodule OpenapiPetstore.Api.Fake do
|
||||
## Parameters
|
||||
|
||||
- connection (OpenapiPetstore.Connection): Connection to server
|
||||
- param (%{optional(String.t) => String.t}): request body
|
||||
- request_body (%{optional(String.t) => String.t}): request body
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, nil} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec test_inline_additional_properties(Tesla.Env.client, %{optional(String.t) => String.t}, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def test_inline_additional_properties(connection, param, _opts \\ []) do
|
||||
def test_inline_additional_properties(connection, request_body, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:post)
|
||||
|> url("/fake/inline-additionalProperties")
|
||||
|> add_param(:body, :body, param)
|
||||
|> add_param(:body, :body, request_body)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
@@ -413,8 +447,8 @@ defmodule OpenapiPetstore.Api.Fake do
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, nil} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec test_json_form_data(Tesla.Env.client, String.t, String.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def test_json_form_data(connection, param, param2, _opts \\ []) do
|
||||
@@ -444,8 +478,8 @@ defmodule OpenapiPetstore.Api.Fake do
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, nil} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec test_query_parameter_collection_format(Tesla.Env.client, list(String.t), list(String.t), list(String.t), list(String.t), list(String.t), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def test_query_parameter_collection_format(connection, pipe, ioutil, http, url, context, _opts \\ []) do
|
||||
@@ -457,6 +491,7 @@ defmodule OpenapiPetstore.Api.Fake do
|
||||
|> add_param(:query, :"http", http)
|
||||
|> add_param(:query, :"url", url)
|
||||
|> add_param(:query, :"context", context)
|
||||
|> ensure_body()
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
|
||||
@@ -18,19 +18,19 @@ defmodule OpenapiPetstore.Api.FakeClassnameTags123 do
|
||||
## Parameters
|
||||
|
||||
- connection (OpenapiPetstore.Connection): Connection to server
|
||||
- body (Client): client model
|
||||
- client (Client): client model
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenapiPetstore.Model.Client{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, OpenapiPetstore.Model.Client.t} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec test_classname(Tesla.Env.client, OpenapiPetstore.Model.Client.t, keyword()) :: {:ok, OpenapiPetstore.Model.Client.t} | {:error, Tesla.Env.t}
|
||||
def test_classname(connection, body, _opts \\ []) do
|
||||
def test_classname(connection, client, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:patch)
|
||||
|> url("/fake_classname_test")
|
||||
|> add_param(:body, :body, body)
|
||||
|> add_param(:body, :body, client)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
|
||||
@@ -17,19 +17,19 @@ defmodule OpenapiPetstore.Api.Pet do
|
||||
## Parameters
|
||||
|
||||
- connection (OpenapiPetstore.Connection): Connection to server
|
||||
- body (Pet): Pet object that needs to be added to the store
|
||||
- pet (Pet): Pet object that needs to be added to the store
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, nil} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec add_pet(Tesla.Env.client, OpenapiPetstore.Model.Pet.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def add_pet(connection, body, _opts \\ []) do
|
||||
def add_pet(connection, pet, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:post)
|
||||
|> url("/pet")
|
||||
|> add_param(:body, :body, body)
|
||||
|> add_param(:body, :body, pet)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
@@ -49,8 +49,8 @@ defmodule OpenapiPetstore.Api.Pet do
|
||||
- :api_key (String.t):
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, nil} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec delete_pet(Tesla.Env.client, integer(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def delete_pet(connection, pet_id, opts \\ []) do
|
||||
@@ -81,7 +81,7 @@ defmodule OpenapiPetstore.Api.Pet do
|
||||
## Returns
|
||||
|
||||
{:ok, [%Pet{}, ...]} on success
|
||||
{:error, info} on failure
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec find_pets_by_status(Tesla.Env.client, list(String.t), keyword()) :: {:ok, nil} | {:ok, list(OpenapiPetstore.Model.Pet.t)} | {:error, Tesla.Env.t}
|
||||
def find_pets_by_status(connection, status, _opts \\ []) do
|
||||
@@ -109,7 +109,7 @@ defmodule OpenapiPetstore.Api.Pet do
|
||||
## Returns
|
||||
|
||||
{:ok, [%Pet{}, ...]} on success
|
||||
{:error, info} on failure
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec find_pets_by_tags(Tesla.Env.client, list(String.t), keyword()) :: {:ok, nil} | {:ok, list(OpenapiPetstore.Model.Pet.t)} | {:error, Tesla.Env.t}
|
||||
def find_pets_by_tags(connection, tags, _opts \\ []) do
|
||||
@@ -136,8 +136,8 @@ defmodule OpenapiPetstore.Api.Pet do
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenapiPetstore.Model.Pet{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, OpenapiPetstore.Model.Pet.t} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec get_pet_by_id(Tesla.Env.client, integer(), keyword()) :: {:ok, nil} | {:ok, OpenapiPetstore.Model.Pet.t} | {:error, Tesla.Env.t}
|
||||
def get_pet_by_id(connection, pet_id, _opts \\ []) do
|
||||
@@ -159,19 +159,19 @@ defmodule OpenapiPetstore.Api.Pet do
|
||||
## Parameters
|
||||
|
||||
- connection (OpenapiPetstore.Connection): Connection to server
|
||||
- body (Pet): Pet object that needs to be added to the store
|
||||
- pet (Pet): Pet object that needs to be added to the store
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, nil} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec update_pet(Tesla.Env.client, OpenapiPetstore.Model.Pet.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def update_pet(connection, body, _opts \\ []) do
|
||||
def update_pet(connection, pet, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:put)
|
||||
|> url("/pet")
|
||||
|> add_param(:body, :body, body)
|
||||
|> add_param(:body, :body, pet)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
@@ -194,8 +194,8 @@ defmodule OpenapiPetstore.Api.Pet do
|
||||
- :status (String.t): Updated status of the pet
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, nil} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec update_pet_with_form(Tesla.Env.client, integer(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def update_pet_with_form(connection, pet_id, opts \\ []) do
|
||||
@@ -207,9 +207,11 @@ defmodule OpenapiPetstore.Api.Pet do
|
||||
|> method(:post)
|
||||
|> url("/pet/#{pet_id}")
|
||||
|> add_optional_params(optional_params, opts)
|
||||
|> ensure_body()
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, false},
|
||||
{ 405, false}
|
||||
])
|
||||
end
|
||||
@@ -226,8 +228,8 @@ defmodule OpenapiPetstore.Api.Pet do
|
||||
- :file (String.t): file to upload
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenapiPetstore.Model.ApiResponse{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, OpenapiPetstore.Model.ApiResponse.t} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec upload_file(Tesla.Env.client, integer(), keyword()) :: {:ok, OpenapiPetstore.Model.ApiResponse.t} | {:error, Tesla.Env.t}
|
||||
def upload_file(connection, pet_id, opts \\ []) do
|
||||
@@ -239,6 +241,7 @@ defmodule OpenapiPetstore.Api.Pet do
|
||||
|> method(:post)
|
||||
|> url("/pet/#{pet_id}/uploadImage")
|
||||
|> add_optional_params(optional_params, opts)
|
||||
|> ensure_body()
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
@@ -258,8 +261,8 @@ defmodule OpenapiPetstore.Api.Pet do
|
||||
- :additional_metadata (String.t): Additional data to pass to server
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenapiPetstore.Model.ApiResponse{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, OpenapiPetstore.Model.ApiResponse.t} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec upload_file_with_required_file(Tesla.Env.client, integer(), String.t, keyword()) :: {:ok, OpenapiPetstore.Model.ApiResponse.t} | {:error, Tesla.Env.t}
|
||||
def upload_file_with_required_file(connection, pet_id, required_file, opts \\ []) do
|
||||
|
||||
@@ -22,8 +22,8 @@ defmodule OpenapiPetstore.Api.Store do
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, nil} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec delete_order(Tesla.Env.client, String.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def delete_order(connection, order_id, _opts \\ []) do
|
||||
@@ -49,7 +49,7 @@ defmodule OpenapiPetstore.Api.Store do
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec get_inventory(Tesla.Env.client, keyword()) :: {:ok, map()} | {:error, Tesla.Env.t}
|
||||
def get_inventory(connection, _opts \\ []) do
|
||||
@@ -74,8 +74,8 @@ defmodule OpenapiPetstore.Api.Store do
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenapiPetstore.Model.Order{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, OpenapiPetstore.Model.Order.t} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec get_order_by_id(Tesla.Env.client, integer(), keyword()) :: {:ok, nil} | {:ok, OpenapiPetstore.Model.Order.t} | {:error, Tesla.Env.t}
|
||||
def get_order_by_id(connection, order_id, _opts \\ []) do
|
||||
@@ -97,19 +97,19 @@ defmodule OpenapiPetstore.Api.Store do
|
||||
## Parameters
|
||||
|
||||
- connection (OpenapiPetstore.Connection): Connection to server
|
||||
- body (Order): order placed for purchasing the pet
|
||||
- order (Order): order placed for purchasing the pet
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenapiPetstore.Model.Order{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, OpenapiPetstore.Model.Order.t} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec place_order(Tesla.Env.client, OpenapiPetstore.Model.Order.t, keyword()) :: {:ok, nil} | {:ok, OpenapiPetstore.Model.Order.t} | {:error, Tesla.Env.t}
|
||||
def place_order(connection, body, _opts \\ []) do
|
||||
def place_order(connection, order, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:post)
|
||||
|> url("/store/order")
|
||||
|> add_param(:body, :body, body)
|
||||
|> add_param(:body, :body, order)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
|
||||
@@ -18,19 +18,19 @@ defmodule OpenapiPetstore.Api.User do
|
||||
## Parameters
|
||||
|
||||
- connection (OpenapiPetstore.Connection): Connection to server
|
||||
- body (User): Created user object
|
||||
- user (User): Created user object
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, nil} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec create_user(Tesla.Env.client, OpenapiPetstore.Model.User.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def create_user(connection, body, _opts \\ []) do
|
||||
def create_user(connection, user, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:post)
|
||||
|> url("/user")
|
||||
|> add_param(:body, :body, body)
|
||||
|> add_param(:body, :body, user)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
@@ -44,19 +44,19 @@ defmodule OpenapiPetstore.Api.User do
|
||||
## Parameters
|
||||
|
||||
- connection (OpenapiPetstore.Connection): Connection to server
|
||||
- body ([User]): List of user object
|
||||
- user ([OpenapiPetstore.Model.User.t]): List of user object
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, nil} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec create_users_with_array_input(Tesla.Env.client, list(OpenapiPetstore.Model.User.t), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def create_users_with_array_input(connection, body, _opts \\ []) do
|
||||
def create_users_with_array_input(connection, user, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:post)
|
||||
|> url("/user/createWithArray")
|
||||
|> add_param(:body, :body, body)
|
||||
|> add_param(:body, :body, user)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
@@ -70,19 +70,19 @@ defmodule OpenapiPetstore.Api.User do
|
||||
## Parameters
|
||||
|
||||
- connection (OpenapiPetstore.Connection): Connection to server
|
||||
- body ([User]): List of user object
|
||||
- user ([OpenapiPetstore.Model.User.t]): List of user object
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, nil} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec create_users_with_list_input(Tesla.Env.client, list(OpenapiPetstore.Model.User.t), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def create_users_with_list_input(connection, body, _opts \\ []) do
|
||||
def create_users_with_list_input(connection, user, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:post)
|
||||
|> url("/user/createWithList")
|
||||
|> add_param(:body, :body, body)
|
||||
|> add_param(:body, :body, user)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
@@ -101,8 +101,8 @@ defmodule OpenapiPetstore.Api.User do
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, nil} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec delete_user(Tesla.Env.client, String.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def delete_user(connection, username, _opts \\ []) do
|
||||
@@ -127,8 +127,8 @@ defmodule OpenapiPetstore.Api.User do
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenapiPetstore.Model.User{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, OpenapiPetstore.Model.User.t} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec get_user_by_name(Tesla.Env.client, String.t, keyword()) :: {:ok, nil} | {:ok, OpenapiPetstore.Model.User.t} | {:error, Tesla.Env.t}
|
||||
def get_user_by_name(connection, username, _opts \\ []) do
|
||||
@@ -155,8 +155,8 @@ defmodule OpenapiPetstore.Api.User do
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenapiPetstore.Model.String.t{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, String.t} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec login_user(Tesla.Env.client, String.t, String.t, keyword()) :: {:ok, nil} | {:ok, String.t} | {:error, Tesla.Env.t}
|
||||
def login_user(connection, username, password, _opts \\ []) do
|
||||
@@ -182,8 +182,8 @@ defmodule OpenapiPetstore.Api.User do
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, nil} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec logout_user(Tesla.Env.client, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def logout_user(connection, _opts \\ []) do
|
||||
@@ -205,19 +205,19 @@ defmodule OpenapiPetstore.Api.User do
|
||||
|
||||
- connection (OpenapiPetstore.Connection): Connection to server
|
||||
- username (String.t): name that need to be deleted
|
||||
- body (User): Updated user object
|
||||
- user (User): Updated user object
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
{:ok, nil} on success
|
||||
{:error, Tesla.Env.t} on failure
|
||||
"""
|
||||
@spec update_user(Tesla.Env.client, String.t, OpenapiPetstore.Model.User.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def update_user(connection, username, body, _opts \\ []) do
|
||||
def update_user(connection, username, user, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:put)
|
||||
|> url("/user/#{username}")
|
||||
|> add_param(:body, :body, body)
|
||||
|> add_param(:body, :body, user)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
|
||||
@@ -24,6 +24,42 @@ defmodule OpenapiPetstore.Connection do
|
||||
|
||||
# Returns
|
||||
|
||||
Tesla.Env.client
|
||||
"""
|
||||
@spec new(String.t, String.t) :: Tesla.Env.client
|
||||
def new(username, password) do
|
||||
Tesla.client([
|
||||
{Tesla.Middleware.BasicAuth, %{username: username, password: password}}
|
||||
])
|
||||
end
|
||||
@doc """
|
||||
Configure a client connection using Basic authentication.
|
||||
|
||||
## Parameters
|
||||
|
||||
- username (String): Username used for authentication
|
||||
- password (String): Password used for authentication
|
||||
|
||||
# Returns
|
||||
|
||||
Tesla.Env.client
|
||||
"""
|
||||
@spec new(String.t, String.t) :: Tesla.Env.client
|
||||
def new(username, password) do
|
||||
Tesla.client([
|
||||
{Tesla.Middleware.BasicAuth, %{username: username, password: password}}
|
||||
])
|
||||
end
|
||||
@doc """
|
||||
Configure a client connection using Basic authentication.
|
||||
|
||||
## Parameters
|
||||
|
||||
- username (String): Username used for authentication
|
||||
- password (String): Password used for authentication
|
||||
|
||||
# Returns
|
||||
|
||||
Tesla.Env.client
|
||||
"""
|
||||
@spec new(String.t, String.t) :: Tesla.Env.client
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
# https://openapi-generator.tech
|
||||
# Do not edit the class manually.
|
||||
|
||||
defmodule OpenapiPetstore.Model.SpecialModelName do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"$special[property.name]"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"$special[property.name]" => integer() | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenapiPetstore.Model.SpecialModelName do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,31 +9,13 @@ defmodule OpenapiPetstore.Model.AdditionalPropertiesClass do
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"map_string",
|
||||
:"map_number",
|
||||
:"map_integer",
|
||||
:"map_boolean",
|
||||
:"map_array_integer",
|
||||
:"map_array_anytype",
|
||||
:"map_map_string",
|
||||
:"map_map_anytype",
|
||||
:"anytype_1",
|
||||
:"anytype_2",
|
||||
:"anytype_3"
|
||||
:"map_property",
|
||||
:"map_of_map_property"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"map_string" => %{optional(String.t) => String.t} | nil,
|
||||
:"map_number" => %{optional(String.t) => float()} | nil,
|
||||
:"map_integer" => %{optional(String.t) => integer()} | nil,
|
||||
:"map_boolean" => %{optional(String.t) => boolean()} | nil,
|
||||
:"map_array_integer" => %{optional(String.t) => [integer()]} | nil,
|
||||
:"map_array_anytype" => %{optional(String.t) => [Map]} | nil,
|
||||
:"map_map_string" => %{optional(String.t) => %{optional(String.t) => String.t}} | nil,
|
||||
:"map_map_anytype" => %{optional(String.t) => %{optional(String.t) => Map}} | nil,
|
||||
:"anytype_1" => Map | nil,
|
||||
:"anytype_2" => Map | nil,
|
||||
:"anytype_3" => Map | nil
|
||||
:"map_property" => %{optional(String.t) => String.t} | nil,
|
||||
:"map_of_map_property" => %{optional(String.t) => %{optional(String.t) => String.t}} | nil
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ defmodule OpenapiPetstore.Model.ArrayTest do
|
||||
@type t :: %__MODULE__{
|
||||
:"array_of_string" => [String.t] | nil,
|
||||
:"array_array_of_integer" => [[integer()]] | nil,
|
||||
:"array_array_of_model" => [[ReadOnlyFirst]] | nil
|
||||
:"array_array_of_model" => [[OpenapiPetstore.Model.ReadOnlyFirst.t]] | nil
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
@@ -13,7 +13,10 @@ defmodule OpenapiPetstore.Model.EnumTest do
|
||||
:"enum_string_required",
|
||||
:"enum_integer",
|
||||
:"enum_number",
|
||||
:"outerEnum"
|
||||
:"outerEnum",
|
||||
:"outerEnumInteger",
|
||||
:"outerEnumDefaultValue",
|
||||
:"outerEnumIntegerDefaultValue"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
@@ -21,7 +24,10 @@ defmodule OpenapiPetstore.Model.EnumTest do
|
||||
:"enum_string_required" => String.t,
|
||||
:"enum_integer" => integer() | nil,
|
||||
:"enum_number" => float() | nil,
|
||||
:"outerEnum" => OuterEnum | nil
|
||||
:"outerEnum" => OpenapiPetstore.Model.OuterEnum.t | nil,
|
||||
:"outerEnumInteger" => OpenapiPetstore.Model.OuterEnumInteger.t | nil,
|
||||
:"outerEnumDefaultValue" => OpenapiPetstore.Model.OuterEnumDefaultValue.t | nil,
|
||||
:"outerEnumIntegerDefaultValue" => OpenapiPetstore.Model.OuterEnumIntegerDefaultValue.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
@@ -30,6 +36,9 @@ defimpl Poison.Decoder, for: OpenapiPetstore.Model.EnumTest do
|
||||
def decode(value, options) do
|
||||
value
|
||||
|> deserialize(:"outerEnum", :struct, OpenapiPetstore.Model.OuterEnum, options)
|
||||
|> deserialize(:"outerEnumInteger", :struct, OpenapiPetstore.Model.OuterEnumInteger, options)
|
||||
|> deserialize(:"outerEnumDefaultValue", :struct, OpenapiPetstore.Model.OuterEnumDefaultValue, options)
|
||||
|> deserialize(:"outerEnumIntegerDefaultValue", :struct, OpenapiPetstore.Model.OuterEnumIntegerDefaultValue, options)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ defmodule OpenapiPetstore.Model.FileSchemaTestClass do
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"file" => File | nil,
|
||||
:"files" => [File] | nil
|
||||
:"file" => OpenapiPetstore.Model.File.t | nil,
|
||||
:"files" => [OpenapiPetstore.Model.File.t] | nil
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
# https://openapi-generator.tech
|
||||
# Do not edit the class manually.
|
||||
|
||||
defmodule OpenapiPetstore.Model.Foo do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"bar"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"bar" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenapiPetstore.Model.Foo do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
||||
@@ -15,6 +15,7 @@ defmodule OpenapiPetstore.Model.FormatTest do
|
||||
:"number",
|
||||
:"float",
|
||||
:"double",
|
||||
:"decimal",
|
||||
:"string",
|
||||
:"byte",
|
||||
:"binary",
|
||||
@@ -22,7 +23,8 @@ defmodule OpenapiPetstore.Model.FormatTest do
|
||||
:"dateTime",
|
||||
:"uuid",
|
||||
:"password",
|
||||
:"BigDecimal"
|
||||
:"pattern_with_digits",
|
||||
:"pattern_with_digits_and_delimiter"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
@@ -32,6 +34,7 @@ defmodule OpenapiPetstore.Model.FormatTest do
|
||||
:"number" => float(),
|
||||
:"float" => float() | nil,
|
||||
:"double" => float() | nil,
|
||||
:"decimal" => String.t | nil,
|
||||
:"string" => String.t | nil,
|
||||
:"byte" => binary(),
|
||||
:"binary" => String.t | nil,
|
||||
@@ -39,7 +42,8 @@ defmodule OpenapiPetstore.Model.FormatTest do
|
||||
:"dateTime" => DateTime.t | nil,
|
||||
:"uuid" => String.t | nil,
|
||||
:"password" => String.t,
|
||||
:"BigDecimal" => String.t | nil
|
||||
:"pattern_with_digits" => String.t | nil,
|
||||
:"pattern_with_digits_and_delimiter" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
@@ -48,7 +52,6 @@ defimpl Poison.Decoder, for: OpenapiPetstore.Model.FormatTest do
|
||||
def decode(value, options) do
|
||||
value
|
||||
|> deserialize(:"date", :date, nil, options)
|
||||
|> deserialize(:"BigDecimal", :struct, OpenapiPetstore.Model.String.t, options)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
# https://openapi-generator.tech
|
||||
# Do not edit the class manually.
|
||||
|
||||
defmodule OpenapiPetstore.Model.HealthCheckResult do
|
||||
@moduledoc """
|
||||
Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"NullableMessage"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"NullableMessage" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenapiPetstore.Model.HealthCheckResult do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
# https://openapi-generator.tech
|
||||
# Do not edit the class manually.
|
||||
|
||||
defmodule OpenapiPetstore.Model.InlineResponseDefault do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"string"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"string" => OpenapiPetstore.Model.Foo.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenapiPetstore.Model.InlineResponseDefault do
|
||||
import OpenapiPetstore.Deserializer
|
||||
def decode(value, options) do
|
||||
value
|
||||
|> deserialize(:"string", :struct, OpenapiPetstore.Model.Foo, options)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -17,7 +17,7 @@ defmodule OpenapiPetstore.Model.MixedPropertiesAndAdditionalPropertiesClass do
|
||||
@type t :: %__MODULE__{
|
||||
:"uuid" => String.t | nil,
|
||||
:"dateTime" => DateTime.t | nil,
|
||||
:"map" => %{optional(String.t) => Animal} | nil
|
||||
:"map" => %{optional(String.t) => OpenapiPetstore.Model.Animal.t} | nil
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
# https://openapi-generator.tech
|
||||
# Do not edit the class manually.
|
||||
|
||||
defmodule OpenapiPetstore.Model.NullableClass do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"integer_prop",
|
||||
:"number_prop",
|
||||
:"boolean_prop",
|
||||
:"string_prop",
|
||||
:"date_prop",
|
||||
:"datetime_prop",
|
||||
:"array_nullable_prop",
|
||||
:"array_and_items_nullable_prop",
|
||||
:"array_items_nullable",
|
||||
:"object_nullable_prop",
|
||||
:"object_and_items_nullable_prop",
|
||||
:"object_items_nullable"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"integer_prop" => integer() | nil,
|
||||
:"number_prop" => float() | nil,
|
||||
:"boolean_prop" => boolean() | nil,
|
||||
:"string_prop" => String.t | nil,
|
||||
:"date_prop" => Date.t | nil,
|
||||
:"datetime_prop" => DateTime.t | nil,
|
||||
:"array_nullable_prop" => [map()] | nil,
|
||||
:"array_and_items_nullable_prop" => [map()] | nil,
|
||||
:"array_items_nullable" => [map()] | nil,
|
||||
:"object_nullable_prop" => %{optional(String.t) => map()} | nil,
|
||||
:"object_and_items_nullable_prop" => %{optional(String.t) => map()} | nil,
|
||||
:"object_items_nullable" => %{optional(String.t) => map()} | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenapiPetstore.Model.NullableClass do
|
||||
import OpenapiPetstore.Deserializer
|
||||
def decode(value, options) do
|
||||
value
|
||||
|> deserialize(:"date_prop", :date, nil, options)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
# https://openapi-generator.tech
|
||||
# Do not edit the class manually.
|
||||
|
||||
defmodule OpenapiPetstore.Model.OuterEnumDefaultValue do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenapiPetstore.Model.OuterEnumDefaultValue do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
# https://openapi-generator.tech
|
||||
# Do not edit the class manually.
|
||||
|
||||
defmodule OpenapiPetstore.Model.OuterEnumInteger do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenapiPetstore.Model.OuterEnumInteger do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
# https://openapi-generator.tech
|
||||
# Do not edit the class manually.
|
||||
|
||||
defmodule OpenapiPetstore.Model.OuterEnumIntegerDefaultValue do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenapiPetstore.Model.OuterEnumIntegerDefaultValue do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
||||
@@ -19,10 +19,10 @@ defmodule OpenapiPetstore.Model.Pet do
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"id" => integer() | nil,
|
||||
:"category" => Category | nil,
|
||||
:"category" => OpenapiPetstore.Model.Category.t | nil,
|
||||
:"name" => String.t,
|
||||
:"photoUrls" => [String.t],
|
||||
:"tags" => [Tag] | nil,
|
||||
:"tags" => [OpenapiPetstore.Model.Tag.t] | nil,
|
||||
:"status" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
@@ -105,6 +105,28 @@ defmodule OpenapiPetstore.RequestBuilder do
|
||||
Map.update(request, location, [{key, value}], &(&1 ++ [{key, value}]))
|
||||
end
|
||||
|
||||
@doc """
|
||||
Due to a bug in httpc, POST, PATCH and PUT requests will fail, if the body is empty
|
||||
|
||||
This function will ensure, that the body param is always set
|
||||
|
||||
## Parameters
|
||||
|
||||
- request (Map) - Collected request options
|
||||
|
||||
## Returns
|
||||
|
||||
Map
|
||||
"""
|
||||
@spec ensure_body(map()) :: map()
|
||||
def ensure_body(%{body: nil} = request) do
|
||||
%{request | body: ""}
|
||||
end
|
||||
|
||||
def ensure_body(request) do
|
||||
Map.put_new(request, :body, "")
|
||||
end
|
||||
|
||||
@doc """
|
||||
Handle the response for a Tesla request
|
||||
|
||||
|
||||
Reference in New Issue
Block a user