SmeeOrgs.Organization (SmeeOrgs v0.2.0)

Copy Markdown View Source

A struct and helper modules for working with SAML metadata organizations

Summary

Functions

Returns a block of text gathered from various fields of the Organization structure.

Returns a displayname for the Organization. A preferred language can be requested.

Lists domains present in the Organization struct

Lists the language codes used in the Organization record.

Returns a name for the Organization. A preferred language can be requested.

Returns a list of tags used in an Organization

Lists all acceptable types for Organizations, as atoms.

Returns a URI ID for the organization

Returns the specified type of URI for the organization.

Returns the informational URL for an Organization. A preferred language can be requested.

Types

t()

@type t() :: %SmeeOrgs.Organization{
  base_domain: nil | binary(),
  country: nil | binary(),
  displaynames: nil | map(),
  domains: [binary()],
  entity_uris: [binary()],
  federations: [binary()],
  location: nil | binary(),
  logo_url: nil | binary(),
  names: nil | map(),
  noid: binary(),
  registrars: [binary()],
  ror: nil | binary(),
  tags: [binary()],
  type: atom(),
  uri: nil | binary(),
  urls: nil | map(),
  wikipedia: nil | binary()
}

Functions

aggregated_text(org)

@spec aggregated_text(org :: t()) :: binary()

Returns a block of text gathered from various fields of the Organization structure.

This text is useful for indexing and searching structs, and is used by SmeeOrgs.Filter.contains/3

displayname(org, lang \\ "en")

@spec displayname(org :: t(), lang :: binary()) :: binary()

Returns a displayname for the Organization. A preferred language can be requested.

If no language is specified English is used if available, otherwise any other name may be chosen.

domains(org)

@spec domains(org :: t()) :: [binary()]

Lists domains present in the Organization struct

langs(org)

@spec langs(org :: t()) :: [binary()]

Lists the language codes used in the Organization record.

The same language codes might not be used in all multi-language fields.

name(org, lang \\ "en")

@spec name(org :: t(), lang :: binary()) :: binary()

Returns a name for the Organization. A preferred language can be requested.

If no language is specified English is used if available, otherwise any other name may be chosen.

tags(org)

@spec tags(org :: t()) :: [binary()]

Returns a list of tags used in an Organization

Tags are strings so that more accessible camel-cased tags can be used.

types()

@spec types() :: [atom()]

Lists all acceptable types for Organizations, as atoms.

The list of possible types is based on ROR types, plus :unknown.

uri(org)

@spec uri(org :: t()) :: binary()

Returns a URI ID for the organization

Unlike Entities and Federations Organizations do not have a single existing public ID, so by default the uri field in Organization structs is nil.

If a URI is present that is returned, failing that if a ROR ID is present then that is returned, otherwise a completely arbitrary Smee URN-style string is returned

uri(org, type)

@spec uri(org :: t(), type :: atom()) :: binary() | nil

Returns the specified type of URI for the organization.

Possible types are:

  • :smee - smee:org:noid:ligo
  • :ror - https://ror.org/0518wrr32

If an ID of the specified type is present, or can be created, it is returned, otherwise nil is returned.

url(org, lang \\ "en")

@spec url(org :: t(), lang :: binary()) :: binary()

Returns the informational URL for an Organization. A preferred language can be requested.

If no language is specified English is used if available, otherwise any other name may be chosen.