SmeeView.Aspects.Contact (SmeeView v0.1.0) View Source

Represents and processes <ContactPerson> elements in entity metadata as Aspect structs.

The functions in this module are intended to be applied to individual Aspect structs - for extracting and processing collections of these records please use the matching View module.

Link to this section Summary

Functions

Returns the company name, if present (it probably isn't!)

Returns the suggested display name of a contact, derived from given name, surname and company.

Returns the email address as a bare email address (without name, not a URL)

Returns the contact's email address as a URL (as it's stored in the metadata, probably)

Returns the contact's givenname, if present

Is this aspect relevant to the IdP role?

Returns the email address and name in RFC5322 name-addr format (name address@domain)

Returns the phone number of the contact, if present.

Returns the phone number of the contact (or nil) as a URL, as it probably isn't stored in the metadata

Returns the associated role for this aspect: :sp, :idp or :all

Is this aspect relevant to the SP role?

Returns the surname of the contact, if present.

Returns the contact type (technical, support, administrative, billing, or other)

Link to this section Types

Specs

t() :: %SmeeView.Aspects.Contact{
  company: binary(),
  email: binary(),
  givenname: binary(),
  phone: binary(),
  surname: binary(),
  type: binary()
}

Link to this section Functions

Specs

company(aspect :: t()) :: binary() | nil

Returns the company name, if present (it probably isn't!)

Contact.company(aspect)
# => "Unseen University"

Specs

displayname(aspect :: t()) :: binary()

Returns the suggested display name of a contact, derived from given name, surname and company.

Contact.displayname(contact)
# => "Ponder Stibbons (Unseen University)"

Specs

email(aspect :: t()) :: binary() | nil

Returns the email address as a bare email address (without name, not a URL)

Contact.email(contact)
# => "ponders@unseen.edu"

Specs

email_url(aspect :: t()) :: binary() | nil

Returns the contact's email address as a URL (as it's stored in the metadata, probably)

Contact.email_url(contact)
# => "mailto:ponders@unseen.edu"

Specs

givenname(aspect :: t()) :: binary() | nil

Returns the contact's givenname, if present

Contact.givenname(contact)
# => "Ponder"

Specs

idp?(aspect :: t()) :: boolean()

Is this aspect relevant to the IdP role?

Will return true if the aspect has been derived from an IdP role, or is applicable to all roles.

Contact.idp?(aspect)
# => true

Specs

name_addr(aspect :: t()) :: binary()

Returns the email address and name in RFC5322 name-addr format (name address@domain)

Contact.name_addr(contact)
# => "Ponder Stibbons <ponders@unseen.edu>"

Specs

phone(aspect :: t()) :: binary() | nil

Returns the phone number of the contact, if present.

Contact.phone(contact)
# => "01632960808"

Specs

phone_url(aspect :: t()) :: binary() | nil

Returns the phone number of the contact (or nil) as a URL, as it probably isn't stored in the metadata

Contact.phone_url(contact)
# => "tel:01632960808"

Specs

role(aspect :: t()) :: atom()

Returns the associated role for this aspect: :sp, :idp or :all

The role type is useful when handling a mixed list of aspects that may be specific to certain roles of an entity.

Contact.role(aspect)
# => :idp

Specs

sp?(aspect :: t()) :: boolean()

Is this aspect relevant to the SP role?

Will return true if the aspect has been derived from an SP role, or is applicable to all roles.

Contact.sp?(aspect)
# => false

Specs

surname(aspect :: t()) :: binary() | nil

Returns the surname of the contact, if present.

Contact.surname(contact)
# => "Stibbons"

Specs

type(aspect :: t()) :: binary()

Returns the contact type (technical, support, administrative, billing, or other)

Contact.type(contact)
# => "administrative"