Documentation
¶
Index ¶
- Variables
- func ApnsSchema() schema.SetNestedAttribute
- func AuthenticationSchema() schema.SingleNestedAttribute
- func NewResource() resource.Resource
- func ResourceModelApnsAttrTypes() map[string]attr.Type
- func ResourceModelAttrTypes() map[string]attr.Type
- func ResourceModelAuthenticationAttrTypes() map[string]attr.Type
- func ResourceModelSimAttrTypes() map[string]attr.Type
- func ResourceModelSimFailOverAttrTypes() map[string]attr.Type
- func SimsSchema() schema.SetNestedAttribute
- type Resource
- func (r *Resource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *Resource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *Resource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *Resource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *Resource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *Resource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *Resource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *Resource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type ResourceModel
- type ResourceModelApns
- type ResourceModelAuthentication
- type ResourceModelSim
- type ResourceModelSimFailOver
Constants ¶
This section is empty.
Variables ¶
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 ResourceModelApnsAttrTypes ¶
ResourceModelApnsAttrTypes defines the attribute types for ResourceModelApns.
func ResourceModelAttrTypes ¶
ResourceModelAttrTypes defines the attribute types for the top-level ResourceModel.
func ResourceModelAuthenticationAttrTypes ¶
ResourceModelAuthenticationAttrTypes defines the attribute types for ResourceModelAuthentication.
func ResourceModelSimAttrTypes ¶
ResourceModelSimAttrTypes defines the attribute types for ResourceModelSim.
func ResourceModelSimFailOverAttrTypes ¶
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 (r *Resource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
func (*Resource) Create ¶
func (r *Resource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
func (*Resource) Delete ¶
func (r *Resource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
func (*Resource) ImportState ¶
func (r *Resource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
func (*Resource) Metadata ¶
func (r *Resource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (*Resource) Read ¶
func (r *Resource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
func (*Resource) Schema ¶
func (r *Resource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
Schema defines the schema for the resource.
func (*Resource) Update ¶
func (r *Resource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
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.