View Source ExPorterSDK.Parser (ExPorterSDK v0.1.0)

Provides functions to parse fare estimate data, customer details, contact details, and addresses.

Summary

Functions

Parses address details from a map.

Parses contact details from a map.

Parses customer details from a map.

Parses fare estimate data from a map.

Functions

@spec parse_address(map() | nil) ::
  {:ok, ExPorterSDK.Structs.Types.AddressLatLng.t()} | {:error, String.t()}

Parses address details from a map.

Parameters

  • map: A map containing address details or nil.

Returns

  • {:ok, AddressLatLng.t()} on success.
  • {:error, String.t()} on failure with an error message.
@spec parse_contact(map() | nil) ::
  {:ok, ExPorterSDK.Structs.Types.ContactDetails.t()} | {:error, String.t()}

Parses contact details from a map.

Parameters

  • map: A map containing contact details or nil.

Returns

  • {:ok, ContactDetails.t()} on success.
  • {:error, String.t()} on failure with an error message.
@spec parse_customer(map() | nil) ::
  {:ok, ExPorterSDK.Structs.Types.CustomerDetails.t()} | {:error, String.t()}

Parses customer details from a map.

Parameters

  • map: A map containing customer details or nil.

Returns

  • {:ok, CustomerDetails.t()} on success.
  • {:error, String.t()} on failure with an error message.
Link to this function

parse_fare_estimate(map)

View Source
@spec parse_fare_estimate(map() | nil) ::
  ExPorterSDK.Structs.Types.FareEstimateRequest.t() | {:error, String.t()}

Parses fare estimate data from a map.

Parameters

  • map: A map containing fare estimate data or nil.

Returns

  • FareEstimateRequest.t() on success.
  • {:error, String.t()} on failure with an error message.