Ltix.Deployment (Ltix v0.2.0)

Copy Markdown View Source

A specific installation of a tool on a platform, identified by an immutable deployment_id assigned by the platform.

Summary

Functions

Create a new deployment with validation.

Same as new/1, but returns the deployment or raises the error.

Types

t()

@type t() :: %Ltix.Deployment{deployment_id: String.t()}

Functions

new(deployment_id)

@spec new(String.t() | nil) :: {:ok, t()} | {:error, Exception.t()}

Create a new deployment with validation.

Validation rules

  • deployment_id - non-empty string
  • deployment_id - 255 ASCII characters max
  • deployment_id - ASCII characters only

Examples

iex> Ltix.Deployment.new("deploy-001")
{:ok, %Ltix.Deployment{deployment_id: "deploy-001"}}

Ltix.Deployment.new("")
#=> {:error, %Ltix.Errors.Invalid.InvalidField{field: :deployment_id, value: ""}}

new!(deployment_id)

@spec new!(String.t() | nil) :: t()

Same as new/1, but returns the deployment or raises the error.

Examples

iex> Ltix.Deployment.new!("deploy-001")
%Ltix.Deployment{deployment_id: "deploy-001"}