View Source AntikytheraAws.Auth.Credentials (antikythera_aws v0.3.1)

Summary

Functions

Type-aware getter for access_key_id.

Type-aware setter for access_key_id.

Creates a new instance of AntikytheraAws.Auth.Credentials by using the given dict.

A variant of new/1 which returns t or raise if validation fails.

Type-aware getter for secret_access_key.

Type-aware setter for secret_access_key.

Type-aware getter for security_token.

Type-aware setter for security_token.

Type-aware getter for source_type.

Type-aware setter for source_type.

Updates an existing instance of AntikytheraAws.Auth.Credentials with the given dict. The values in the dict are validated by each field's valid?/1 function. Returns {:ok, valid_struct} or {:error, reason}.

A variant of update/2 which returns t or raise if validation fails. In other words, update/2 followed by Croma.Result.get!/1.

Checks if the given value belongs to t/0 or not.

Types

@type t() :: %AntikytheraAws.Auth.Credentials{
  access_key_id: Croma.String.t(),
  secret_access_key: Croma.String.t(),
  security_token: Croma.TypeGen.Nilable.Croma.String.t(),
  source_type: AntikytheraAws.Auth.SourceType.t()
}

Functions

Link to this function

access_key_id(credentials)

View Source
@spec access_key_id(t()) :: Croma.String.t()

Type-aware getter for access_key_id.

@spec access_key_id(t(), Croma.String.t()) :: t()

Type-aware setter for access_key_id.

@spec new(term()) :: Croma.Result.t(t())

Creates a new instance of AntikytheraAws.Auth.Credentials by using the given dict.

Returns {:ok, valid_struct} or {:error, reason}.

The values in the dict are validated by each field's valid?/1 function. If the value was invalid, it will be passed to new/1 of the field

For missing fields, followings will be tried:

  • default/0 of each field type
  • new/1 of each field type, with empty map as input
@spec new!(term()) :: t()

A variant of new/1 which returns t or raise if validation fails.

In other words, new/1 followed by Croma.Result.get!/1.

Link to this function

secret_access_key(credentials)

View Source
@spec secret_access_key(t()) :: Croma.String.t()

Type-aware getter for secret_access_key.

Link to this function

secret_access_key(s, field)

View Source
@spec secret_access_key(t(), Croma.String.t()) :: t()

Type-aware setter for secret_access_key.

Link to this function

security_token(credentials)

View Source
@spec security_token(t()) :: Croma.TypeGen.Nilable.Croma.String.t()

Type-aware getter for security_token.

Link to this function

security_token(s, field)

View Source
@spec security_token(t(), Croma.TypeGen.Nilable.Croma.String.t()) :: t()

Type-aware setter for security_token.

Link to this function

source_type(credentials)

View Source
@spec source_type(t()) :: AntikytheraAws.Auth.SourceType.t()

Type-aware getter for source_type.

@spec source_type(t(), AntikytheraAws.Auth.SourceType.t()) :: t()

Type-aware setter for source_type.

@spec update(t(), Dict.t()) :: Croma.Result.t(t())

Updates an existing instance of AntikytheraAws.Auth.Credentials with the given dict. The values in the dict are validated by each field's valid?/1 function. Returns {:ok, valid_struct} or {:error, reason}.

@spec update!(t(), Dict.t()) :: t()

A variant of update/2 which returns t or raise if validation fails. In other words, update/2 followed by Croma.Result.get!/1.

@spec valid?(term()) :: boolean()

Checks if the given value belongs to t/0 or not.