# SPDX-FileCopyrightText: 2025 diffo_example contributors # # SPDX-License-Identifier: MIT defmodule DiffoExample.Access.Dslam do @moduledoc """ Diffo - TMF Service and Resource Management with a difference Dslam - AshTyped Struct for Dslam Characteristic Value """ use Ash.TypedStruct, extensions: [AshJason.TypedStruct, AshOutstanding.TypedStruct] jason do pick [:name, :family, :model, :technology] compact(true) end outstanding do expect [:name] end typed_struct do field :name, :string, constraints: [match: ~r/Q[A-Z]{4}\d{4}/], description: "the DSLAM name" field :family, :atom, constraints: [one_of: [:ISAM, :AMX]], default: :ISAM, description: "the DSLAM family name" field :model, :string, description: "the DSLAM model name" field :technology, :atom, constraints: [one_of: [:eth, :atm]], default: :eth, description: "the DSLAM technology" end end