     mandatory: %{},
     optional: %{},
   ]
+
+  @type header :: {non_neg_integer, non_neg_integer, non_neg_integer}
+
+  @spec new(header, map, map) :: t
 
   def new({command_id, command_status, sequence_number}, mandatory_fields, optional_fields) do
     %Pdu{

defmodule SMPPEX.Pdu do
  alias SMPPEX.Protocol.TlvFormat
  alias SMPPEX.Pdu

  @type t :: %Pdu{
    command_id: integer,
    command_status: integer,
    sequence_number: integer,
    mandatory: map(),
    optional: map()
  }

  defstruct [

    end
  end

  @spec field(t, integer | atom) :: any

  def field(pdu, id_or_name) do
    mandatory_field(pdu, id_or_name) || optional_field(pdu, id_or_name)
  end

  @spec optional_fields(t) :: map

  def optional_fields(pdu), do: pdu.optional

  @spec mandatory_fields(t) :: map

  def mandatory_fields(pdu), do: pdu.mandatory

