Current section

Files

Jump to
diffo_example lib access services characteristic_values line.ex
Raw

lib/access/services/characteristic_values/line.ex

# SPDX-FileCopyrightText: 2025 diffo_example contributors <https://github.com/diffo-dev/diffo_example/graphs.contributors>
#
# SPDX-License-Identifier: MIT
defmodule DiffoExample.Access.Line do
@moduledoc """
Diffo - TMF Service and Resource Management with a difference
Line - AshTyped Struct for Line Characteristic Value
"""
use Ash.TypedStruct, extensions: [AshJason.TypedStruct, AshOutstanding.TypedStruct]
jason do
pick [:port, :slot, :standard, :profile]
compact(true)
end
outstanding do
expect [:port, :slot, :profile]
end
typed_struct do
field :port, :integer,
constraints: [min: 0, max: 47],
description: "the line port number"
field :slot, :integer,
constraints: [min: 0, max: 15],
description: "the line port slot number"
field :standard, :atom,
constraints: [one_of: [:ADSL, :ADSL2plus, :VDSL]],
default: :ADSL2plus,
description: "the line port standard"
field :profile, :string, description: "the line port profile"
end
end