# SPDX-FileCopyrightText: 2025 diffo_example contributors # # SPDX-License-Identifier: MIT defmodule DiffoExample.Access.BandwidthProfile do @moduledoc """ Diffo - TMF Service and Resource Management with a difference BandwidthProfile - AshTyped Struct for BandwidthProfile """ use Ash.TypedStruct, extensions: [AshJason.TypedStruct, AshOutstanding.TypedStruct] jason do pick [:downstream, :upstream, :units] compact true end outstanding do expect [:downstream, :upstream, :units] end typed_struct do field :downstream, :integer, constraints: [min: 0], description: "the bandwidth profile downstream rate" field :upstream, :integer, constraints: [min: 0], description: "the bandwidth profile upstream rate" field :units, :atom, default: :Mbps, constraints: [one_of: [:kbps, :Mbps]], description: "the bandwidth profile units" end end