forked from loafle/openapi-generator-original
update erlang samples
This commit is contained in:
parent
fc91fca737
commit
38d9dc1f36
@ -1 +1 @@
|
|||||||
5.3.0-SNAPSHOT
|
6.5.0-SNAPSHOT
|
@ -12,7 +12,6 @@
|
|||||||
-define(BASE_URL, <<"/v2">>).
|
-define(BASE_URL, <<"/v2">>).
|
||||||
|
|
||||||
%% @doc Add a new pet to the store
|
%% @doc Add a new pet to the store
|
||||||
%%
|
|
||||||
-spec add_pet(ctx:ctx(), petstore_pet:petstore_pet()) -> {ok, petstore_pet:petstore_pet(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}.
|
-spec add_pet(ctx:ctx(), petstore_pet:petstore_pet()) -> {ok, petstore_pet:petstore_pet(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}.
|
||||||
add_pet(Ctx, PetstorePet) ->
|
add_pet(Ctx, PetstorePet) ->
|
||||||
add_pet(Ctx, PetstorePet, #{}).
|
add_pet(Ctx, PetstorePet, #{}).
|
||||||
@ -33,7 +32,6 @@ add_pet(Ctx, PetstorePet, Optional) ->
|
|||||||
petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
||||||
|
|
||||||
%% @doc Deletes a pet
|
%% @doc Deletes a pet
|
||||||
%%
|
|
||||||
-spec delete_pet(ctx:ctx(), integer()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}.
|
-spec delete_pet(ctx:ctx(), integer()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}.
|
||||||
delete_pet(Ctx, PetId) ->
|
delete_pet(Ctx, PetId) ->
|
||||||
delete_pet(Ctx, PetId, #{}).
|
delete_pet(Ctx, PetId, #{}).
|
||||||
@ -117,7 +115,6 @@ get_pet_by_id(Ctx, PetId, Optional) ->
|
|||||||
petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
||||||
|
|
||||||
%% @doc Update an existing pet
|
%% @doc Update an existing pet
|
||||||
%%
|
|
||||||
-spec update_pet(ctx:ctx(), petstore_pet:petstore_pet()) -> {ok, petstore_pet:petstore_pet(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}.
|
-spec update_pet(ctx:ctx(), petstore_pet:petstore_pet()) -> {ok, petstore_pet:petstore_pet(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}.
|
||||||
update_pet(Ctx, PetstorePet) ->
|
update_pet(Ctx, PetstorePet) ->
|
||||||
update_pet(Ctx, PetstorePet, #{}).
|
update_pet(Ctx, PetstorePet, #{}).
|
||||||
@ -138,7 +135,6 @@ update_pet(Ctx, PetstorePet, Optional) ->
|
|||||||
petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
||||||
|
|
||||||
%% @doc Updates a pet in the store with form data
|
%% @doc Updates a pet in the store with form data
|
||||||
%%
|
|
||||||
-spec update_pet_with_form(ctx:ctx(), integer()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}.
|
-spec update_pet_with_form(ctx:ctx(), integer()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}.
|
||||||
update_pet_with_form(Ctx, PetId) ->
|
update_pet_with_form(Ctx, PetId) ->
|
||||||
update_pet_with_form(Ctx, PetId, #{}).
|
update_pet_with_form(Ctx, PetId, #{}).
|
||||||
@ -159,7 +155,6 @@ update_pet_with_form(Ctx, PetId, Optional) ->
|
|||||||
petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
||||||
|
|
||||||
%% @doc uploads an image
|
%% @doc uploads an image
|
||||||
%%
|
|
||||||
-spec upload_file(ctx:ctx(), integer()) -> {ok, petstore_api_response:petstore_api_response(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}.
|
-spec upload_file(ctx:ctx(), integer()) -> {ok, petstore_api_response:petstore_api_response(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}.
|
||||||
upload_file(Ctx, PetId) ->
|
upload_file(Ctx, PetId) ->
|
||||||
upload_file(Ctx, PetId, #{}).
|
upload_file(Ctx, PetId, #{}).
|
||||||
|
@ -71,7 +71,6 @@ get_order_by_id(Ctx, OrderId, Optional) ->
|
|||||||
petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
||||||
|
|
||||||
%% @doc Place an order for a pet
|
%% @doc Place an order for a pet
|
||||||
%%
|
|
||||||
-spec place_order(ctx:ctx(), petstore_order:petstore_order()) -> {ok, petstore_order:petstore_order(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}.
|
-spec place_order(ctx:ctx(), petstore_order:petstore_order()) -> {ok, petstore_order:petstore_order(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}.
|
||||||
place_order(Ctx, PetstoreOrder) ->
|
place_order(Ctx, PetstoreOrder) ->
|
||||||
place_order(Ctx, PetstoreOrder, #{}).
|
place_order(Ctx, PetstoreOrder, #{}).
|
||||||
|
@ -33,7 +33,6 @@ create_user(Ctx, PetstoreUser, Optional) ->
|
|||||||
petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
||||||
|
|
||||||
%% @doc Creates list of users with given input array
|
%% @doc Creates list of users with given input array
|
||||||
%%
|
|
||||||
-spec create_users_with_array_input(ctx:ctx(), list()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}.
|
-spec create_users_with_array_input(ctx:ctx(), list()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}.
|
||||||
create_users_with_array_input(Ctx, PetstoreUserArray) ->
|
create_users_with_array_input(Ctx, PetstoreUserArray) ->
|
||||||
create_users_with_array_input(Ctx, PetstoreUserArray, #{}).
|
create_users_with_array_input(Ctx, PetstoreUserArray, #{}).
|
||||||
@ -54,7 +53,6 @@ create_users_with_array_input(Ctx, PetstoreUserArray, Optional) ->
|
|||||||
petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
||||||
|
|
||||||
%% @doc Creates list of users with given input array
|
%% @doc Creates list of users with given input array
|
||||||
%%
|
|
||||||
-spec create_users_with_list_input(ctx:ctx(), list()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}.
|
-spec create_users_with_list_input(ctx:ctx(), list()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}.
|
||||||
create_users_with_list_input(Ctx, PetstoreUserArray) ->
|
create_users_with_list_input(Ctx, PetstoreUserArray) ->
|
||||||
create_users_with_list_input(Ctx, PetstoreUserArray, #{}).
|
create_users_with_list_input(Ctx, PetstoreUserArray, #{}).
|
||||||
@ -96,7 +94,6 @@ delete_user(Ctx, Username, Optional) ->
|
|||||||
petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
||||||
|
|
||||||
%% @doc Get user by user name
|
%% @doc Get user by user name
|
||||||
%%
|
|
||||||
-spec get_user_by_name(ctx:ctx(), binary()) -> {ok, petstore_user:petstore_user(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}.
|
-spec get_user_by_name(ctx:ctx(), binary()) -> {ok, petstore_user:petstore_user(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}.
|
||||||
get_user_by_name(Ctx, Username) ->
|
get_user_by_name(Ctx, Username) ->
|
||||||
get_user_by_name(Ctx, Username, #{}).
|
get_user_by_name(Ctx, Username, #{}).
|
||||||
@ -117,7 +114,6 @@ get_user_by_name(Ctx, Username, Optional) ->
|
|||||||
petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
||||||
|
|
||||||
%% @doc Logs user into the system
|
%% @doc Logs user into the system
|
||||||
%%
|
|
||||||
-spec login_user(ctx:ctx(), binary(), binary()) -> {ok, binary(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}.
|
-spec login_user(ctx:ctx(), binary(), binary()) -> {ok, binary(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}.
|
||||||
login_user(Ctx, Username, Password) ->
|
login_user(Ctx, Username, Password) ->
|
||||||
login_user(Ctx, Username, Password, #{}).
|
login_user(Ctx, Username, Password, #{}).
|
||||||
@ -138,7 +134,6 @@ login_user(Ctx, Username, Password, Optional) ->
|
|||||||
petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
petstore_utils:request(Ctx, Method, Path, QS, ContentTypeHeader++Headers, Body1, Opts, Cfg).
|
||||||
|
|
||||||
%% @doc Logs out current logged in user session
|
%% @doc Logs out current logged in user session
|
||||||
%%
|
|
||||||
-spec logout_user(ctx:ctx()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}.
|
-spec logout_user(ctx:ctx()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}.
|
||||||
logout_user(Ctx) ->
|
logout_user(Ctx) ->
|
||||||
logout_user(Ctx, #{}).
|
logout_user(Ctx, #{}).
|
||||||
|
@ -81,12 +81,12 @@ auth_with_prefix(Cfg, Key, Token) ->
|
|||||||
|
|
||||||
update_params_with_auth(Cfg, Headers, QS) ->
|
update_params_with_auth(Cfg, Headers, QS) ->
|
||||||
AuthSettings = maps:get(auth, Cfg, #{}),
|
AuthSettings = maps:get(auth, Cfg, #{}),
|
||||||
Auths = #{ 'api_key' =>
|
Auths = #{ 'petstore_auth' =>
|
||||||
#{type => 'apiKey',
|
|
||||||
key => <<"api_key">>,
|
|
||||||
in => header}, 'petstore_auth' =>
|
|
||||||
#{type => 'oauth2',
|
#{type => 'oauth2',
|
||||||
key => <<"Authorization">>,
|
key => <<"Authorization">>,
|
||||||
|
in => header}, 'api_key' =>
|
||||||
|
#{type => 'apiKey',
|
||||||
|
key => <<"api_key">>,
|
||||||
in => header}},
|
in => header}},
|
||||||
|
|
||||||
maps:fold(fun(AuthName, #{type := _Type,
|
maps:fold(fun(AuthName, #{type := _Type,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user