cellular

package
v0.0.0-...-8fb3fdf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2025 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetResourceSchema = schema.Schema{
	MarkdownDescription: "Manages the SIM and APN configurations for a cellular device.",
	Attributes: map[string]schema.Attribute{
		"id": schema.StringAttribute{
			MarkdownDescription: "Unique identifier for the resource.",
			Computed:            true,
		},
		"serial": schema.StringAttribute{
			MarkdownDescription: "Serial number of the device.",
			Optional:            true,
			Computed:            true,
		},
		"sim_failover": schema.SingleNestedAttribute{
			Optional: true,
			Computed: true,
			Attributes: map[string]schema.Attribute{
				"enabled": schema.BoolAttribute{
					MarkdownDescription: "If true, failover to the secondary SIM is enabled.",
					Optional:            true,
					Computed:            true,
					Default:             utils.NewBoolDefault(false),
				},
				"timeout": schema.Int64Attribute{
					MarkdownDescription: "Timeout value (in seconds) for SIM failover. Defaults to 0.",
					Optional:            true,
					Computed:            true,
					Default:             utils.NewInt64Default(0),
				},
			},
		},
		"sims": SimsSchema(),
		"sim_ordering": schema.SetAttribute{
			MarkdownDescription: "Ordered list of SIM slots, prioritized for failover.",
			Computed:            true,
			ElementType:         types.StringType,
		},
	},
}

GetResourceSchema defines the schema for the resource.

Functions

func ApnsSchema

func ApnsSchema() schema.SetNestedAttribute

ApnsSchema defines the schema for the apns attribute inside sims.

func AuthenticationSchema

func AuthenticationSchema() schema.SingleNestedAttribute

AuthenticationSchema defines the schema for the authentication attribute inside apns.

func NewResource

func NewResource() resource.Resource

func ResourceModelApnsAttrTypes

func ResourceModelApnsAttrTypes() map[string]attr.Type

ResourceModelApnsAttrTypes defines the attribute types for ResourceModelApns.

func ResourceModelAttrTypes

func ResourceModelAttrTypes() map[string]attr.Type

ResourceModelAttrTypes defines the attribute types for the top-level ResourceModel.

func ResourceModelAuthenticationAttrTypes

func ResourceModelAuthenticationAttrTypes() map[string]attr.Type

ResourceModelAuthenticationAttrTypes defines the attribute types for ResourceModelAuthentication.

func ResourceModelSimAttrTypes

func ResourceModelSimAttrTypes() map[string]attr.Type

ResourceModelSimAttrTypes defines the attribute types for ResourceModelSim.

func ResourceModelSimFailOverAttrTypes

func ResourceModelSimFailOverAttrTypes() map[string]attr.Type

ResourceModelSimFailOverAttrTypes defines the attribute types for ResourceModelSimFailOver.

func SimsSchema

func SimsSchema() schema.SetNestedAttribute

SimsSchema defines the schema for the sims attribute.

Types

type Resource

type Resource struct {
	// contains filtered or unexported fields
}

func (*Resource) Configure

func (*Resource) Create

func (*Resource) Delete

func (*Resource) ImportState

func (*Resource) Metadata

func (*Resource) Read

func (*Resource) Schema

Schema defines the schema for the resource.

func (*Resource) Update

type ResourceModel

type ResourceModel struct {
	Id          types.String `tfsdk:"id" json:"-"`
	Serial      types.String `tfsdk:"serial" json:"serial"`
	Sims        types.Set    `tfsdk:"sims" json:"sims"` // Updated to match schema
	SimFailOver types.Object `tfsdk:"sim_failover" json:"simFailover"`
	SimOrdering types.Set    `tfsdk:"sim_ordering" json:"simOrdering"`
}

ResourceModel represents the top-level resource structure.

type ResourceModelApns

type ResourceModelApns struct {
	Name           types.String `tfsdk:"name" json:"name"`
	AllowedIpTypes types.Set    `tfsdk:"allowed_ip_types" json:"allowedIpTypes"`
	Authentication types.Object `tfsdk:"authentication" json:"authentication"`
}

ResourceModelApns represents an APN configuration for a SIM.

type ResourceModelAuthentication

type ResourceModelAuthentication struct {
	Password types.String `tfsdk:"password" json:"password"`
	Username types.String `tfsdk:"username" json:"username"`
	Type     types.String `tfsdk:"type" json:"type"`
}

ResourceModelAuthentication represents APN authentication details.

type ResourceModelSim

type ResourceModelSim struct {
	Slot      types.String `tfsdk:"slot" json:"slot"`
	IsPrimary types.Bool   `tfsdk:"is_primary" json:"isPrimary"`
	Apns      types.Set    `tfsdk:"apns" json:"apns"` // Updated to match schema
}

ResourceModelSim represents an individual SIM configuration.

type ResourceModelSimFailOver

type ResourceModelSimFailOver struct {
	Enabled types.Bool  `tfsdk:"enabled" json:"enabled"`
	Timeout types.Int64 `tfsdk:"timeout" json:"timeout"`
}

ResourceModelSimFailOver represents SIM failover configuration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL