42
42
-spec get (Service :: string (),
43
43
Path :: path ()) -> result ().
44
44
% % @doc Perform a HTTP GET request to the AWS API for the specified service. The
45
- % % response will automatically be decoded if it is either in JSON or XML
45
+ % % response will automatically be decoded if it is either in JSON, or XML
46
46
% % format.
47
47
% % @end
48
48
get (Service , Path ) ->
@@ -243,7 +243,7 @@ handle_msg(_Request, State) ->
243
243
-spec endpoint (State :: state (), Host :: string (),
244
244
Service :: string (), Path :: string ()) -> string ().
245
245
% % @doc Return the endpoint URL, either by constructing it with the service
246
- % % information passed in or by using the passed in Host value.
246
+ % % information passed in, or by using the passed in Host value.
247
247
% % @ednd
248
248
endpoint (# state {region = Region }, undefined , Service , Path ) ->
249
249
lists :flatten ([" https://" , endpoint_host (Region , Service ), Path ]);
@@ -294,11 +294,11 @@ get_content_type(Headers) ->
294
294
end ,
295
295
parse_content_type (Value ).
296
296
297
- -spec has_credentials () -> true | false .
297
+ -spec has_credentials () -> boolean () .
298
298
has_credentials () ->
299
299
gen_server :call (rabbitmq_aws , has_credentials ).
300
300
301
- -spec has_credentials (state ()) -> true | false .
301
+ -spec has_credentials (state ()) -> boolean () .
302
302
% % @doc check to see if there are credentials made available in the current state
303
303
% % returning false if not or if they have expired.
304
304
% % @end
@@ -307,7 +307,7 @@ has_credentials(#state{access_key = Key}) when Key /= undefined -> true;
307
307
has_credentials (_ ) -> false .
308
308
309
309
310
- -spec expired_credentials (Expiration :: calendar :datetime ()) -> true | false .
310
+ -spec expired_credentials (Expiration :: calendar :datetime ()) -> boolean () .
311
311
% % @doc Indicates if the date that is passed in has expired.
312
312
% % end
313
313
expired_credentials (undefined ) -> false ;
@@ -354,9 +354,8 @@ local_time() ->
354
354
355
355
356
356
-spec maybe_decode_body (ContentType :: {nonempty_string (), nonempty_string ()}, Body :: body ()) -> list () | body ().
357
- % % @doc Attempt to decode the response body based upon the mime type that is
358
- % % presented.
359
- % % @end.
357
+ % % @doc Attempt to decode the response body by its MIME
358
+ % % @end
360
359
maybe_decode_body ({" application" , " x-amz-json-1.0" }, Body ) ->
361
360
rabbitmq_aws_json :decode (Body );
362
361
maybe_decode_body ({" application" , " json" }, Body ) ->
@@ -387,10 +386,10 @@ perform_request(State, Service, Method, Headers, Path, Body, Options, Host) ->
387
386
Headers , Path , Body , Options , Host ).
388
387
389
388
390
- -spec perform_request_has_creds (true | false , State :: state (),
391
- Service :: string (), Method :: method (),
392
- Headers :: headers (), Path :: path (), Body :: body (),
393
- Options :: http_options (), Host :: string () | undefined )
389
+ -spec perform_request_has_creds (HasCreds :: boolean () , State :: state (),
390
+ Service :: string (), Method :: method (),
391
+ Headers :: headers (), Path :: path (), Body :: body (),
392
+ Options :: http_options (), Host :: string () | undefined )
394
393
-> {Result :: result (), NewState :: state ()}.
395
394
% % @doc Invoked after checking to see if there are credentials. If there are,
396
395
% % validate they have not or will not expire, performing the request if not,
@@ -403,10 +402,10 @@ perform_request_has_creds(false, State, _, _, _, _, _, _, _) ->
403
402
perform_request_creds_error (State ).
404
403
405
404
406
- -spec perform_request_creds_expired (true | false , State :: state (),
407
- Service :: string (), Method :: method (),
408
- Headers :: headers (), Path :: path (), Body :: body (),
409
- Options :: http_options (), Host :: string () | undefined )
405
+ -spec perform_request_creds_expired (CredsExp :: boolean () , State :: state (),
406
+ Service :: string (), Method :: method (),
407
+ Headers :: headers (), Path :: path (), Body :: body (),
408
+ Options :: http_options (), Host :: string () | undefined )
410
409
-> {Result :: result (), NewState :: state ()}.
411
410
% % @doc Invoked after checking to see if the current credentials have expired.
412
411
% % If they haven't, perform the request, otherwise try and refresh the
0 commit comments