Protocol for converting your deployment struct to an Ltix.Deployment.
Implement it for your deployment struct, and your storage adapter can
return that struct. The Ltix.LaunchContext from a launch has your struct.
defmodule MyApp.ToolDeployment do
defstruct [:id, :registration_id, :deployment_id, :label]
defimpl Ltix.Deployable do
def to_deployment(dep) do
Ltix.Deployment.new(dep.deployment_id)
end
end
endLtix.Deployment implements this protocol, so your storage adapter can
also return a %Deployment{}. Login and launch return the same error as
Ltix.Deployment.new/1 for an invalid one.
Summary
Functions
Return the Ltix.Deployment for the given struct.
Types
@type t() :: term()
All the types that implement this protocol.
Functions
@spec to_deployment(t()) :: {:ok, Ltix.Deployment.t()} | {:error, Exception.t()}
Return the Ltix.Deployment for the given struct.
Build it with Ltix.Deployment.new/1, which validates the fields.