Merge pull request #10224 from ariel-anieli/pr-replace-boolean-types
[deps/rabbitmq_aws] Modified type annotations, and fixed typos
This commit is contained in:
commit
c183c13987
|
|
@ -42,7 +42,7 @@
|
||||||
-spec get(Service :: string(),
|
-spec get(Service :: string(),
|
||||||
Path :: path()) -> result().
|
Path :: path()) -> result().
|
||||||
%% @doc Perform a HTTP GET request to the AWS API for the specified service. The
|
%% @doc Perform a HTTP GET request to the AWS API for the specified service. The
|
||||||
%% response will automatically be decoded if it is either in JSON or XML
|
%% response will automatically be decoded if it is either in JSON, or XML
|
||||||
%% format.
|
%% format.
|
||||||
%% @end
|
%% @end
|
||||||
get(Service, Path) ->
|
get(Service, Path) ->
|
||||||
|
|
@ -243,7 +243,7 @@ handle_msg(_Request, State) ->
|
||||||
-spec endpoint(State :: state(), Host :: string(),
|
-spec endpoint(State :: state(), Host :: string(),
|
||||||
Service :: string(), Path :: string()) -> string().
|
Service :: string(), Path :: string()) -> string().
|
||||||
%% @doc Return the endpoint URL, either by constructing it with the service
|
%% @doc Return the endpoint URL, either by constructing it with the service
|
||||||
%% information passed in or by using the passed in Host value.
|
%% information passed in, or by using the passed in Host value.
|
||||||
%% @ednd
|
%% @ednd
|
||||||
endpoint(#state{region = Region}, undefined, Service, Path) ->
|
endpoint(#state{region = Region}, undefined, Service, Path) ->
|
||||||
lists:flatten(["https://", endpoint_host(Region, Service), Path]);
|
lists:flatten(["https://", endpoint_host(Region, Service), Path]);
|
||||||
|
|
@ -294,11 +294,11 @@ get_content_type(Headers) ->
|
||||||
end,
|
end,
|
||||||
parse_content_type(Value).
|
parse_content_type(Value).
|
||||||
|
|
||||||
-spec has_credentials() -> true | false.
|
-spec has_credentials() -> boolean().
|
||||||
has_credentials() ->
|
has_credentials() ->
|
||||||
gen_server:call(rabbitmq_aws, has_credentials).
|
gen_server:call(rabbitmq_aws, has_credentials).
|
||||||
|
|
||||||
-spec has_credentials(state()) -> true | false.
|
-spec has_credentials(state()) -> boolean().
|
||||||
%% @doc check to see if there are credentials made available in the current state
|
%% @doc check to see if there are credentials made available in the current state
|
||||||
%% returning false if not or if they have expired.
|
%% returning false if not or if they have expired.
|
||||||
%% @end
|
%% @end
|
||||||
|
|
@ -307,7 +307,7 @@ has_credentials(#state{access_key = Key}) when Key /= undefined -> true;
|
||||||
has_credentials(_) -> false.
|
has_credentials(_) -> false.
|
||||||
|
|
||||||
|
|
||||||
-spec expired_credentials(Expiration :: calendar:datetime()) -> true | false.
|
-spec expired_credentials(Expiration :: calendar:datetime()) -> boolean().
|
||||||
%% @doc Indicates if the date that is passed in has expired.
|
%% @doc Indicates if the date that is passed in has expired.
|
||||||
%% end
|
%% end
|
||||||
expired_credentials(undefined) -> false;
|
expired_credentials(undefined) -> false;
|
||||||
|
|
@ -354,9 +354,8 @@ local_time() ->
|
||||||
|
|
||||||
|
|
||||||
-spec maybe_decode_body(ContentType :: {nonempty_string(), nonempty_string()}, Body :: body()) -> list() | body().
|
-spec maybe_decode_body(ContentType :: {nonempty_string(), nonempty_string()}, Body :: body()) -> list() | body().
|
||||||
%% @doc Attempt to decode the response body based upon the mime type that is
|
%% @doc Attempt to decode the response body by its MIME
|
||||||
%% presented.
|
%% @end
|
||||||
%% @end.
|
|
||||||
maybe_decode_body({"application", "x-amz-json-1.0"}, Body) ->
|
maybe_decode_body({"application", "x-amz-json-1.0"}, Body) ->
|
||||||
rabbitmq_aws_json:decode(Body);
|
rabbitmq_aws_json:decode(Body);
|
||||||
maybe_decode_body({"application", "json"}, Body) ->
|
maybe_decode_body({"application", "json"}, Body) ->
|
||||||
|
|
@ -387,7 +386,7 @@ perform_request(State, Service, Method, Headers, Path, Body, Options, Host) ->
|
||||||
Headers, Path, Body, Options, Host).
|
Headers, Path, Body, Options, Host).
|
||||||
|
|
||||||
|
|
||||||
-spec perform_request_has_creds(true | false, State :: state(),
|
-spec perform_request_has_creds(HasCreds :: boolean(), State :: state(),
|
||||||
Service :: string(), Method :: method(),
|
Service :: string(), Method :: method(),
|
||||||
Headers :: headers(), Path :: path(), Body :: body(),
|
Headers :: headers(), Path :: path(), Body :: body(),
|
||||||
Options :: http_options(), Host :: string() | undefined)
|
Options :: http_options(), Host :: string() | undefined)
|
||||||
|
|
@ -403,7 +402,7 @@ perform_request_has_creds(false, State, _, _, _, _, _, _, _) ->
|
||||||
perform_request_creds_error(State).
|
perform_request_creds_error(State).
|
||||||
|
|
||||||
|
|
||||||
-spec perform_request_creds_expired(true | false, State :: state(),
|
-spec perform_request_creds_expired(CredsExp :: boolean(), State :: state(),
|
||||||
Service :: string(), Method :: method(),
|
Service :: string(), Method :: method(),
|
||||||
Headers :: headers(), Path :: path(), Body :: body(),
|
Headers :: headers(), Path :: path(), Body :: body(),
|
||||||
Options :: http_options(), Host :: string() | undefined)
|
Options :: http_options(), Host :: string() | undefined)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue