aws_util (aws_beam_core v1.2.1)

View Source

Summary

Functions

Include additions only if they don't already exist in the provided list.

Add querystring to url is there are any parameters in the list

Apply the AWS-canonical endpoint-override env vars to a default URL.

Join binary values using the specified separator.

Decode XML into a map representation

Encode URI taking into account if it contains more than one segment.

Encode the map's key/value pairs as a querystring. The query string must be sorted. The query string for query params that do not contain a value such as "key" should be encoded as "key=". Without this fix, the request will result in a SignatureDoesNotMatch error.

Encode URI into a percent-encoding string.

Encode an Erlang map as XML

Functions

add_headers(Additions, Headers)

Include additions only if they don't already exist in the provided list.

add_query(Url, Query0)

-spec add_query(binary(), [{binary(), any()}]) -> binary().

Add querystring to url is there are any parameters in the list

apply_endpoint_url_override(DefaultUrl, DefaultHost, OpPath, ServiceEnvVar)

-spec apply_endpoint_url_override(binary(), binary(), binary(), binary()) -> {binary(), binary()}.

Apply the AWS-canonical endpoint-override env vars to a default URL.

ServiceEnvVar is the service-specific env var name (e.g. <<"AWS_ENDPOINT_URL_DYNAMODB">>). It is consulted first; the generic AWS_ENDPOINT_URL is consulted as a fallback. Matches the precedence of the AWS CLI v2, boto3, JS v3, and Go v2 SDKs.

When an override is set, the scheme + authority of the request URL are replaced with those of the override, the override's base path is joined with the operation path (OpPath), any query string or fragment in the override is dropped (matching Go v2's middleware behavior), and the returned Host is the override's authority (host[:port]) so SigV4 signs against the wire endpoint.

When unset, the defaults are returned unchanged. An empty-string value ("") is treated as unset.

binary_join(L, Sep)

Join binary values using the specified separator.

decode_xml(Xml)

Decode XML into a map representation

When there is more than one element with the same tag name, their values get merged into a list.

If the content is only text then a key with the element name and a value with the content is inserted.

If the content is a mix between text and child elements, then the elements are processed as described above and all the text parts are merged under the binary __text key.

encode_multi_segment_uri(Value)

Encode URI taking into account if it contains more than one segment.

encode_query(QueryL)

Encode the map's key/value pairs as a querystring. The query string must be sorted. The query string for query params that do not contain a value such as "key" should be encoded as "key=". Without this fix, the request will result in a SignatureDoesNotMatch error.

encode_uri(Value)

-spec encode_uri(binary()) -> binary().

Encode URI into a percent-encoding string.

encode_uri(Value, Type)

-spec encode_uri(binary(), skip_slash | full) -> binary().

encode_xml(Map)

Encode an Erlang map as XML

All keys must be binaries. Values can be a binary, a list, an integer a float or another nested map.