forked from loafle/openapi-generator-original
[Elixir] update to 1.6 version (#2741)
* [Elixir] update version / add test * update samples (add missing 200 responses in petstore-with-fake-endpoints-models-for-testing.yaml) * [Elixir] update to 1.6 version * [Elixir] fix test petapi
This commit is contained in:
parent
6e6926a8b8
commit
0ae43fcb7a
@ -27,8 +27,8 @@ fi
|
||||
|
||||
# remove existing lib and model file
|
||||
echo "removing existing lib, model files"
|
||||
rm -Rf "samples/client/petstore/elixir/lib/swagger_petstore/model/"
|
||||
rm -Rf "samples/client/petstore/elixir/lib/swagger_petstore/lib/"
|
||||
rm -Rf "samples/client/petstore/elixir/lib/openapi_petstore/model/"
|
||||
rm -Rf "samples/client/petstore/elixir/lib/openapi_petstore/api/"
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
|
@ -48,6 +48,7 @@ declare -a scripts=(
|
||||
"./bin/r-petstore.sh"
|
||||
"./bin/haskell-http-client-petstore.sh"
|
||||
"./bin/csharp-petstore.sh"
|
||||
"./bin/elixir-petstore.sh"
|
||||
"./bin/meta-codegen.sh"
|
||||
# OTHERS
|
||||
"./bin/utils/export_docs_generators.sh"
|
||||
|
@ -50,11 +50,11 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
// This is the name of elixir project name;
|
||||
protected static final String defaultPackageName = "openapi_client";
|
||||
|
||||
String supportedElixirVersion = "1.4";
|
||||
String supportedElixirVersion = "1.6";
|
||||
List<String> extraApplications = Arrays.asList(":logger");
|
||||
List<String> deps = Arrays.asList(
|
||||
"{:tesla, \"~> 1.0.0\"}",
|
||||
"{:poison, \"~> 3.0.0\"}"
|
||||
"{:tesla, \"~> 1.2\"}",
|
||||
"{:poison, \"~> 3.0\"}"
|
||||
);
|
||||
|
||||
public ElixirClientCodegen() {
|
||||
@ -187,6 +187,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
* @return the CodegenType for this generator
|
||||
* @see org.openapitools.codegen.CodegenType
|
||||
*/
|
||||
@Override
|
||||
public CodegenType getTag() {
|
||||
return CodegenType.CLIENT;
|
||||
}
|
||||
@ -197,6 +198,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
*
|
||||
* @return the friendly name for the generator
|
||||
*/
|
||||
@Override
|
||||
public String getName() {
|
||||
return "elixir";
|
||||
}
|
||||
@ -207,6 +209,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
*
|
||||
* @return A string value for the help message
|
||||
*/
|
||||
@Override
|
||||
public String getHelp() {
|
||||
return "Generates an elixir client library (alpha).";
|
||||
}
|
||||
@ -270,10 +273,10 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> objs, List<Object> allModels) {
|
||||
Map<String, Object> operations = (Map<String, Object>) super.postProcessOperationsWithModels(objs, allModels).get("operations");
|
||||
List<CodegenOperation> os = (List<CodegenOperation>) operations.get("operation");
|
||||
List<ExtendedCodegenOperation> newOs = new ArrayList<ExtendedCodegenOperation>();
|
||||
List<ExtendedCodegenOperation> newOs = new ArrayList<>();
|
||||
Pattern pattern = Pattern.compile("\\{([^\\}]+)\\}([^\\{]*)");
|
||||
for (CodegenOperation o : os) {
|
||||
ArrayList<String> pathTemplateNames = new ArrayList<String>();
|
||||
ArrayList<String> pathTemplateNames = new ArrayList<>();
|
||||
Matcher matcher = pattern.matcher(o.path);
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
while (matcher.find()) {
|
||||
@ -328,16 +331,16 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
String underscored(String words) {
|
||||
ArrayList<String> underscoredWords = new ArrayList<String>();
|
||||
private String underscored(String words) {
|
||||
ArrayList<String> underscoredWords = new ArrayList<>();
|
||||
for (String word : words.split(" ")) {
|
||||
underscoredWords.add(underscore(word));
|
||||
}
|
||||
return join("_", underscoredWords);
|
||||
}
|
||||
|
||||
String modulized(String words) {
|
||||
ArrayList<String> modulizedWords = new ArrayList<String>();
|
||||
private String modulized(String words) {
|
||||
ArrayList<String> modulizedWords = new ArrayList<>();
|
||||
for (String word : words.split(" ")) {
|
||||
modulizedWords.add(camelize(word));
|
||||
}
|
||||
@ -356,7 +359,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
}
|
||||
|
||||
private String sourceFolder() {
|
||||
ArrayList<String> underscoredWords = new ArrayList<String>();
|
||||
ArrayList<String> underscoredWords = new ArrayList<>();
|
||||
for (String word : moduleName.split("\\.")) {
|
||||
underscoredWords.add(underscore(word));
|
||||
}
|
||||
@ -367,6 +370,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
* Location to write model files. You can use the modelPackage() as defined when the class is
|
||||
* instantiated
|
||||
*/
|
||||
@Override
|
||||
public String modelFileFolder() {
|
||||
return outputFolder + File.separator + sourceFolder() + File.separator + "model";
|
||||
}
|
||||
@ -607,7 +611,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
}
|
||||
|
||||
class ExtendedCodegenOperation extends CodegenOperation {
|
||||
private List<String> pathTemplateNames = new ArrayList<String>();
|
||||
private List<String> pathTemplateNames = new ArrayList<>();
|
||||
private String replacedPathName;
|
||||
|
||||
public ExtendedCodegenOperation(CodegenOperation o) {
|
||||
|
@ -2,6 +2,14 @@
|
||||
|
||||
{{appDescription}}
|
||||
|
||||
### Building
|
||||
|
||||
To install the required dependencies and to build the elixir project, run:
|
||||
```
|
||||
mix local.hex --force
|
||||
mix do deps.get, compile
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
|
||||
|
@ -33,7 +33,7 @@ defmodule {{moduleName}}.Connection do
|
||||
"""
|
||||
@spec new(String.t) :: Tesla.Env.client
|
||||
def new(token) when is_binary(token) do
|
||||
Tesla.build_client([
|
||||
Tesla.client([
|
||||
{Tesla.Middleware.Headers, [{"authorization", "Bearer #{token}"}]}
|
||||
])
|
||||
end
|
||||
@ -71,7 +71,7 @@ defmodule {{moduleName}}.Connection do
|
||||
"""
|
||||
@spec new(String.t, String.t) :: Tesla.Env.client
|
||||
def new(username, password) do
|
||||
Tesla.build_client([
|
||||
Tesla.client([
|
||||
{Tesla.Middleware.BasicAuth, %{username: username, password: password}}
|
||||
])
|
||||
end
|
||||
@ -87,6 +87,6 @@ defmodule {{moduleName}}.Connection do
|
||||
"""
|
||||
@spec new() :: Tesla.Env.client
|
||||
def new do
|
||||
Tesla.build_client([])
|
||||
Tesla.client([])
|
||||
end
|
||||
end
|
||||
|
@ -3,7 +3,7 @@ defmodule {{moduleName}}.Mixfile do
|
||||
|
||||
def project do
|
||||
[app: :{{#underscored}}{{packageName}}{{/underscored}},
|
||||
version: "0.1.0",
|
||||
version: "{{appVersion}}",
|
||||
elixir: "~> {{supportedElixirVersion}}",
|
||||
build_embedded: Mix.env == :prod,
|
||||
start_permanent: Mix.env == :prod,
|
||||
@ -24,7 +24,7 @@ defmodule {{moduleName}}.Mixfile do
|
||||
#
|
||||
# Or git/path repositories:
|
||||
#
|
||||
# {:my_dep, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"}
|
||||
# {:my_dep, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.3.0"}
|
||||
#
|
||||
# Type "mix help deps" for more examples and options
|
||||
defp deps do
|
||||
|
@ -39,6 +39,8 @@ paths:
|
||||
schema:
|
||||
$ref: '#/definitions/Pet'
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
'405':
|
||||
description: Invalid input
|
||||
security:
|
||||
@ -65,6 +67,8 @@ paths:
|
||||
schema:
|
||||
$ref: '#/definitions/Pet'
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
'400':
|
||||
description: Invalid ID supplied
|
||||
'404':
|
||||
@ -229,6 +233,8 @@ paths:
|
||||
type: integer
|
||||
format: int64
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
'400':
|
||||
description: Invalid pet value
|
||||
security:
|
||||
|
@ -1,18 +1,26 @@
|
||||
# OpenAPIPetstore
|
||||
# OpenapiPetstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
### Building
|
||||
|
||||
To install the required dependencies and to build the elixir project, run:
|
||||
```
|
||||
mix local.hex --force
|
||||
mix do deps.get, compile
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
|
||||
by adding `open_api_petstore` to your list of dependencies in `mix.exs`:
|
||||
by adding `openapi_petstore` to your list of dependencies in `mix.exs`:
|
||||
|
||||
```elixir
|
||||
def deps do
|
||||
[{:open_api_petstore, "~> 0.1.0"}]
|
||||
[{:openapi_petstore, "~> 0.1.0"}]
|
||||
end
|
||||
```
|
||||
|
||||
Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
|
||||
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
|
||||
be found at [https://hexdocs.pm/open_api_petstore](https://hexdocs.pm/open_api_petstore).
|
||||
be found at [https://hexdocs.pm/openapi_petstore](https://hexdocs.pm/openapi_petstore).
|
||||
|
@ -1,40 +0,0 @@
|
||||
# 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.AnotherFake do
|
||||
@moduledoc """
|
||||
API calls for all endpoints tagged `AnotherFake`.
|
||||
"""
|
||||
|
||||
alias OpenAPIPetstore.Connection
|
||||
import OpenAPIPetstore.RequestBuilder
|
||||
|
||||
|
||||
@doc """
|
||||
To test special tags
|
||||
To test special tags and operation ID starting with number
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- client (Client): client model
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenAPIPetstore.Model.Client{}} on success
|
||||
{:error, info} 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, client, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:patch)
|
||||
|> url("/another-fake/dummy")
|
||||
|> add_param(:body, :body, client)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, %OpenAPIPetstore.Model.Client{}}
|
||||
])
|
||||
end
|
||||
end
|
@ -1,36 +0,0 @@
|
||||
# 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{}} on success
|
||||
{:error, info} 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
|
@ -1,429 +0,0 @@
|
||||
# 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.Fake do
|
||||
@moduledoc """
|
||||
API calls for all endpoints tagged `Fake`.
|
||||
"""
|
||||
|
||||
alias OpenAPIPetstore.Connection
|
||||
import OpenAPIPetstore.RequestBuilder
|
||||
|
||||
|
||||
@doc """
|
||||
Health check endpoint
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenAPIPetstore.Model.HealthCheckResult{}} on success
|
||||
{:error, info} on failure
|
||||
"""
|
||||
@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(:get)
|
||||
|> url("/fake/health")
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, %OpenAPIPetstore.Model.HealthCheckResult{}}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Test serialization of outer boolean types
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
- :body (boolean()): Input boolean as post body
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenAPIPetstore.Model.boolean(){}} on success
|
||||
{:error, info} 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
|
||||
optional_params = %{
|
||||
:"body" => :body
|
||||
}
|
||||
%{}
|
||||
|> method(:post)
|
||||
|> url("/fake/outer/boolean")
|
||||
|> add_optional_params(optional_params, opts)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Test serialization of object with outer number type
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
- :outer_composite (OuterComposite): Input composite as post body
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenAPIPetstore.Model.OuterComposite{}} on success
|
||||
{:error, info} 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
|
||||
optional_params = %{
|
||||
:"OuterComposite" => :body
|
||||
}
|
||||
%{}
|
||||
|> method(:post)
|
||||
|> url("/fake/outer/composite")
|
||||
|> add_optional_params(optional_params, opts)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, %OpenAPIPetstore.Model.OuterComposite{}}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Test serialization of outer number types
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
- :body (float()): Input number as post body
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenAPIPetstore.Model.float(){}} on success
|
||||
{:error, info} 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
|
||||
optional_params = %{
|
||||
:"body" => :body
|
||||
}
|
||||
%{}
|
||||
|> method(:post)
|
||||
|> url("/fake/outer/number")
|
||||
|> add_optional_params(optional_params, opts)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Test serialization of outer string types
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
- :body (String.t): Input string as post body
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenAPIPetstore.Model.String.t{}} on success
|
||||
{:error, info} 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
|
||||
optional_params = %{
|
||||
:"body" => :body
|
||||
}
|
||||
%{}
|
||||
|> method(:post)
|
||||
|> url("/fake/outer/string")
|
||||
|> add_optional_params(optional_params, opts)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- file_schema_test_class (FileSchemaTestClass):
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} 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, file_schema_test_class, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:put)
|
||||
|> url("/fake/body-with-file-schema")
|
||||
|> add_param(:body, :body, file_schema_test_class)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- query (String.t):
|
||||
- user (User):
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} 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, user, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:put)
|
||||
|> url("/fake/body-with-query-params")
|
||||
|> add_param(:query, :"query", query)
|
||||
|> add_param(:body, :body, user)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
To test \"client\" model
|
||||
To test \"client\" model
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- client (Client): client model
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenAPIPetstore.Model.Client{}} on success
|
||||
{:error, info} 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, client, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:patch)
|
||||
|> url("/fake")
|
||||
|> add_param(:body, :body, client)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, %OpenAPIPetstore.Model.Client{}}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- number (float()): None
|
||||
- double (float()): None
|
||||
- pattern_without_delimiter (String.t): None
|
||||
- byte (binary()): None
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
- :integer (integer()): None
|
||||
- :int32 (integer()): None
|
||||
- :int64 (integer()): None
|
||||
- :float (float()): None
|
||||
- :string (String.t): None
|
||||
- :binary (String.t): None
|
||||
- :date (Date.t): None
|
||||
- :date_time (DateTime.t): None
|
||||
- :password (String.t): None
|
||||
- :callback (String.t): None
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} 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
|
||||
optional_params = %{
|
||||
:"integer" => :form,
|
||||
:"int32" => :form,
|
||||
:"int64" => :form,
|
||||
:"float" => :form,
|
||||
:"string" => :form,
|
||||
:"binary" => :form,
|
||||
:"date" => :form,
|
||||
:"dateTime" => :form,
|
||||
:"password" => :form,
|
||||
:"callback" => :form
|
||||
}
|
||||
%{}
|
||||
|> method(:post)
|
||||
|> url("/fake")
|
||||
|> add_param(:form, :"number", number)
|
||||
|> add_param(:form, :"double", double)
|
||||
|> add_param(:form, :"pattern_without_delimiter", pattern_without_delimiter)
|
||||
|> add_param(:form, :"byte", byte)
|
||||
|> add_optional_params(optional_params, opts)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 400, false},
|
||||
{ 404, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
To test enum parameters
|
||||
To test enum parameters
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
- :enum_header_string_array ([String.t]): Header parameter enum test (string array)
|
||||
- :enum_header_string (String.t): Header parameter enum test (string)
|
||||
- :enum_query_string_array ([String.t]): Query parameter enum test (string array)
|
||||
- :enum_query_string (String.t): Query parameter enum test (string)
|
||||
- :enum_query_integer (integer()): Query parameter enum test (double)
|
||||
- :enum_query_double (float()): Query parameter enum test (double)
|
||||
- :enum_form_string_array ([String.t]): Form parameter enum test (string array)
|
||||
- :enum_form_string (String.t): Form parameter enum test (string)
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
"""
|
||||
@spec test_enum_parameters(Tesla.Env.client, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def test_enum_parameters(connection, opts \\ []) do
|
||||
optional_params = %{
|
||||
:"enum_header_string_array" => :headers,
|
||||
:"enum_header_string" => :headers,
|
||||
:"enum_query_string_array" => :query,
|
||||
:"enum_query_string" => :query,
|
||||
:"enum_query_integer" => :query,
|
||||
:"enum_query_double" => :query,
|
||||
:"enum_form_string_array" => :form,
|
||||
:"enum_form_string" => :form
|
||||
}
|
||||
%{}
|
||||
|> method(:get)
|
||||
|> url("/fake")
|
||||
|> add_optional_params(optional_params, opts)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 400, false},
|
||||
{ 404, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Fake endpoint to test group parameters (optional)
|
||||
Fake endpoint to test group parameters (optional)
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- required_string_group (integer()): Required String in group parameters
|
||||
- required_boolean_group (boolean()): Required Boolean in group parameters
|
||||
- required_int64_group (integer()): Required Integer in group parameters
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
- :string_group (integer()): String in group parameters
|
||||
- :boolean_group (boolean()): Boolean in group parameters
|
||||
- :int64_group (integer()): Integer in group parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} 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
|
||||
optional_params = %{
|
||||
:"string_group" => :query,
|
||||
:"boolean_group" => :headers,
|
||||
:"int64_group" => :query
|
||||
}
|
||||
%{}
|
||||
|> method(:delete)
|
||||
|> url("/fake")
|
||||
|> add_param(:query, :"required_string_group", required_string_group)
|
||||
|> add_param(:headers, :"required_boolean_group", required_boolean_group)
|
||||
|> add_param(:query, :"required_int64_group", required_int64_group)
|
||||
|> add_optional_params(optional_params, opts)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 400, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
test inline additionalProperties
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- request_body (%{optional(String.t) => String.t}): request body
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} 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, request_body, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:post)
|
||||
|> url("/fake/inline-additionalProperties")
|
||||
|> add_param(:body, :body, request_body)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
test json serialization of form data
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- param (String.t): field1
|
||||
- param2 (String.t): field2
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} 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
|
||||
%{}
|
||||
|> method(:get)
|
||||
|> url("/fake/jsonFormData")
|
||||
|> add_param(:form, :"param", param)
|
||||
|> add_param(:form, :"param2", param2)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, false}
|
||||
])
|
||||
end
|
||||
end
|
@ -1,40 +0,0 @@
|
||||
# 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.FakeClassnameTags123 do
|
||||
@moduledoc """
|
||||
API calls for all endpoints tagged `FakeClassnameTags123`.
|
||||
"""
|
||||
|
||||
alias OpenAPIPetstore.Connection
|
||||
import OpenAPIPetstore.RequestBuilder
|
||||
|
||||
|
||||
@doc """
|
||||
To test class name in snake case
|
||||
To test class name in snake case
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- client (Client): client model
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenAPIPetstore.Model.Client{}} on success
|
||||
{:error, info} 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, client, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:patch)
|
||||
|> url("/fake_classname_test")
|
||||
|> add_param(:body, :body, client)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, %OpenAPIPetstore.Model.Client{}}
|
||||
])
|
||||
end
|
||||
end
|
@ -1,277 +0,0 @@
|
||||
# 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.Pet do
|
||||
@moduledoc """
|
||||
API calls for all endpoints tagged `Pet`.
|
||||
"""
|
||||
|
||||
alias OpenAPIPetstore.Connection
|
||||
import OpenAPIPetstore.RequestBuilder
|
||||
|
||||
|
||||
@doc """
|
||||
Add a new pet to the store
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- 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
|
||||
"""
|
||||
@spec add_pet(Tesla.Env.client, OpenAPIPetstore.Model.Pet.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def add_pet(connection, pet, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:post)
|
||||
|> url("/pet")
|
||||
|> add_param(:body, :body, pet)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 405, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Deletes a pet
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- pet_id (integer()): Pet id to delete
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
- :api_key (String.t):
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
"""
|
||||
@spec delete_pet(Tesla.Env.client, integer(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def delete_pet(connection, pet_id, opts \\ []) do
|
||||
optional_params = %{
|
||||
:"api_key" => :headers
|
||||
}
|
||||
%{}
|
||||
|> method(:delete)
|
||||
|> url("/pet/#{pet_id}")
|
||||
|> add_optional_params(optional_params, opts)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 400, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Finds Pets by status
|
||||
Multiple status values can be provided with comma separated strings
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- status ([String.t]): Status values that need to be considered for filter
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, [%Pet{}, ...]} on success
|
||||
{:error, info} on failure
|
||||
"""
|
||||
@spec find_pets_by_status(Tesla.Env.client, list(String.t), keyword()) :: {:ok, list(OpenAPIPetstore.Model.Pet.t)} | {:error, Tesla.Env.t}
|
||||
def find_pets_by_status(connection, status, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:get)
|
||||
|> url("/pet/findByStatus")
|
||||
|> add_param(:query, :"status", status)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, [%OpenAPIPetstore.Model.Pet{}]},
|
||||
{ 400, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Finds Pets by tags
|
||||
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- tags ([String.t]): Tags to filter by
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, [%Pet{}, ...]} on success
|
||||
{:error, info} on failure
|
||||
"""
|
||||
@spec find_pets_by_tags(Tesla.Env.client, list(String.t), keyword()) :: {:ok, list(OpenAPIPetstore.Model.Pet.t)} | {:error, Tesla.Env.t}
|
||||
def find_pets_by_tags(connection, tags, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:get)
|
||||
|> url("/pet/findByTags")
|
||||
|> add_param(:query, :"tags", tags)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, [%OpenAPIPetstore.Model.Pet{}]},
|
||||
{ 400, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Find pet by ID
|
||||
Returns a single pet
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- pet_id (integer()): ID of pet to return
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenAPIPetstore.Model.Pet{}} on success
|
||||
{:error, info} on failure
|
||||
"""
|
||||
@spec get_pet_by_id(Tesla.Env.client, integer(), keyword()) :: {:ok, OpenAPIPetstore.Model.Pet.t} | {:error, Tesla.Env.t}
|
||||
def get_pet_by_id(connection, pet_id, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:get)
|
||||
|> url("/pet/#{pet_id}")
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, %OpenAPIPetstore.Model.Pet{}},
|
||||
{ 400, false},
|
||||
{ 404, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Update an existing pet
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- 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
|
||||
"""
|
||||
@spec update_pet(Tesla.Env.client, OpenAPIPetstore.Model.Pet.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def update_pet(connection, pet, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:put)
|
||||
|> url("/pet")
|
||||
|> add_param(:body, :body, pet)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 400, false},
|
||||
{ 404, false},
|
||||
{ 405, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Updates a pet in the store with form data
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- pet_id (integer()): ID of pet that needs to be updated
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
- :name (String.t): Updated name of the pet
|
||||
- :status (String.t): Updated status of the pet
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} 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
|
||||
optional_params = %{
|
||||
:"name" => :form,
|
||||
:"status" => :form
|
||||
}
|
||||
%{}
|
||||
|> method(:post)
|
||||
|> url("/pet/#{pet_id}")
|
||||
|> add_optional_params(optional_params, opts)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 405, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
uploads an image
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- pet_id (integer()): ID of pet to update
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
- :additional_metadata (String.t): Additional data to pass to server
|
||||
- :file (String.t): file to upload
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenAPIPetstore.Model.ApiResponse{}} on success
|
||||
{:error, info} 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
|
||||
optional_params = %{
|
||||
:"additionalMetadata" => :form,
|
||||
:"file" => :form
|
||||
}
|
||||
%{}
|
||||
|> method(:post)
|
||||
|> url("/pet/#{pet_id}/uploadImage")
|
||||
|> add_optional_params(optional_params, opts)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, %OpenAPIPetstore.Model.ApiResponse{}}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
uploads an image (required)
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- pet_id (integer()): ID of pet to update
|
||||
- required_file (String.t): file to upload
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
- :additional_metadata (String.t): Additional data to pass to server
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenAPIPetstore.Model.ApiResponse{}} on success
|
||||
{:error, info} 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
|
||||
optional_params = %{
|
||||
:"additionalMetadata" => :form
|
||||
}
|
||||
%{}
|
||||
|> method(:post)
|
||||
|> url("/fake/#{pet_id}/uploadImageWithRequiredFile")
|
||||
|> add_param(:file, :"requiredFile", required_file)
|
||||
|> add_optional_params(optional_params, opts)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, %OpenAPIPetstore.Model.ApiResponse{}}
|
||||
])
|
||||
end
|
||||
end
|
@ -1,120 +0,0 @@
|
||||
# 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.Store do
|
||||
@moduledoc """
|
||||
API calls for all endpoints tagged `Store`.
|
||||
"""
|
||||
|
||||
alias OpenAPIPetstore.Connection
|
||||
import OpenAPIPetstore.RequestBuilder
|
||||
|
||||
|
||||
@doc """
|
||||
Delete purchase order by ID
|
||||
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- order_id (String.t): ID of the order that needs to be deleted
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} 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
|
||||
%{}
|
||||
|> method(:delete)
|
||||
|> url("/store/order/#{order_id}")
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 400, false},
|
||||
{ 404, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Returns pet inventories by status
|
||||
Returns a map of status codes to quantities
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
"""
|
||||
@spec get_inventory(Tesla.Env.client, keyword()) :: {:ok, map()} | {:error, Tesla.Env.t}
|
||||
def get_inventory(connection, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:get)
|
||||
|> url("/store/inventory")
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, %{}}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Find purchase order by ID
|
||||
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- order_id (integer()): ID of pet that needs to be fetched
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenAPIPetstore.Model.Order{}} on success
|
||||
{:error, info} on failure
|
||||
"""
|
||||
@spec get_order_by_id(Tesla.Env.client, integer(), keyword()) :: {:ok, OpenAPIPetstore.Model.Order.t} | {:error, Tesla.Env.t}
|
||||
def get_order_by_id(connection, order_id, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:get)
|
||||
|> url("/store/order/#{order_id}")
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, %OpenAPIPetstore.Model.Order{}},
|
||||
{ 400, false},
|
||||
{ 404, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Place an order for a pet
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- order (Order): order placed for purchasing the pet
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenAPIPetstore.Model.Order{}} on success
|
||||
{:error, info} on failure
|
||||
"""
|
||||
@spec place_order(Tesla.Env.client, OpenAPIPetstore.Model.Order.t, keyword()) :: {:ok, OpenAPIPetstore.Model.Order.t} | {:error, Tesla.Env.t}
|
||||
def place_order(connection, order, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:post)
|
||||
|> url("/store/order")
|
||||
|> add_param(:body, :body, order)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, %OpenAPIPetstore.Model.Order{}},
|
||||
{ 400, false}
|
||||
])
|
||||
end
|
||||
end
|
@ -1,228 +0,0 @@
|
||||
# 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.User do
|
||||
@moduledoc """
|
||||
API calls for all endpoints tagged `User`.
|
||||
"""
|
||||
|
||||
alias OpenAPIPetstore.Connection
|
||||
import OpenAPIPetstore.RequestBuilder
|
||||
|
||||
|
||||
@doc """
|
||||
Create user
|
||||
This can only be done by the logged in user.
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- user (User): Created user object
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
"""
|
||||
@spec create_user(Tesla.Env.client, OpenAPIPetstore.Model.User.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def create_user(connection, user, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:post)
|
||||
|> url("/user")
|
||||
|> add_param(:body, :body, user)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ :default, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Creates list of users with given input array
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- user ([User]): List of user object
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} 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, user, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:post)
|
||||
|> url("/user/createWithArray")
|
||||
|> add_param(:body, :body, user)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ :default, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Creates list of users with given input array
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- user ([User]): List of user object
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} 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, user, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:post)
|
||||
|> url("/user/createWithList")
|
||||
|> add_param(:body, :body, user)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ :default, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Delete user
|
||||
This can only be done by the logged in user.
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- username (String.t): The name that needs to be deleted
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
"""
|
||||
@spec delete_user(Tesla.Env.client, String.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def delete_user(connection, username, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:delete)
|
||||
|> url("/user/#{username}")
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 400, false},
|
||||
{ 404, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Get user by user name
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- username (String.t): The name that needs to be fetched. Use user1 for testing.
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenAPIPetstore.Model.User{}} on success
|
||||
{:error, info} on failure
|
||||
"""
|
||||
@spec get_user_by_name(Tesla.Env.client, String.t, keyword()) :: {:ok, OpenAPIPetstore.Model.User.t} | {:error, Tesla.Env.t}
|
||||
def get_user_by_name(connection, username, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:get)
|
||||
|> url("/user/#{username}")
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, %OpenAPIPetstore.Model.User{}},
|
||||
{ 400, false},
|
||||
{ 404, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Logs user into the system
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- username (String.t): The user name for login
|
||||
- password (String.t): The password for login in clear text
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %OpenAPIPetstore.Model.String.t{}} on success
|
||||
{:error, info} on failure
|
||||
"""
|
||||
@spec login_user(Tesla.Env.client, String.t, String.t, keyword()) :: {:ok, String.t} | {:error, Tesla.Env.t}
|
||||
def login_user(connection, username, password, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:get)
|
||||
|> url("/user/login")
|
||||
|> add_param(:query, :"username", username)
|
||||
|> add_param(:query, :"password", password)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, false},
|
||||
{ 400, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Logs out current logged in user session
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} on failure
|
||||
"""
|
||||
@spec logout_user(Tesla.Env.client, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
|
||||
def logout_user(connection, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:get)
|
||||
|> url("/user/logout")
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ :default, false}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Updated user
|
||||
This can only be done by the logged in user.
|
||||
|
||||
## Parameters
|
||||
|
||||
- connection (OpenAPIPetstore.Connection): Connection to server
|
||||
- username (String.t): name that need to be deleted
|
||||
- user (User): Updated user object
|
||||
- opts (KeywordList): [optional] Optional parameters
|
||||
## Returns
|
||||
|
||||
{:ok, %{}} on success
|
||||
{:error, info} 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, user, _opts \\ []) do
|
||||
%{}
|
||||
|> method(:put)
|
||||
|> url("/user/#{username}")
|
||||
|> add_param(:body, :body, user)
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 400, false},
|
||||
{ 404, false}
|
||||
])
|
||||
end
|
||||
end
|
@ -1,104 +0,0 @@
|
||||
# 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.Connection do
|
||||
@moduledoc """
|
||||
Handle Tesla connections for OpenAPIPetstore.
|
||||
"""
|
||||
|
||||
use Tesla
|
||||
|
||||
# Add any middleware here (authentication)
|
||||
plug Tesla.Middleware.BaseUrl, "http://petstore.swagger.io:80/v2"
|
||||
plug Tesla.Middleware.Headers, [{"user-agent", "Elixir"}]
|
||||
plug Tesla.Middleware.EncodeJson, engine: Poison
|
||||
|
||||
@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.build_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.build_client([
|
||||
{Tesla.Middleware.BasicAuth, %{username: username, password: password}}
|
||||
])
|
||||
end
|
||||
@scopes [
|
||||
"write:pets", # modify pets in your account
|
||||
"read:pets" # read your pets
|
||||
]
|
||||
|
||||
@doc """
|
||||
Configure a client connection using a provided OAuth2 token as a Bearer token
|
||||
|
||||
## Parameters
|
||||
|
||||
- token (String): Bearer token
|
||||
|
||||
## Returns
|
||||
|
||||
Tesla.Env.client
|
||||
"""
|
||||
@spec new(String.t) :: Tesla.Env.client
|
||||
def new(token) when is_binary(token) do
|
||||
Tesla.build_client([
|
||||
{Tesla.Middleware.Headers, [{"authorization", "Bearer #{token}"}]}
|
||||
])
|
||||
end
|
||||
|
||||
@doc """
|
||||
Configure a client connection using a function which yields a Bearer token.
|
||||
|
||||
## Parameters
|
||||
|
||||
- token_fetcher (function arity of 1): Callback which provides an OAuth2 token
|
||||
given a list of scopes
|
||||
|
||||
## Returns
|
||||
|
||||
Tesla.Env.client
|
||||
"""
|
||||
@spec new(((list(String.t)) -> String.t)) :: Tesla.Env.client
|
||||
def new(token_fetcher) when is_function(token_fetcher) do
|
||||
token_fetcher.(@scopes)
|
||||
|> new
|
||||
end
|
||||
@doc """
|
||||
Configure an authless client connection
|
||||
|
||||
# Returns
|
||||
|
||||
Tesla.Env.client
|
||||
"""
|
||||
@spec new() :: Tesla.Env.client
|
||||
def new do
|
||||
Tesla.build_client([])
|
||||
end
|
||||
end
|
@ -1,38 +0,0 @@
|
||||
# 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.Deserializer do
|
||||
@moduledoc """
|
||||
Helper functions for deserializing responses into models
|
||||
"""
|
||||
|
||||
@doc """
|
||||
Update the provided model with a deserialization of a nested value
|
||||
"""
|
||||
@spec deserialize(struct(), :atom, :atom, struct(), keyword()) :: struct()
|
||||
def deserialize(model, field, :list, mod, options) do
|
||||
model
|
||||
|> Map.update!(field, &(Poison.Decode.decode(&1, Keyword.merge(options, [as: [struct(mod)]]))))
|
||||
end
|
||||
def deserialize(model, field, :struct, mod, options) do
|
||||
model
|
||||
|> Map.update!(field, &(Poison.Decode.decode(&1, Keyword.merge(options, [as: struct(mod)]))))
|
||||
end
|
||||
def deserialize(model, field, :map, mod, options) do
|
||||
model
|
||||
|> Map.update!(field, &(Map.new(&1, fn {key, val} -> {key, Poison.Decode.decode(val, Keyword.merge(options, [as: struct(mod)]))} end)))
|
||||
end
|
||||
def deserialize(model, field, :date, _, _options) do
|
||||
value = Map.get(model, field)
|
||||
case is_binary(value) do
|
||||
true -> case DateTime.from_iso8601(value) do
|
||||
{:ok, datetime, _offset} ->
|
||||
Map.put(model, field, datetime)
|
||||
_ ->
|
||||
model
|
||||
end
|
||||
false -> model
|
||||
end
|
||||
end
|
||||
end
|
@ -1,25 +0,0 @@
|
||||
# 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
|
||||
|
@ -1,27 +0,0 @@
|
||||
# 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.AdditionalPropertiesClass do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"map_property",
|
||||
:"map_of_map_property"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"map_property" => %{optional(String.t) => String.t} | nil,
|
||||
:"map_of_map_property" => %{optional(String.t) => %{optional(String.t) => String.t}} | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.AdditionalPropertiesClass do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,27 +0,0 @@
|
||||
# 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.Animal do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"className",
|
||||
:"color"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"className" => String.t,
|
||||
:"color" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Animal do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,29 +0,0 @@
|
||||
# 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.ApiResponse do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"code",
|
||||
:"type",
|
||||
:"message"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"code" => integer() | nil,
|
||||
:"type" => String.t | nil,
|
||||
:"message" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.ApiResponse do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,25 +0,0 @@
|
||||
# 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.ArrayOfArrayOfNumberOnly do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"ArrayArrayNumber"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"ArrayArrayNumber" => [[float()]] | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.ArrayOfArrayOfNumberOnly do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,29 +0,0 @@
|
||||
# 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.ArrayTest do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"array_of_string",
|
||||
:"array_array_of_integer",
|
||||
:"array_array_of_model"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"array_of_string" => [String.t] | nil,
|
||||
:"array_array_of_integer" => [[integer()]] | nil,
|
||||
:"array_array_of_model" => [[ReadOnlyFirst]] | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.ArrayTest do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,35 +0,0 @@
|
||||
# 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.Capitalization do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"smallCamel",
|
||||
:"CapitalCamel",
|
||||
:"small_Snake",
|
||||
:"Capital_Snake",
|
||||
:"SCA_ETH_Flow_Points",
|
||||
:"ATT_NAME"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"smallCamel" => String.t | nil,
|
||||
:"CapitalCamel" => String.t | nil,
|
||||
:"small_Snake" => String.t | nil,
|
||||
:"Capital_Snake" => String.t | nil,
|
||||
:"SCA_ETH_Flow_Points" => String.t | nil,
|
||||
:"ATT_NAME" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Capitalization do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,29 +0,0 @@
|
||||
# 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.Cat do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"className",
|
||||
:"color",
|
||||
:"declawed"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"className" => String.t,
|
||||
:"color" => String.t | nil,
|
||||
:"declawed" => boolean() | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Cat do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,25 +0,0 @@
|
||||
# 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.ClassModel do
|
||||
@moduledoc """
|
||||
Model for testing model with \"_class\" property
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"_class"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"_class" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.ClassModel do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,25 +0,0 @@
|
||||
# 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.Client do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"client"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"client" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Client do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,29 +0,0 @@
|
||||
# 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.Dog do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"className",
|
||||
:"color",
|
||||
:"breed"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"className" => String.t,
|
||||
:"color" => String.t | nil,
|
||||
:"breed" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Dog do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,27 +0,0 @@
|
||||
# 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.EnumArrays do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"just_symbol",
|
||||
:"array_enum"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"just_symbol" => String.t | nil,
|
||||
:"array_enum" => [String.t] | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.EnumArrays do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,44 +0,0 @@
|
||||
# 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.EnumTest do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"enum_string",
|
||||
:"enum_string_required",
|
||||
:"enum_integer",
|
||||
:"enum_number",
|
||||
:"outerEnum",
|
||||
:"outerEnumInteger",
|
||||
:"outerEnumDefaultValue",
|
||||
:"outerEnumIntegerDefaultValue"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"enum_string" => String.t | nil,
|
||||
:"enum_string_required" => String.t,
|
||||
:"enum_integer" => integer() | nil,
|
||||
:"enum_number" => float() | nil,
|
||||
:"outerEnum" => OuterEnum | nil,
|
||||
:"outerEnumInteger" => OuterEnumInteger | nil,
|
||||
:"outerEnumDefaultValue" => OuterEnumDefaultValue | nil,
|
||||
:"outerEnumIntegerDefaultValue" => OuterEnumIntegerDefaultValue | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.EnumTest do
|
||||
import OpenAPIPetstore.Deserializer
|
||||
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
|
||||
|
@ -1,30 +0,0 @@
|
||||
# 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.FileSchemaTestClass do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"file",
|
||||
:"files"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"file" => File | nil,
|
||||
:"files" => [File] | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.FileSchemaTestClass do
|
||||
import OpenAPIPetstore.Deserializer
|
||||
def decode(value, options) do
|
||||
value
|
||||
|> deserialize(:"file", :struct, OpenAPIPetstore.Model.File, options)
|
||||
|> deserialize(:"files", :list, OpenAPIPetstore.Model.File, options)
|
||||
end
|
||||
end
|
||||
|
@ -1,25 +0,0 @@
|
||||
# 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
|
||||
|
@ -1,55 +0,0 @@
|
||||
# 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.FormatTest do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"integer",
|
||||
:"int32",
|
||||
:"int64",
|
||||
:"number",
|
||||
:"float",
|
||||
:"double",
|
||||
:"string",
|
||||
:"byte",
|
||||
:"binary",
|
||||
:"date",
|
||||
:"dateTime",
|
||||
:"uuid",
|
||||
:"password",
|
||||
:"pattern_with_digits",
|
||||
:"pattern_with_digits_and_delimiter"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"integer" => integer() | nil,
|
||||
:"int32" => integer() | nil,
|
||||
:"int64" => integer() | nil,
|
||||
:"number" => float(),
|
||||
:"float" => float() | nil,
|
||||
:"double" => float() | nil,
|
||||
:"string" => String.t | nil,
|
||||
:"byte" => binary(),
|
||||
:"binary" => String.t | nil,
|
||||
:"date" => Date.t,
|
||||
:"dateTime" => DateTime.t | nil,
|
||||
:"uuid" => String.t | nil,
|
||||
:"password" => String.t,
|
||||
:"pattern_with_digits" => String.t | nil,
|
||||
:"pattern_with_digits_and_delimiter" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.FormatTest do
|
||||
import OpenAPIPetstore.Deserializer
|
||||
def decode(value, options) do
|
||||
value
|
||||
|> deserialize(:"date", :date, nil, options)
|
||||
end
|
||||
end
|
||||
|
@ -1,27 +0,0 @@
|
||||
# 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.HasOnlyReadOnly do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"bar",
|
||||
:"foo"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"bar" => String.t | nil,
|
||||
:"foo" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.HasOnlyReadOnly do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,25 +0,0 @@
|
||||
# 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
|
||||
|
@ -1,27 +0,0 @@
|
||||
# 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.InlineObject do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"name",
|
||||
:"status"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"name" => String.t | nil,
|
||||
:"status" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.InlineObject do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,27 +0,0 @@
|
||||
# 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.InlineObject1 do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"additionalMetadata",
|
||||
:"file"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"additionalMetadata" => String.t | nil,
|
||||
:"file" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.InlineObject1 do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,27 +0,0 @@
|
||||
# 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.InlineObject2 do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"enum_form_string_array",
|
||||
:"enum_form_string"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"enum_form_string_array" => [String.t] | nil,
|
||||
:"enum_form_string" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.InlineObject2 do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,53 +0,0 @@
|
||||
# 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.InlineObject3 do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"integer",
|
||||
:"int32",
|
||||
:"int64",
|
||||
:"number",
|
||||
:"float",
|
||||
:"double",
|
||||
:"string",
|
||||
:"pattern_without_delimiter",
|
||||
:"byte",
|
||||
:"binary",
|
||||
:"date",
|
||||
:"dateTime",
|
||||
:"password",
|
||||
:"callback"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"integer" => integer() | nil,
|
||||
:"int32" => integer() | nil,
|
||||
:"int64" => integer() | nil,
|
||||
:"number" => float(),
|
||||
:"float" => float() | nil,
|
||||
:"double" => float(),
|
||||
:"string" => String.t | nil,
|
||||
:"pattern_without_delimiter" => String.t,
|
||||
:"byte" => binary(),
|
||||
:"binary" => String.t | nil,
|
||||
:"date" => Date.t | nil,
|
||||
:"dateTime" => DateTime.t | nil,
|
||||
:"password" => String.t | nil,
|
||||
:"callback" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.InlineObject3 do
|
||||
import OpenAPIPetstore.Deserializer
|
||||
def decode(value, options) do
|
||||
value
|
||||
|> deserialize(:"date", :date, nil, options)
|
||||
end
|
||||
end
|
||||
|
@ -1,27 +0,0 @@
|
||||
# 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.InlineObject4 do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"param",
|
||||
:"param2"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"param" => String.t,
|
||||
:"param2" => String.t
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.InlineObject4 do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,27 +0,0 @@
|
||||
# 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.InlineObject5 do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"additionalMetadata",
|
||||
:"requiredFile"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"additionalMetadata" => String.t | nil,
|
||||
:"requiredFile" => String.t
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.InlineObject5 do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,27 +0,0 @@
|
||||
# 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" => Foo | 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
|
||||
|
@ -1,31 +0,0 @@
|
||||
# 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.MapTest do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"map_map_of_string",
|
||||
:"map_of_enum_string",
|
||||
:"direct_map",
|
||||
:"indirect_map"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"map_map_of_string" => %{optional(String.t) => %{optional(String.t) => String.t}} | nil,
|
||||
:"map_of_enum_string" => %{optional(String.t) => String.t} | nil,
|
||||
:"direct_map" => %{optional(String.t) => boolean()} | nil,
|
||||
:"indirect_map" => %{optional(String.t) => boolean()} | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.MapTest do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,31 +0,0 @@
|
||||
# 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.MixedPropertiesAndAdditionalPropertiesClass do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"uuid",
|
||||
:"dateTime",
|
||||
:"map"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"uuid" => String.t | nil,
|
||||
:"dateTime" => DateTime.t | nil,
|
||||
:"map" => %{optional(String.t) => Animal} | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.MixedPropertiesAndAdditionalPropertiesClass do
|
||||
import OpenAPIPetstore.Deserializer
|
||||
def decode(value, options) do
|
||||
value
|
||||
|> deserialize(:"map", :map, OpenAPIPetstore.Model.Animal, options)
|
||||
end
|
||||
end
|
||||
|
@ -1,27 +0,0 @@
|
||||
# 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.Model200Response do
|
||||
@moduledoc """
|
||||
Model for testing model name starting with number
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"name",
|
||||
:"class"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"name" => integer() | nil,
|
||||
:"class" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Model200Response do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,31 +0,0 @@
|
||||
# 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.Name do
|
||||
@moduledoc """
|
||||
Model for testing model name same as property name
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"name",
|
||||
:"snake_case",
|
||||
:"property",
|
||||
:"123Number"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"name" => integer(),
|
||||
:"snake_case" => integer() | nil,
|
||||
:"property" => String.t | nil,
|
||||
:"123Number" => integer() | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Name do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,25 +0,0 @@
|
||||
# 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.NumberOnly do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"JustNumber"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"JustNumber" => float() | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.NumberOnly do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,35 +0,0 @@
|
||||
# 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.Order do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"id",
|
||||
:"petId",
|
||||
:"quantity",
|
||||
:"shipDate",
|
||||
:"status",
|
||||
:"complete"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"id" => integer() | nil,
|
||||
:"petId" => integer() | nil,
|
||||
:"quantity" => integer() | nil,
|
||||
:"shipDate" => DateTime.t | nil,
|
||||
:"status" => String.t | nil,
|
||||
:"complete" => boolean() | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Order do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,29 +0,0 @@
|
||||
# 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.OuterComposite do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"my_number",
|
||||
:"my_string",
|
||||
:"my_boolean"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"my_number" => float() | nil,
|
||||
:"my_string" => String.t | nil,
|
||||
:"my_boolean" => boolean() | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.OuterComposite do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,25 +0,0 @@
|
||||
# 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.OuterEnum do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.OuterEnum do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,25 +0,0 @@
|
||||
# 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
|
||||
|
@ -1,25 +0,0 @@
|
||||
# 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
|
||||
|
@ -1,25 +0,0 @@
|
||||
# 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
|
||||
|
@ -1,38 +0,0 @@
|
||||
# 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.Pet do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"id",
|
||||
:"category",
|
||||
:"name",
|
||||
:"photoUrls",
|
||||
:"tags",
|
||||
:"status"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"id" => integer() | nil,
|
||||
:"category" => Category | nil,
|
||||
:"name" => String.t,
|
||||
:"photoUrls" => [String.t],
|
||||
:"tags" => [Tag] | nil,
|
||||
:"status" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Pet do
|
||||
import OpenAPIPetstore.Deserializer
|
||||
def decode(value, options) do
|
||||
value
|
||||
|> deserialize(:"category", :struct, OpenAPIPetstore.Model.Category, options)
|
||||
|> deserialize(:"tags", :list, OpenAPIPetstore.Model.Tag, options)
|
||||
end
|
||||
end
|
||||
|
@ -1,27 +0,0 @@
|
||||
# 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.ReadOnlyFirst do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"bar",
|
||||
:"baz"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"bar" => String.t | nil,
|
||||
:"baz" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.ReadOnlyFirst do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,25 +0,0 @@
|
||||
# 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.Return do
|
||||
@moduledoc """
|
||||
Model for testing reserved words
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"return"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"return" => integer() | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Return do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,39 +0,0 @@
|
||||
# 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.User do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"id",
|
||||
:"username",
|
||||
:"firstName",
|
||||
:"lastName",
|
||||
:"email",
|
||||
:"password",
|
||||
:"phone",
|
||||
:"userStatus"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"id" => integer() | nil,
|
||||
:"username" => String.t | nil,
|
||||
:"firstName" => String.t | nil,
|
||||
:"lastName" => String.t | nil,
|
||||
:"email" => String.t | nil,
|
||||
:"password" => String.t | nil,
|
||||
:"phone" => String.t | nil,
|
||||
:"userStatus" => integer() | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.User do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,143 +0,0 @@
|
||||
# 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.RequestBuilder do
|
||||
@moduledoc """
|
||||
Helper functions for building Tesla requests
|
||||
"""
|
||||
|
||||
@doc """
|
||||
Specify the request method when building a request
|
||||
|
||||
## Parameters
|
||||
|
||||
- request (Map) - Collected request options
|
||||
- m (atom) - Request method
|
||||
|
||||
## Returns
|
||||
|
||||
Map
|
||||
"""
|
||||
@spec method(map(), atom) :: map()
|
||||
def method(request, m) do
|
||||
Map.put_new(request, :method, m)
|
||||
end
|
||||
|
||||
@doc """
|
||||
Specify the request method when building a request
|
||||
|
||||
## Parameters
|
||||
|
||||
- request (Map) - Collected request options
|
||||
- u (String) - Request URL
|
||||
|
||||
## Returns
|
||||
|
||||
Map
|
||||
"""
|
||||
@spec url(map(), String.t) :: map()
|
||||
def url(request, u) do
|
||||
Map.put_new(request, :url, u)
|
||||
end
|
||||
|
||||
@doc """
|
||||
Add optional parameters to the request
|
||||
|
||||
## Parameters
|
||||
|
||||
- request (Map) - Collected request options
|
||||
- definitions (Map) - Map of parameter name to parameter location.
|
||||
- options (KeywordList) - The provided optional parameters
|
||||
|
||||
## Returns
|
||||
|
||||
Map
|
||||
"""
|
||||
@spec add_optional_params(map(), %{optional(atom) => atom}, keyword()) :: map()
|
||||
def add_optional_params(request, _, []), do: request
|
||||
def add_optional_params(request, definitions, [{key, value} | tail]) do
|
||||
case definitions do
|
||||
%{^key => location} ->
|
||||
request
|
||||
|> add_param(location, key, value)
|
||||
|> add_optional_params(definitions, tail)
|
||||
_ ->
|
||||
add_optional_params(request, definitions, tail)
|
||||
end
|
||||
end
|
||||
|
||||
@doc """
|
||||
Add optional parameters to the request
|
||||
|
||||
## Parameters
|
||||
|
||||
- request (Map) - Collected request options
|
||||
- location (atom) - Where to put the parameter
|
||||
- key (atom) - The name of the parameter
|
||||
- value (any) - The value of the parameter
|
||||
|
||||
## Returns
|
||||
|
||||
Map
|
||||
"""
|
||||
@spec add_param(map(), atom, atom, any()) :: map()
|
||||
def add_param(request, :body, :body, value), do: Map.put(request, :body, value)
|
||||
def add_param(request, :body, key, value) do
|
||||
request
|
||||
|> Map.put_new_lazy(:body, &Tesla.Multipart.new/0)
|
||||
|> Map.update!(:body, &(Tesla.Multipart.add_field(&1, key, Poison.encode!(value), headers: [{:"Content-Type", "application/json"}])))
|
||||
end
|
||||
def add_param(request, :headers, key, value) do
|
||||
request
|
||||
|> Tesla.put_header(key, value)
|
||||
end
|
||||
def add_param(request, :file, name, path) do
|
||||
request
|
||||
|> Map.put_new_lazy(:body, &Tesla.Multipart.new/0)
|
||||
|> Map.update!(:body, &(Tesla.Multipart.add_file(&1, path, name: name)))
|
||||
end
|
||||
def add_param(request, :form, name, value) do
|
||||
request
|
||||
|> Map.update(:body, %{name => value}, &(Map.put(&1, name, value)))
|
||||
end
|
||||
def add_param(request, location, key, value) do
|
||||
Map.update(request, location, [{key, value}], &(&1 ++ [{key, value}]))
|
||||
end
|
||||
|
||||
@doc """
|
||||
Handle the response for a Tesla request
|
||||
|
||||
## Parameters
|
||||
|
||||
- arg1 (Tesla.Env.t | term) - The response object
|
||||
- arg2 (:false | struct | [struct]) - The shape of the struct to deserialize into
|
||||
|
||||
## Returns
|
||||
|
||||
{:ok, struct} on success
|
||||
{:error, term} on failure
|
||||
"""
|
||||
@spec decode(Tesla.Env.t() | term(), false | struct() | [struct()]) ::
|
||||
{:ok, struct()} | {:ok, Tesla.Env.t()} | {:error, any}
|
||||
def decode(%Tesla.Env{} = env, false), do: {:ok, env}
|
||||
def decode(%Tesla.Env{body: body}, struct), do: Poison.decode(body, as: struct)
|
||||
|
||||
def evaluate_response({:ok, %Tesla.Env{} = env}, mapping) do
|
||||
resolve_mapping(env, mapping)
|
||||
end
|
||||
|
||||
def evaluate_response({:error, _} = error, _), do: error
|
||||
|
||||
def resolve_mapping(env, mapping, default \\ nil)
|
||||
|
||||
def resolve_mapping(%Tesla.Env{status: status} = env, [{mapping_status, struct} | _], _)
|
||||
when status == mapping_status do
|
||||
decode(env, struct)
|
||||
end
|
||||
|
||||
def resolve_mapping(env, [{:default, struct} | tail], _), do: resolve_mapping(env, tail, struct)
|
||||
def resolve_mapping(env, [_ | tail], struct), do: resolve_mapping(env, tail, struct)
|
||||
def resolve_mapping(env, [], nil), do: {:error, env}
|
||||
def resolve_mapping(env, [], struct), do: decode(env, struct)
|
||||
end
|
@ -33,6 +33,7 @@ defmodule OpenapiPetstore.Api.Pet do
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, false},
|
||||
{ 405, false}
|
||||
])
|
||||
end
|
||||
@ -63,6 +64,7 @@ defmodule OpenapiPetstore.Api.Pet do
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, false},
|
||||
{ 400, false}
|
||||
])
|
||||
end
|
||||
@ -173,6 +175,7 @@ defmodule OpenapiPetstore.Api.Pet do
|
||||
|> Enum.into([])
|
||||
|> (&Connection.request(connection, &1)).()
|
||||
|> evaluate_response([
|
||||
{ 200, false},
|
||||
{ 400, false},
|
||||
{ 404, false},
|
||||
{ 405, false}
|
||||
|
@ -28,7 +28,7 @@ defmodule OpenapiPetstore.Connection do
|
||||
"""
|
||||
@spec new(String.t, String.t) :: Tesla.Env.client
|
||||
def new(username, password) do
|
||||
Tesla.build_client([
|
||||
Tesla.client([
|
||||
{Tesla.Middleware.BasicAuth, %{username: username, password: password}}
|
||||
])
|
||||
end
|
||||
@ -50,7 +50,7 @@ defmodule OpenapiPetstore.Connection do
|
||||
"""
|
||||
@spec new(String.t) :: Tesla.Env.client
|
||||
def new(token) when is_binary(token) do
|
||||
Tesla.build_client([
|
||||
Tesla.client([
|
||||
{Tesla.Middleware.Headers, [{"authorization", "Bearer #{token}"}]}
|
||||
])
|
||||
end
|
||||
@ -81,6 +81,6 @@ defmodule OpenapiPetstore.Connection do
|
||||
"""
|
||||
@spec new() :: Tesla.Env.client
|
||||
def new do
|
||||
Tesla.build_client([])
|
||||
Tesla.client([])
|
||||
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.AdditionalPropertiesAnyType do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"name"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"name" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenapiPetstore.Model.AdditionalPropertiesAnyType do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -2,24 +2,22 @@
|
||||
# https://openapi-generator.tech
|
||||
# Do not edit the class manually.
|
||||
|
||||
defmodule OpenAPIPetstore.Model.Tag do
|
||||
defmodule OpenapiPetstore.Model.AdditionalPropertiesArray do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"id",
|
||||
:"name"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"id" => integer() | nil,
|
||||
:"name" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Tag do
|
||||
defimpl Poison.Decoder, for: OpenapiPetstore.Model.AdditionalPropertiesArray do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
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.AdditionalPropertiesBoolean do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"name"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"name" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenapiPetstore.Model.AdditionalPropertiesBoolean do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -9,19 +9,41 @@ defmodule OpenapiPetstore.Model.AdditionalPropertiesClass do
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"map_property",
|
||||
:"map_of_map_property"
|
||||
:"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"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"map_property" => %{optional(String.t) => String.t} | nil,
|
||||
:"map_of_map_property" => %{optional(String.t) => %{optional(String.t) => String.t}} | nil
|
||||
:"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
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenapiPetstore.Model.AdditionalPropertiesClass do
|
||||
def decode(value, _options) do
|
||||
import OpenapiPetstore.Deserializer
|
||||
def decode(value, options) do
|
||||
value
|
||||
|> deserialize(:"anytype_1", :struct, OpenapiPetstore.Model.Map, options)
|
||||
|> deserialize(:"anytype_2", :struct, OpenapiPetstore.Model.Map, options)
|
||||
|> deserialize(:"anytype_3", :struct, OpenapiPetstore.Model.Map, 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.AdditionalPropertiesInteger do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"name"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"name" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenapiPetstore.Model.AdditionalPropertiesInteger do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -2,24 +2,22 @@
|
||||
# https://openapi-generator.tech
|
||||
# Do not edit the class manually.
|
||||
|
||||
defmodule OpenAPIPetstore.Model.Category do
|
||||
defmodule OpenapiPetstore.Model.AdditionalPropertiesNumber do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"id",
|
||||
:"name"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"id" => integer() | nil,
|
||||
:"name" => String.t
|
||||
:"name" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.Category do
|
||||
defimpl Poison.Decoder, for: OpenapiPetstore.Model.AdditionalPropertiesNumber do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
@ -2,22 +2,22 @@
|
||||
# https://openapi-generator.tech
|
||||
# Do not edit the class manually.
|
||||
|
||||
defmodule OpenAPIPetstore.Model.ArrayOfNumberOnly do
|
||||
defmodule OpenapiPetstore.Model.AdditionalPropertiesObject do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
:"ArrayNumber"
|
||||
:"name"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
:"ArrayNumber" => [float()] | nil
|
||||
:"name" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.ArrayOfNumberOnly do
|
||||
defimpl Poison.Decoder, for: OpenapiPetstore.Model.AdditionalPropertiesObject do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
@ -2,22 +2,22 @@
|
||||
# https://openapi-generator.tech
|
||||
# Do not edit the class manually.
|
||||
|
||||
defmodule OpenAPIPetstore.Model.EnumClass do
|
||||
defmodule OpenapiPetstore.Model.AdditionalPropertiesString do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
|
||||
:"name"
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
|
||||
:"name" => String.t | nil
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenAPIPetstore.Model.EnumClass do
|
||||
defimpl Poison.Decoder, for: OpenapiPetstore.Model.AdditionalPropertiesString do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
@ -1,25 +0,0 @@
|
||||
# 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.AnimalFarm do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenapiPetstore.Model.AnimalFarm do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,25 +0,0 @@
|
||||
# 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.StringBooleanMap do
|
||||
@moduledoc """
|
||||
|
||||
"""
|
||||
|
||||
@derive [Poison.Encoder]
|
||||
defstruct [
|
||||
|
||||
]
|
||||
|
||||
@type t :: %__MODULE__{
|
||||
|
||||
}
|
||||
end
|
||||
|
||||
defimpl Poison.Decoder, for: OpenapiPetstore.Model.StringBooleanMap do
|
||||
def decode(value, _options) do
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -1,10 +1,10 @@
|
||||
defmodule OpenAPIPetstore.Mixfile do
|
||||
defmodule OpenapiPetstore.Mixfile do
|
||||
use Mix.Project
|
||||
|
||||
def project do
|
||||
[app: :open_api_petstore,
|
||||
version: "0.1.0",
|
||||
elixir: "~> 1.4",
|
||||
[app: :openapi_petstore,
|
||||
version: "1.0.0",
|
||||
elixir: "~> 1.6",
|
||||
build_embedded: Mix.env == :prod,
|
||||
start_permanent: Mix.env == :prod,
|
||||
deps: deps()]
|
||||
@ -24,13 +24,13 @@ defmodule OpenAPIPetstore.Mixfile do
|
||||
#
|
||||
# Or git/path repositories:
|
||||
#
|
||||
# {:my_dep, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"}
|
||||
# {:my_dep, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.3.0"}
|
||||
#
|
||||
# Type "mix help deps" for more examples and options
|
||||
defp deps do
|
||||
[
|
||||
{:tesla, "~> 1.0.0"},
|
||||
{:poison, "~> 3.0.0"}
|
||||
{:tesla, "~> 1.2"},
|
||||
{:poison, "~> 3.0"}
|
||||
]
|
||||
end
|
||||
end
|
||||
|
@ -55,6 +55,19 @@
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>mix</executable>
|
||||
<arguments>
|
||||
<argument>test</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
60
samples/client/petstore/elixir/test/pet_test.exs
Normal file
60
samples/client/petstore/elixir/test/pet_test.exs
Normal file
@ -0,0 +1,60 @@
|
||||
defmodule PetTest do
|
||||
use ExUnit.Case
|
||||
alias OpenapiPetstore.Connection
|
||||
alias OpenapiPetstore.Api.Pet, as: PetApi
|
||||
alias OpenapiPetstore.Model.Pet
|
||||
alias OpenapiPetstore.Model.Category
|
||||
alias OpenapiPetstore.Model.Tag
|
||||
|
||||
test "add and delete a pet" do
|
||||
petId = 10007
|
||||
pet = %Pet{
|
||||
:id => petId,
|
||||
:name => "elixir client test",
|
||||
:photoUrls => ["http://test_elixir_unit_test.com"],
|
||||
:category => %Category{:id => petId, :name=> "test elixir category"},
|
||||
:tags => [%Tag{:id => petId, :name => "test elixir tag"}],
|
||||
}
|
||||
{:ok, response} = PetApi.add_pet(Connection.new, pet)
|
||||
assert response.status == 200
|
||||
|
||||
{:ok, pet} = PetApi.get_pet_by_id(Connection.new, petId)
|
||||
assert pet.id == petId
|
||||
assert pet.name == "elixir client test"
|
||||
assert List.first(pet.photoUrls) == "http://test_elixir_unit_test.com"
|
||||
assert pet.category.id == petId
|
||||
assert pet.category.name == "test elixir category"
|
||||
assert List.first(pet.tags) == %Tag{:id => petId, :name => "test elixir tag"}
|
||||
|
||||
{:ok, response} = PetApi.delete_pet(Connection.new, petId)
|
||||
assert response.status == 200
|
||||
{:ok, response} = PetApi.get_pet_by_id(Connection.new, petId)
|
||||
assert response.status == 404
|
||||
end
|
||||
|
||||
test "update a pet" do
|
||||
petId = 10007
|
||||
pet = %Pet{
|
||||
:id => petId,
|
||||
:name => "elixir client updatePet",
|
||||
:status => "pending",
|
||||
:photoUrls => ["http://test_elixir_unit_test.com"]
|
||||
}
|
||||
{:ok, response} = PetApi.update_pet(Connection.new, pet)
|
||||
assert response.status == 200
|
||||
|
||||
{:ok, pet} = PetApi.get_pet_by_id(Connection.new, petId)
|
||||
assert pet.id == petId
|
||||
assert pet.name == "elixir client updatePet"
|
||||
assert pet.status == "pending"
|
||||
end
|
||||
|
||||
test "find pet by status" do
|
||||
{:ok, listPets} = PetApi.find_pets_by_status(Connection.new, "available")
|
||||
assert List.first(listPets) != nil
|
||||
|
||||
{:ok, listPets} = PetApi.find_pets_by_status(Connection.new, "unknown_and_incorrect_status")
|
||||
assert List.first(listPets) == nil
|
||||
end
|
||||
|
||||
end
|
@ -32,6 +32,9 @@ paths:
|
||||
description: Pet object that needs to be added to the store
|
||||
required: true
|
||||
responses:
|
||||
200:
|
||||
content: {}
|
||||
description: successful operation
|
||||
405:
|
||||
content: {}
|
||||
description: Invalid input
|
||||
@ -56,6 +59,9 @@ paths:
|
||||
description: Pet object that needs to be added to the store
|
||||
required: true
|
||||
responses:
|
||||
200:
|
||||
content: {}
|
||||
description: successful operation
|
||||
400:
|
||||
content: {}
|
||||
description: Invalid ID supplied
|
||||
@ -174,6 +180,9 @@ paths:
|
||||
format: int64
|
||||
type: integer
|
||||
responses:
|
||||
200:
|
||||
content: {}
|
||||
description: successful operation
|
||||
400:
|
||||
content: {}
|
||||
description: Invalid pet value
|
||||
|
@ -32,6 +32,9 @@ paths:
|
||||
description: Pet object that needs to be added to the store
|
||||
required: true
|
||||
responses:
|
||||
200:
|
||||
content: {}
|
||||
description: successful operation
|
||||
405:
|
||||
content: {}
|
||||
description: Invalid input
|
||||
@ -56,6 +59,9 @@ paths:
|
||||
description: Pet object that needs to be added to the store
|
||||
required: true
|
||||
responses:
|
||||
200:
|
||||
content: {}
|
||||
description: successful operation
|
||||
400:
|
||||
content: {}
|
||||
description: Invalid ID supplied
|
||||
@ -174,6 +180,9 @@ paths:
|
||||
format: int64
|
||||
type: integer
|
||||
responses:
|
||||
200:
|
||||
content: {}
|
||||
description: successful operation
|
||||
400:
|
||||
content: {}
|
||||
description: Invalid pet value
|
||||
|
@ -44,6 +44,7 @@ public class PetApi {
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>405</b> - Invalid input
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @throws IOException if an error occurs while attempting to invoke the API
|
||||
@ -54,6 +55,7 @@ public class PetApi {
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>405</b> - Invalid input
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
|
||||
@ -128,6 +130,7 @@ public class PetApi {
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid pet value
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey The apiKey parameter
|
||||
@ -139,6 +142,7 @@ public class PetApi {
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid pet value
|
||||
* @param petId Pet id to delete
|
||||
* @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.
|
||||
@ -471,6 +475,7 @@ public class PetApi {
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid ID supplied
|
||||
* <p><b>404</b> - Pet not found
|
||||
* <p><b>405</b> - Validation exception
|
||||
@ -483,6 +488,7 @@ public class PetApi {
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid ID supplied
|
||||
* <p><b>404</b> - Pet not found
|
||||
* <p><b>405</b> - Validation exception
|
||||
|
@ -57,6 +57,7 @@ public class PetApi {
|
||||
nickname = "addPet",
|
||||
tags = { "pet" })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation") ,
|
||||
@ApiResponse(code = 405, message = "Invalid input") })
|
||||
public AddPetOper addPet() {
|
||||
return new AddPetOper(reqSpec);
|
||||
@ -67,6 +68,7 @@ public class PetApi {
|
||||
nickname = "deletePet",
|
||||
tags = { "pet" })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation") ,
|
||||
@ApiResponse(code = 400, message = "Invalid pet value") })
|
||||
public DeletePetOper deletePet() {
|
||||
return new DeletePetOper(reqSpec);
|
||||
@ -112,6 +114,7 @@ public class PetApi {
|
||||
nickname = "updatePet",
|
||||
tags = { "pet" })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation") ,
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied") ,
|
||||
@ApiResponse(code = 404, message = "Pet not found") ,
|
||||
@ApiResponse(code = 405, message = "Validation exception") })
|
||||
|
@ -51,6 +51,7 @@ public class PetApi {
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>405</b> - Invalid input
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @throws RestClientException if an error occurs while attempting to invoke the API
|
||||
@ -84,6 +85,7 @@ public class PetApi {
|
||||
/**
|
||||
* Deletes a pet
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid pet value
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey The apiKey parameter
|
||||
@ -235,6 +237,7 @@ public class PetApi {
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid ID supplied
|
||||
* <p><b>404</b> - Pet not found
|
||||
* <p><b>405</b> - Validation exception
|
||||
|
@ -51,6 +51,7 @@ public class PetApi {
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>405</b> - Invalid input
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @throws RestClientException if an error occurs while attempting to invoke the API
|
||||
@ -84,6 +85,7 @@ public class PetApi {
|
||||
/**
|
||||
* Deletes a pet
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid pet value
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey The apiKey parameter
|
||||
@ -235,6 +237,7 @@ public class PetApi {
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid ID supplied
|
||||
* <p><b>404</b> - Pet not found
|
||||
* <p><b>405</b> - Validation exception
|
||||
|
@ -50,6 +50,7 @@ public class PetApi {
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>405</b> - Invalid input
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @throws RestClientException if an error occurs while attempting to invoke the API
|
||||
@ -83,6 +84,7 @@ public class PetApi {
|
||||
/**
|
||||
* Deletes a pet
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid pet value
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey The apiKey parameter
|
||||
@ -234,6 +236,7 @@ public class PetApi {
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid ID supplied
|
||||
* <p><b>404</b> - Pet not found
|
||||
* <p><b>405</b> - Validation exception
|
||||
|
@ -43,6 +43,8 @@ public class PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||
public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) Pet body
|
||||
)
|
||||
@ -60,6 +62,8 @@ public class PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
||||
public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId
|
||||
,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey
|
||||
@ -134,6 +138,8 @@ public class PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
||||
|
@ -43,6 +43,7 @@ public interface PetApi {
|
||||
@Consumes({ "application/json", "application/xml" })
|
||||
@ApiOperation(value = "Add a new pet to the store", tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 405, message = "Invalid input") })
|
||||
public void addPet(@Valid Pet body);
|
||||
|
||||
@ -54,6 +55,7 @@ public interface PetApi {
|
||||
@Path("/pet/{petId}")
|
||||
@ApiOperation(value = "Deletes a pet", tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 400, message = "Invalid pet value") })
|
||||
public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey);
|
||||
|
||||
@ -112,6 +114,7 @@ public interface PetApi {
|
||||
@Consumes({ "application/json", "application/xml" })
|
||||
@ApiOperation(value = "Update an existing pet", tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied"),
|
||||
@ApiResponse(code = 404, message = "Pet not found"),
|
||||
@ApiResponse(code = 405, message = "Validation exception") })
|
||||
|
@ -40,6 +40,7 @@ public interface PetApi {
|
||||
@Consumes({ "application/json", "application/xml" })
|
||||
@ApiOperation(value = "Add a new pet to the store", tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 405, message = "Invalid input") })
|
||||
public void addPet(@Valid Pet body);
|
||||
|
||||
@ -51,6 +52,7 @@ public interface PetApi {
|
||||
@Path("/pet/{petId}")
|
||||
@ApiOperation(value = "Deletes a pet", tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 400, message = "Invalid pet value") })
|
||||
public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey);
|
||||
|
||||
@ -109,6 +111,7 @@ public interface PetApi {
|
||||
@Consumes({ "application/json", "application/xml" })
|
||||
@ApiOperation(value = "Update an existing pet", tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied"),
|
||||
@ApiResponse(code = 404, message = "Pet not found"),
|
||||
@ApiResponse(code = 405, message = "Validation exception") })
|
||||
|
@ -68,6 +68,8 @@ public class PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||
public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) @NotNull @Valid Pet body
|
||||
,@Context SecurityContext securityContext)
|
||||
@ -85,6 +87,8 @@ public class PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
||||
public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId
|
||||
,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey
|
||||
@ -159,6 +163,8 @@ public class PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
||||
|
@ -28,6 +28,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
@ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||
void addPet(@Valid Pet body);
|
||||
|
||||
@ -40,6 +41,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
@ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
||||
void deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey);
|
||||
|
||||
@ -92,6 +94,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
||||
@ApiResponse(code = 405, message = "Validation exception", response = Void.class) })
|
||||
|
@ -32,6 +32,9 @@ paths:
|
||||
description: Pet object that needs to be added to the store
|
||||
required: true
|
||||
responses:
|
||||
200:
|
||||
content: {}
|
||||
description: successful operation
|
||||
405:
|
||||
content: {}
|
||||
description: Invalid input
|
||||
@ -58,6 +61,9 @@ paths:
|
||||
description: Pet object that needs to be added to the store
|
||||
required: true
|
||||
responses:
|
||||
200:
|
||||
content: {}
|
||||
description: successful operation
|
||||
400:
|
||||
content: {}
|
||||
description: Invalid ID supplied
|
||||
@ -182,6 +188,9 @@ paths:
|
||||
format: int64
|
||||
type: integer
|
||||
responses:
|
||||
200:
|
||||
content: {}
|
||||
description: successful operation
|
||||
400:
|
||||
content: {}
|
||||
description: Invalid pet value
|
||||
|
@ -28,6 +28,7 @@ public class PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
@ApiResponse(code = 405, message = "Invalid input", response = Void.class)
|
||||
})
|
||||
public Response addPet(@Valid Pet body) {
|
||||
@ -43,6 +44,7 @@ public class PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
@ApiResponse(code = 400, message = "Invalid pet value", response = Void.class)
|
||||
})
|
||||
public Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey) {
|
||||
@ -107,6 +109,7 @@ public class PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||
@ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
||||
@ApiResponse(code = 405, message = "Validation exception", response = Void.class)
|
||||
|
@ -32,6 +32,9 @@ paths:
|
||||
description: Pet object that needs to be added to the store
|
||||
required: true
|
||||
responses:
|
||||
200:
|
||||
content: {}
|
||||
description: successful operation
|
||||
405:
|
||||
content: {}
|
||||
description: Invalid input
|
||||
@ -58,6 +61,9 @@ paths:
|
||||
description: Pet object that needs to be added to the store
|
||||
required: true
|
||||
responses:
|
||||
200:
|
||||
content: {}
|
||||
description: successful operation
|
||||
400:
|
||||
content: {}
|
||||
description: Invalid ID supplied
|
||||
@ -182,6 +188,9 @@ paths:
|
||||
format: int64
|
||||
type: integer
|
||||
responses:
|
||||
200:
|
||||
content: {}
|
||||
description: successful operation
|
||||
400:
|
||||
content: {}
|
||||
description: Invalid pet value
|
||||
|
@ -46,6 +46,7 @@ public class PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
@io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||
public Response addPet(
|
||||
@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) @NotNull @Valid Pet body,
|
||||
@ -64,6 +65,7 @@ public class PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
||||
public Response deletePet(
|
||||
@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId,
|
||||
@ -138,6 +140,7 @@ public class PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
||||
@io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) })
|
||||
|
@ -46,6 +46,7 @@ public class PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
@io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||
public Response addPet(
|
||||
@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) @NotNull @Valid Pet body,
|
||||
@ -64,6 +65,7 @@ public class PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
||||
public Response deletePet(
|
||||
@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId,
|
||||
@ -138,6 +140,7 @@ public class PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
||||
@io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) })
|
||||
|
@ -68,6 +68,8 @@ public class PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||
public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) @NotNull @Valid Pet body
|
||||
,@Context SecurityContext securityContext)
|
||||
@ -85,6 +87,8 @@ public class PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
||||
public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId
|
||||
,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey
|
||||
@ -159,6 +163,8 @@ public class PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
||||
|
@ -68,6 +68,8 @@ public class PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) })
|
||||
public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true) @NotNull @Valid Pet body
|
||||
,@Context SecurityContext securityContext)
|
||||
@ -85,6 +87,8 @@ public class PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) })
|
||||
public Response deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId
|
||||
,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey
|
||||
@ -159,6 +163,8 @@ public class PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class),
|
||||
|
@ -45,6 +45,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 405, message = "Invalid input") })
|
||||
@RequestMapping(value = "/pet",
|
||||
consumes = { "application/json", "application/xml" },
|
||||
@ -62,6 +63,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 400, message = "Invalid pet value") })
|
||||
@RequestMapping(value = "/pet/{petId}",
|
||||
method = RequestMethod.DELETE)
|
||||
@ -172,6 +174,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied"),
|
||||
@ApiResponse(code = 404, message = "Pet not found"),
|
||||
@ApiResponse(code = 405, message = "Validation exception") })
|
||||
|
@ -44,6 +44,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 405, message = "Invalid input") })
|
||||
@RequestMapping(value = "/pet",
|
||||
consumes = { "application/json", "application/xml" },
|
||||
@ -61,6 +62,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 400, message = "Invalid pet value") })
|
||||
@RequestMapping(value = "/pet/{petId}",
|
||||
method = RequestMethod.DELETE)
|
||||
@ -165,6 +167,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied"),
|
||||
@ApiResponse(code = 404, message = "Pet not found"),
|
||||
@ApiResponse(code = 405, message = "Validation exception") })
|
||||
|
@ -36,6 +36,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 405, message = "Invalid input") })
|
||||
@RequestMapping(value = "/pet",
|
||||
consumes = { "application/json", "application/xml" },
|
||||
@ -50,6 +51,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 400, message = "Invalid pet value") })
|
||||
@RequestMapping(value = "/pet/{petId}",
|
||||
method = RequestMethod.DELETE)
|
||||
@ -106,6 +108,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied"),
|
||||
@ApiResponse(code = 404, message = "Pet not found"),
|
||||
@ApiResponse(code = 405, message = "Validation exception") })
|
||||
|
@ -36,6 +36,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 405, message = "Invalid input") })
|
||||
@RequestMapping(value = "/pet",
|
||||
consumes = { "application/json", "application/xml" },
|
||||
@ -50,6 +51,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 400, message = "Invalid pet value") })
|
||||
@RequestMapping(value = "/pet/{petId}",
|
||||
method = RequestMethod.DELETE)
|
||||
@ -106,6 +108,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied"),
|
||||
@ApiResponse(code = 404, message = "Pet not found"),
|
||||
@ApiResponse(code = 405, message = "Validation exception") })
|
||||
|
@ -40,6 +40,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 405, message = "Invalid input") })
|
||||
@RequestMapping(value = "/pet",
|
||||
consumes = { "application/json", "application/xml" },
|
||||
@ -56,6 +57,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 400, message = "Invalid pet value") })
|
||||
@RequestMapping(value = "/pet/{petId}",
|
||||
method = RequestMethod.DELETE)
|
||||
@ -120,6 +122,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied"),
|
||||
@ApiResponse(code = 404, message = "Pet not found"),
|
||||
@ApiResponse(code = 405, message = "Validation exception") })
|
||||
|
@ -36,6 +36,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 405, message = "Invalid input") })
|
||||
@RequestMapping(value = "/pet",
|
||||
consumes = { "application/json", "application/xml" },
|
||||
@ -50,6 +51,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 400, message = "Invalid pet value") })
|
||||
@RequestMapping(value = "/pet/{petId}",
|
||||
method = RequestMethod.DELETE)
|
||||
@ -106,6 +108,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied"),
|
||||
@ApiResponse(code = 404, message = "Pet not found"),
|
||||
@ApiResponse(code = 405, message = "Validation exception") })
|
||||
|
@ -44,6 +44,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 405, message = "Invalid input") })
|
||||
@ApiImplicitParams({
|
||||
})
|
||||
@ -63,6 +64,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 400, message = "Invalid pet value") })
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "apiKey", value = "", dataType = "String", paramType = "header")
|
||||
@ -176,6 +178,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied"),
|
||||
@ApiResponse(code = 404, message = "Pet not found"),
|
||||
@ApiResponse(code = 405, message = "Validation exception") })
|
||||
|
@ -43,6 +43,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 405, message = "Invalid input") })
|
||||
@RequestMapping(value = "/pet",
|
||||
consumes = { "application/json", "application/xml" },
|
||||
@ -59,6 +60,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 400, message = "Invalid pet value") })
|
||||
@RequestMapping(value = "/pet/{petId}",
|
||||
method = RequestMethod.DELETE)
|
||||
@ -123,6 +125,7 @@ public interface PetApi {
|
||||
})
|
||||
}, tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation"),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied"),
|
||||
@ApiResponse(code = 404, message = "Pet not found"),
|
||||
@ApiResponse(code = 405, message = "Validation exception") })
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user