Skip to content

Commit

Permalink
Merge pull request #152 from aws-beam/update-generated-code-with-types
Browse files Browse the repository at this point in the history
Update generated code to include auto-generated types and specs for everything
  • Loading branch information
onno-vos-dev authored Mar 28, 2024
2 parents 1efd71d + 211e91c commit ba79051
Show file tree
Hide file tree
Showing 378 changed files with 669,352 additions and 224 deletions.
1,677 changes: 1,676 additions & 1 deletion src/aws_accessanalyzer.erl

Large diffs are not rendered by default.

339 changes: 338 additions & 1 deletion src/aws_account.erl

Large diffs are not rendered by default.

612 changes: 612 additions & 0 deletions src/aws_acm.erl

Large diffs are not rendered by default.

961 changes: 961 additions & 0 deletions src/aws_acm_pca.erl

Large diffs are not rendered by default.

3,107 changes: 3,107 additions & 0 deletions src/aws_alexa_for_business.erl

Large diffs are not rendered by default.

1,035 changes: 1,034 additions & 1 deletion src/aws_amp.erl

Large diffs are not rendered by default.

1,473 changes: 1,472 additions & 1 deletion src/aws_amplify.erl

Large diffs are not rendered by default.

1,378 changes: 1,377 additions & 1 deletion src/aws_amplifybackend.erl

Large diffs are not rendered by default.

1,516 changes: 1,515 additions & 1 deletion src/aws_amplifyuibuilder.erl

Large diffs are not rendered by default.

3,662 changes: 3,661 additions & 1 deletion src/aws_api_gateway.erl

Large diffs are not rendered by default.

100 changes: 99 additions & 1 deletion src/aws_apigatewaymanagementapi.erl
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,90 @@

-include_lib("hackney/include/hackney_lib.hrl").


%% Example:
%% delete_connection_request() :: #{}
-type delete_connection_request() :: #{}.

%% Example:
%% forbidden_exception() :: #{}
-type forbidden_exception() :: #{}.

%% Example:
%% get_connection_request() :: #{}
-type get_connection_request() :: #{}.


%% Example:
%% get_connection_response() :: #{
%% <<"ConnectedAt">> => non_neg_integer(),
%% <<"Identity">> => identity(),
%% <<"LastActiveAt">> => non_neg_integer()
%% }
-type get_connection_response() :: #{binary() => any()}.

%% Example:
%% gone_exception() :: #{}
-type gone_exception() :: #{}.


%% Example:
%% identity() :: #{
%% <<"SourceIp">> := string(),
%% <<"UserAgent">> := string()
%% }
-type identity() :: #{binary() => any()}.

%% Example:
%% limit_exceeded_exception() :: #{}
-type limit_exceeded_exception() :: #{}.


%% Example:
%% payload_too_large_exception() :: #{
%% <<"Message">> => string()
%% }
-type payload_too_large_exception() :: #{binary() => any()}.


%% Example:
%% post_to_connection_request() :: #{
%% <<"Data">> := binary()
%% }
-type post_to_connection_request() :: #{binary() => any()}.

-type delete_connection_errors() ::
limit_exceeded_exception() |
gone_exception() |
forbidden_exception().

-type get_connection_errors() ::
limit_exceeded_exception() |
gone_exception() |
forbidden_exception().

-type post_to_connection_errors() ::
payload_too_large_exception() |
limit_exceeded_exception() |
gone_exception() |
forbidden_exception().

%%====================================================================
%% API
%%====================================================================

%% @doc Delete the connection with the provided id.
-spec delete_connection(aws_client:aws_client(), binary() | list(), delete_connection_request()) ->
{ok, undefined, tuple()} |
{error, any()} |
{error, delete_connection_errors(), tuple()}.
delete_connection(Client, ConnectionId, Input) ->
delete_connection(Client, ConnectionId, Input, []).

-spec delete_connection(aws_client:aws_client(), binary() | list(), delete_connection_request(), proplists:proplist()) ->
{ok, undefined, tuple()} |
{error, any()} |
{error, delete_connection_errors(), tuple()}.
delete_connection(Client, ConnectionId, Input0, Options0) ->
Method = delete,
Path = ["/@connections/", aws_util:encode_uri(ConnectionId), ""],
Expand All @@ -51,14 +128,26 @@ delete_connection(Client, ConnectionId, Input0, Options0) ->
request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode).

%% @doc Get information about the connection with the provided id.
-spec get_connection(aws_client:aws_client(), binary() | list()) ->
{ok, get_connection_response(), tuple()} |
{error, any()} |
{error, get_connection_errors(), tuple()}.
get_connection(Client, ConnectionId)
when is_map(Client) ->
get_connection(Client, ConnectionId, #{}, #{}).

-spec get_connection(aws_client:aws_client(), binary() | list(), map(), map()) ->
{ok, get_connection_response(), tuple()} |
{error, any()} |
{error, get_connection_errors(), tuple()}.
get_connection(Client, ConnectionId, QueryMap, HeadersMap)
when is_map(Client), is_map(QueryMap), is_map(HeadersMap) ->
get_connection(Client, ConnectionId, QueryMap, HeadersMap, []).

-spec get_connection(aws_client:aws_client(), binary() | list(), map(), map(), proplists:proplist()) ->
{ok, get_connection_response(), tuple()} |
{error, any()} |
{error, get_connection_errors(), tuple()}.
get_connection(Client, ConnectionId, QueryMap, HeadersMap, Options0)
when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) ->
Path = ["/@connections/", aws_util:encode_uri(ConnectionId), ""],
Expand All @@ -76,8 +165,17 @@ get_connection(Client, ConnectionId, QueryMap, HeadersMap, Options0)
request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode).

%% @doc Sends the provided data to the specified connection.
-spec post_to_connection(aws_client:aws_client(), binary() | list(), post_to_connection_request()) ->
{ok, undefined, tuple()} |
{error, any()} |
{error, post_to_connection_errors(), tuple()}.
post_to_connection(Client, ConnectionId, Input) ->
post_to_connection(Client, ConnectionId, Input, []).

-spec post_to_connection(aws_client:aws_client(), binary() | list(), post_to_connection_request(), proplists:proplist()) ->
{ok, undefined, tuple()} |
{error, any()} |
{error, post_to_connection_errors(), tuple()}.
post_to_connection(Client, ConnectionId, Input0, Options0) ->
Method = post,
Path = ["/@connections/", aws_util:encode_uri(ConnectionId), ""],
Expand All @@ -104,7 +202,7 @@ post_to_connection(Client, ConnectionId, Input0, Options0) ->
%% Internal functions
%%====================================================================

-spec proplists_take(any(), proplists:proplists(), any()) -> {any(), proplists:proplists()}.
-spec proplists_take(any(), proplists:proplist(), any()) -> {any(), proplists:proplist()}.
proplists_take(Key, Proplist, Default) ->
Value = proplists:get_value(Key, Proplist, Default),
{Value, proplists:delete(Key, Proplist)}.
Expand Down
Loading

0 comments on commit ba79051

Please sign in to comment.