# `Ltix.DeepLinking.ContentItem.LtiResourceLink`
[🔗](https://github.com/DecoyLex/ltix/blob/main/lib/ltix/deep_linking/content_item/lti_resource_link.ex#L1)

An LTI resource link content item for Deep Linking responses.

All fields are optional. The platform can use the tool's base URL when
no `url` is provided. Include a `line_item` to have the platform
auto-create a gradebook column for the link.

See [Building Content Items](cookbooks/building-content-items.md) for
common patterns including line items, custom parameters, and
availability windows.

## Options

* `:title` (`t:String.t/0`) - Title for the content item.

* `:text` (`t:String.t/0`) - Plain-text description.

* `:extensions` (`t:map/0`) - Required. Vendor-specific extension properties. The default value is `%{}`.

* `:available` (`t:map/0`)

* `:url` (`t:String.t/0`) - Launch URL for the resource link.

* `:icon` (`t:map/0`) - Icon or thumbnail for the LTI resource link.

* `:thumbnail` (`t:map/0`) - Icon or thumbnail for the LTI resource link.

* `:line_item` (`t:map/0`)

* `:window` (`t:map/0`) - Window presentation for the LTI resource link.

* `:iframe` (`t:map/0`)

* `:custom` (`t:map/0`) - Custom parameter key-value pairs.

* `:submission` (`t:map/0`)

# `t`

```elixir
@type t() :: %Ltix.DeepLinking.ContentItem.LtiResourceLink{
  available: %{
    optional(:start_date_time) =&gt; binary(),
    optional(:end_date_time) =&gt; binary()
  },
  custom: %{optional(binary()) =&gt; binary()},
  extensions: %{optional(binary()) =&gt; any()},
  icon: %{
    optional(:width) =&gt; integer(),
    :url =&gt; binary(),
    optional(:height) =&gt; integer()
  },
  iframe: %{optional(:width) =&gt; integer(), optional(:height) =&gt; integer()},
  line_item: %{
    optional(:label) =&gt; binary(),
    optional(:tag) =&gt; binary(),
    :score_maximum =&gt; number(),
    optional(:resource_id) =&gt; binary(),
    optional(:grades_released) =&gt; boolean()
  },
  submission: %{
    optional(:start_date_time) =&gt; binary(),
    optional(:end_date_time) =&gt; binary()
  },
  text: binary(),
  thumbnail: %{
    optional(:width) =&gt; integer(),
    :url =&gt; binary(),
    optional(:height) =&gt; integer()
  },
  title: binary(),
  url: binary(),
  window: %{
    optional(:width) =&gt; integer(),
    optional(:height) =&gt; integer(),
    optional(:target_name) =&gt; binary(),
    optional(:window_features) =&gt; binary()
  }
}
```

# `new`

```elixir
@spec new(keyword()) :: {:ok, t()} | {:error, Exception.t()}
```

Create a new LTI resource link content item.

## Examples

    iex> {:ok, link} = Ltix.DeepLinking.ContentItem.LtiResourceLink.new([])
    iex> link.url
    nil

    iex> {:ok, link} = Ltix.DeepLinking.ContentItem.LtiResourceLink.new(url: "https://tool.example.com")
    iex> link.url
    "https://tool.example.com"

---

*Consult [api-reference.md](api-reference.md) for complete listing*
