Ltix.LaunchClaims.MembershipsEndpoint (Ltix v0.1.0)

Copy Markdown View Source

Memberships service endpoint claim.

Provides a URL for retrieving context membership. All fields are optional when parsed from launch claims; the context_memberships_url is required when constructing an endpoint manually via new/1.

Examples

iex> Ltix.LaunchClaims.MembershipsEndpoint.from_json(%{"context_memberships_url" => "https://example.com/members"})
{:ok, %Ltix.LaunchClaims.MembershipsEndpoint{context_memberships_url: "https://example.com/members", service_versions: nil}}

Summary

Functions

Parse a memberships endpoint claim from a JSON map.

Create a memberships endpoint from a URL string.

Types

t()

@type t() :: %Ltix.LaunchClaims.MembershipsEndpoint{
  context_memberships_url: binary(),
  service_versions: [binary()]
}

Functions

from_json(json)

@spec from_json(map()) :: {:ok, t()} | {:error, Exception.t()}

Parse a memberships endpoint claim from a JSON map.

Examples

iex> Ltix.LaunchClaims.MembershipsEndpoint.from_json(%{})
{:ok, %Ltix.LaunchClaims.MembershipsEndpoint{context_memberships_url: nil, service_versions: nil}}

new(url)

@spec new(String.t()) :: t()

Create a memberships endpoint from a URL string.

Examples

iex> Ltix.LaunchClaims.MembershipsEndpoint.new("https://lms.example.com/memberships")
%Ltix.LaunchClaims.MembershipsEndpoint{context_memberships_url: "https://lms.example.com/memberships", service_versions: nil}