// Copyright © 2023 Cisco Systems, Inc. and its affiliates.
// All rights reserved.
//
// Licensed under the Mozilla Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://mozilla.org/MPL/2.0/
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: MPL-2.0

// Code generated by "gen/generator.go"; DO NOT EDIT.

package provider

// Section below is generated&owned by "gen/generator.go". //template:begin imports
import (
	"context"
	"fmt"
	"strings"

	"github.com/CiscoDevNet/terraform-provider-iosxe/internal/provider/helpers"
	"github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
	"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
	"github.com/hashicorp/terraform-plugin-framework/path"
	"github.com/hashicorp/terraform-plugin-framework/resource"
	"github.com/hashicorp/terraform-plugin-framework/resource/schema"
	"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
	"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
	"github.com/hashicorp/terraform-plugin-framework/schema/validator"
	"github.com/hashicorp/terraform-plugin-framework/types"
	"github.com/hashicorp/terraform-plugin-log/tflog"
	"github.com/netascode/go-restconf"
)

// End of section. //template:end imports

// Section below is generated&owned by "gen/generator.go". //template:begin model

// Ensure provider defined types fully satisfy framework interfaces
var (
	_ resource.Resource                = &SNMPServerResource{}
	_ resource.ResourceWithImportState = &SNMPServerResource{}
)

func NewSNMPServerResource() resource.Resource {
	return &SNMPServerResource{}
}

type SNMPServerResource struct {
	data *IosxeProviderData
}

func (r *SNMPServerResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
	resp.TypeName = req.ProviderTypeName + "_snmp_server"
}

func (r *SNMPServerResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
	resp.Schema = schema.Schema{
		// This description is used by the documentation generator and the language server.
		MarkdownDescription: "This resource can manage the SNMP Server configuration.",

		Attributes: map[string]schema.Attribute{
			"device": schema.StringAttribute{
				MarkdownDescription: "A device name from the provider configuration.",
				Optional:            true,
			},
			"id": schema.StringAttribute{
				MarkdownDescription: "The path of the object.",
				Computed:            true,
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
				},
			},
			"delete_mode": schema.StringAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Configure behavior when deleting/destroying the resource. Either delete the entire object (YANG container) being managed, or only delete the individual resource attributes configured explicitly and leave everything else as-is. Default value is `all`.").AddStringEnumDescription("all", "attributes").String,
				Optional:            true,
				Validators: []validator.String{
					stringvalidator.OneOf("all", "attributes"),
				},
			},
			"chassis_id": schema.StringAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("String to uniquely identify this chassis").String,
				Optional:            true,
			},
			"contact": schema.StringAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Text for mib object sysContact").String,
				Optional:            true,
			},
			"ifindex_persist": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Persist interface indices").String,
				Optional:            true,
			},
			"location": schema.StringAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Text for mib object sysLocation").String,
				Optional:            true,
			},
			"packetsize": schema.Int64Attribute{
				MarkdownDescription: helpers.NewAttributeDescription("Largest SNMP packet size").AddIntegerRangeDescription(484, 17892).String,
				Optional:            true,
				Validators: []validator.Int64{
					int64validator.Between(484, 17892),
				},
			},
			"queue_length": schema.Int64Attribute{
				MarkdownDescription: helpers.NewAttributeDescription("Message queue length for each TRAP host").AddIntegerRangeDescription(1, 5000).String,
				Optional:            true,
				Validators: []validator.Int64{
					int64validator.Between(1, 5000),
				},
			},
			"enable_logging_getop": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP GET Operation logging").String,
				Optional:            true,
			},
			"enable_logging_setop": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP SET Operation logging").String,
				Optional:            true,
			},
			"enable_informs": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP Informs").String,
				Optional:            true,
			},
			"enable_traps": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP Traps").String,
				Optional:            true,
			},
			"enable_traps_snmp_authentication": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable authentication trap").String,
				Optional:            true,
			},
			"enable_traps_snmp_coldstart": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable coldStart trap").String,
				Optional:            true,
			},
			"enable_traps_snmp_linkdown": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable linkDown trap").String,
				Optional:            true,
			},
			"enable_traps_snmp_linkup": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable linkUp trap").String,
				Optional:            true,
			},
			"enable_traps_snmp_warmstart": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable warmStart trap").String,
				Optional:            true,
			},
			"hosts": schema.ListNestedAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Specify hosts keyed by (ip-address, community-or-user)").String,
				Optional:            true,
				NestedObject: schema.NestedAttributeObject{
					Attributes: map[string]schema.Attribute{
						"ip_address": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("").String,
							Required:            true,
						},
						"community_or_user": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("SNMPv1/v2c community string or SNMPv3 user name").String,
							Optional:            true,
							Sensitive:           true,
						},
						"version": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("SNMP version to use for notification messages").AddStringEnumDescription("1", "2c", "3").String,
							Optional:            true,
							Validators: []validator.String{
								stringvalidator.OneOf("1", "2c", "3"),
							},
						},
						"encryption": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("Specifies an encryption type for community string").AddStringEnumDescription("0", "6", "7").String,
							Optional:            true,
							Validators: []validator.String{
								stringvalidator.OneOf("0", "6", "7"),
							},
						},
						"security_level": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("auth", "noauth", "priv").String,
							Optional:            true,
							Validators: []validator.String{
								stringvalidator.OneOf("auth", "noauth", "priv"),
							},
						},
					},
				},
			},
			"vrf_hosts": schema.ListNestedAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Specify hosts keyed by (ip-address, vrf, community-or-user)").String,
				Optional:            true,
				NestedObject: schema.NestedAttributeObject{
					Attributes: map[string]schema.Attribute{
						"ip_address": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("").String,
							Required:            true,
						},
						"vrf": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("VPN Routing instance for this host").String,
							Required:            true,
						},
						"community_or_user": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("SNMPv1/v2c community string or SNMPv3 user name").String,
							Optional:            true,
							Sensitive:           true,
						},
						"version": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("SNMP version to use for notification messages").AddStringEnumDescription("1", "2c", "3").String,
							Optional:            true,
							Validators: []validator.String{
								stringvalidator.OneOf("1", "2c", "3"),
							},
						},
						"encryption": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("Specifies an encryption type for community string").AddStringEnumDescription("0", "6", "7").String,
							Optional:            true,
							Validators: []validator.String{
								stringvalidator.OneOf("0", "6", "7"),
							},
						},
						"security_level": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("auth", "noauth", "priv").String,
							Optional:            true,
							Validators: []validator.String{
								stringvalidator.OneOf("auth", "noauth", "priv"),
							},
						},
					},
				},
			},
			"system_shutdown": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable use of the SNMP reload command").String,
				Optional:            true,
			},
			"enable_traps_flowmon": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP flowmon notifications").String,
				Optional:            true,
			},
			"enable_traps_entity_perf_throughput_notif": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable ENTITY PERFORMANCE MIB throughput traps").String,
				Optional:            true,
			},
			"enable_traps_call_home_message_send_fail": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_call_home_server_fail": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_tty": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable TCP connection traps").String,
				Optional:            true,
			},
			"enable_traps_ospfv3_config_state_change": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable all traps of state-change").String,
				Optional:            true,
			},
			"enable_traps_ospfv3_config_errors": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable all traps of errors").String,
				Optional:            true,
			},
			"enable_traps_ospf_config_retransmit": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable all traps of retransmit").String,
				Optional:            true,
			},
			"enable_traps_ospf_config_lsa": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable all traps of lsa").String,
				Optional:            true,
			},
			"enable_traps_ospf_nssa_trans_change": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Nssa translator state changes").String,
				Optional:            true,
			},
			"enable_traps_ospf_shamlink_interface": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Sham link interface state changes").String,
				Optional:            true,
			},
			"enable_traps_ospf_shamlink_neighbor": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Sham link neighbor state changes").String,
				Optional:            true,
			},
			"enable_traps_ospf_errors_enable": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable all traps of errors").String,
				Optional:            true,
			},
			"enable_traps_ospf_retransmit_enable": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable all traps of retransmit").String,
				Optional:            true,
			},
			"enable_traps_ospf_lsa_enable": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable all traps of lsa").String,
				Optional:            true,
			},
			"enable_traps_eigrp": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP EIGRP traps").String,
				Optional:            true,
			},
			"enable_traps_auth_framework_sec_violation": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_rep": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_vtp": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_vlancreate": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_vlandelete": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_port_security": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP port security traps").String,
				Optional:            true,
			},
			"enable_traps_license": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable license traps").String,
				Optional:            true,
			},
			"enable_traps_smart_license": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable smart license traps").String,
				Optional:            true,
			},
			"enable_traps_cpu_threshold": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Allow CPU utilization threshold violation traps").String,
				Optional:            true,
			},
			"enable_traps_memory_bufferpeak": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP Memory Bufferpeak traps").String,
				Optional:            true,
			},
			"enable_traps_stackwise": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP stackwise traps").String,
				Optional:            true,
			},
			"enable_traps_udld_link_fail_rpt": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP cudldpFastHelloLinkFailRptNotification traps").String,
				Optional:            true,
			},
			"enable_traps_udld_status_change": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP cudldpFastHelloStatusChangeNotification traps").String,
				Optional:            true,
			},
			"enable_traps_fru_ctrl": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP entity FRU control traps").String,
				Optional:            true,
			},
			"enable_traps_flash_insertion": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP Flash Insertion notifications").String,
				Optional:            true,
			},
			"enable_traps_flash_removal": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP Flash Removal notifications").String,
				Optional:            true,
			},
			"enable_traps_flash_lowspace": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP Flash Lowspace notifications").String,
				Optional:            true,
			},
			"enable_traps_energywise": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_power_ethernet_group": schema.StringAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP inline power group based traps").String,
				Optional:            true,
			},
			"enable_traps_power_ethernet_police": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable Policing Trap").String,
				Optional:            true,
			},
			"enable_traps_entity": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP entity traps").String,
				Optional:            true,
			},
			"enable_traps_pw_vc": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_envmon": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP environmental monitor traps").String,
				Optional:            true,
			},
			"enable_traps_cef_resource_failure": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_cef_peer_state_change": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_cef_peer_fib_state_change": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_cef_inconsistency": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_isis": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable ISIS traps traps").String,
				Optional:            true,
			},
			"enable_traps_ipsla": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable IPSLA traps traps").String,
				Optional:            true,
			},
			"enable_traps_entity_diag_boot_up_fail": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP ceDiagBootUpFailedNotif traps").String,
				Optional:            true,
			},
			"enable_traps_entity_diag_hm_test_recover": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP ceDiagHMTestRecoverNotif traps").String,
				Optional:            true,
			},
			"enable_traps_entity_diag_hm_thresh_reached": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP ceDiagHMThresholdReachedNotif traps").String,
				Optional:            true,
			},
			"enable_traps_entity_diag_scheduled_test_fail": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP ceDiagScheduledTestFailedNotif traps").String,
				Optional:            true,
			},
			"enable_traps_bfd": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_ike_policy_add": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable IKE Policy add trap").String,
				Optional:            true,
			},
			"enable_traps_ike_policy_delete": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable IKE Policy delete trap").String,
				Optional:            true,
			},
			"enable_traps_ike_tunnel_start": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable IKE Tunnel start trap").String,
				Optional:            true,
			},
			"enable_traps_ike_tunnel_stop": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable IKE Tunnel stop trap").String,
				Optional:            true,
			},
			"enable_traps_ipsec_cryptomap_add": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable IPsec Cryptomap add trap").String,
				Optional:            true,
			},
			"enable_traps_ipsec_cryptomap_attach": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable IPsec Cryptomap Attach trap").String,
				Optional:            true,
			},
			"enable_traps_ipsec_cryptomap_delete": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable IPsec Cryptomap delete trap").String,
				Optional:            true,
			},
			"enable_traps_ipsec_cryptomap_detach": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable IPsec Cryptomap Detach trap").String,
				Optional:            true,
			},
			"enable_traps_ipsec_tunnel_start": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable IPsec Tunnel Start trap").String,
				Optional:            true,
			},
			"enable_traps_ipsec_tunnel_stop": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable IPsec Tunnel Stop trap").String,
				Optional:            true,
			},
			"enable_traps_ipsec_too_many_sas": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable IPsec Tunnel Start trap").String,
				Optional:            true,
			},
			"enable_traps_config_copy": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP config-copy traps").String,
				Optional:            true,
			},
			"enable_traps_config": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP config traps").String,
				Optional:            true,
			},
			"enable_traps_config_ctid": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_dhcp": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP dhcp traps").String,
				Optional:            true,
			},
			"enable_traps_event_manager": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP Embedded Event Manager traps").String,
				Optional:            true,
			},
			"enable_traps_hsrp": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP HSRP traps").String,
				Optional:            true,
			},
			"enable_traps_ipmulticast": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP ipmulticast traps").String,
				Optional:            true,
			},
			"enable_traps_msdp": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP MSDP traps").String,
				Optional:            true,
			},
			"enable_traps_ospf_config_state_change": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable all traps of state-change").String,
				Optional:            true,
			},
			"enable_traps_ospf_config_errors": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable all traps of errors").String,
				Optional:            true,
			},
			"enable_traps_pim_invalid_pim_message": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable invalid pim message trap").String,
				Optional:            true,
			},
			"enable_traps_pim_neighbor_change": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable neighbor change trap").String,
				Optional:            true,
			},
			"enable_traps_pim_rp_mapping_change": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable rp mapping change trap").String,
				Optional:            true,
			},
			"enable_traps_bridge_newroot": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_bridge_topologychange": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_stpx_inconsistency": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_stpx_root_inconsistency": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_stpx_loop_inconsistency": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_syslog": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP syslog traps").String,
				Optional:            true,
			},
			"enable_traps_bgp_cbgp2": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable BGP MIBv2 traps").String,
				Optional:            true,
			},
			"enable_traps_nhrp_nhs": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_nhrp_nhc": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_nhrp_nhp": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_nhrp_quota_exceeded": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_mpls_traffic_eng": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Allow SNMP MPLS traffic engineering traps").String,
				Optional:            true,
			},
			"enable_traps_mpls": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP MPLS traps").String,
				Optional:            true,
			},
			"enable_traps_mpls_vpn": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Allow SNMP MPLS Virtual Private Network traps").String,
				Optional:            true,
			},
			"enable_traps_mpls_rfc": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP MPLS RFC traps").String,
				Optional:            true,
			},
			"enable_traps_mpls_rfc_ldp": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Allow SNMP MPLS label distribution protocol RFC traps").String,
				Optional:            true,
			},
			"enable_traps_mpls_ldp": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Allow SNMP MPLS label distribution protocol traps").String,
				Optional:            true,
			},
			"enable_traps_fast_reroute_protected": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable MPLS fast reroute protection traps").String,
				Optional:            true,
			},
			"enable_traps_local_auth": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP local auth traps").String,
				Optional:            true,
			},
			"enable_traps_vlan_membership": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_errdisable": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP errdisable notifications").String,
				Optional:            true,
			},
			"enable_traps_rf": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable all SNMP traps defined in CISCO-RF-MIB").String,
				Optional:            true,
			},
			"enable_traps_transceiver_all": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_bulkstat_collection": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable Data-Collection-MIB Collection notifications").String,
				Optional:            true,
			},
			"enable_traps_bulkstat_transfer": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable Data-Collection-MIB Transfer notifications").String,
				Optional:            true,
			},
			"enable_traps_mac_notification_change": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP Change traps").String,
				Optional:            true,
			},
			"enable_traps_mac_notification_move": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP Move traps").String,
				Optional:            true,
			},
			"enable_traps_mac_notification_threshold": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP Threshold traps").String,
				Optional:            true,
			},
			"enable_traps_vrfmib_vrf_up": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_vrfmib_vrf_down": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_vrfmib_vnet_trunk_up": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_vrfmib_vnet_trunk_down": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_mvpn": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable Multicast Virtual Private Networks traps").String,
				Optional:            true,
			},
			"enable_traps_lisp": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Allow SNMP LISP MIB traps").String,
				Optional:            true,
			},
			"enable_traps_aaa_server": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP AAA Server traps").String,
				Optional:            true,
			},
			"enable_traps_vdsl2line": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable VDSL2 Line-MIB traps").String,
				Optional:            true,
			},
			"enable_traps_adslline": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable ADSL Line-MIB traps").String,
				Optional:            true,
			},
			"enable_traps_pki": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP PKI Traps").String,
				Optional:            true,
			},
			"enable_traps_alarm_type": schema.StringAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_casa": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP casa traps").String,
				Optional:            true,
			},
			"enable_traps_cnpd": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable NBAR Protocol Discovery traps").String,
				Optional:            true,
			},
			"enable_traps_dial": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP dial control traps").String,
				Optional:            true,
			},
			"enable_traps_dlsw": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP dlsw traps").String,
				Optional:            true,
			},
			"enable_traps_ds1": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP DS1 traps").String,
				Optional:            true,
			},
			"enable_traps_dsp_card_status": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP card status of dsp traps").String,
				Optional:            true,
			},
			"enable_traps_dsp_oper_state": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_entity_sensor": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP entity-sensor traps").String,
				Optional:            true,
			},
			"enable_traps_entity_state": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Allow SNMP entity-state traps").String,
				Optional:            true,
			},
			"enable_traps_entity_qfp_mem_res_thresh": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP ENTITY-QFP MEM-RES-THRESH notifications").String,
				Optional:            true,
			},
			"enable_traps_entity_qfp_throughput_notif": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP ENTITY-QFP THROUGHPUT-NOTIF notifications").String,
				Optional:            true,
			},
			"enable_traps_ether_oam": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_ethernet_cfm_alarm": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP Ethernet CFM fault alarm trap").String,
				Optional:            true,
			},
			"enable_traps_ethernet_cfm_cc_config": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_ethernet_cfm_cc_cross_connect": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_ethernet_cfm_cc_loop": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_ethernet_cfm_cc_mep_down": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_ethernet_cfm_cc_mep_up": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_ethernet_cfm_crosscheck_mep_missing": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_ethernet_cfm_crosscheck_mep_unknown": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_ethernet_cfm_crosscheck_service_up": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_ethernet_evc_create": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP Ethernet EVC create traps").String,
				Optional:            true,
			},
			"enable_traps_ethernet_evc_delete": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP Ethernet EVC delete traps").String,
				Optional:            true,
			},
			"enable_traps_ethernet_evc_status": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP Ethernet EVC status traps").String,
				Optional:            true,
			},
			"enable_traps_firewall_serverstatus": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_frame_relay_config_only": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_frame_relay_config_subif_configs": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_frame_relay_subif_count": schema.Int64Attribute{
				MarkdownDescription: helpers.NewAttributeDescription("Maximum number of traps sent per interval").AddIntegerRangeDescription(1, 1000).String,
				Optional:            true,
				Validators: []validator.Int64{
					int64validator.Between(1, 1000),
				},
			},
			"enable_traps_frame_relay_subif_interval": schema.Int64Attribute{
				MarkdownDescription: helpers.NewAttributeDescription("Interval duration in which to limit the number of traps sent").AddIntegerRangeDescription(1, 3600).String,
				Optional:            true,
				Validators: []validator.Int64{
					int64validator.Between(1, 3600),
				},
			},
			"enable_traps_frame_relay_config_bundle_mismatch": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable MFR trap for inconsistent bundle event").String,
				Optional:            true,
			},
			"enable_traps_frame_relay_multilink_bundle_mismatch": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable MFR trap for inconsistent bundle event").String,
				Optional:            true,
			},
			"enable_traps_ip_local_pool": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP IP LOCAL POOL traps").String,
				Optional:            true,
			},
			"enable_traps_isdn_call_information": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP isdn call information traps").String,
				Optional:            true,
			},
			"enable_traps_isdn_chan_not_avail": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP isdn channel not avail traps").String,
				Optional:            true,
			},
			"enable_traps_isdn_ietf": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP isdn ietf traps").String,
				Optional:            true,
			},
			"enable_traps_isdn_layer2": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP isdn layer2 transition traps").String,
				Optional:            true,
			},
			"enable_traps_l2tun_session": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP l2tun session traps").String,
				Optional:            true,
			},
			"enable_traps_l2tun_tunnel": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP l2tun tunnel traps").String,
				Optional:            true,
			},
			"enable_traps_l2tun_pseudowire_status": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_pimstdmib_neighbor_loss": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable neighbor-loss traps").String,
				Optional:            true,
			},
			"enable_traps_pimstdmib_invalid_register": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable invalid-register traps").String,
				Optional:            true,
			},
			"enable_traps_pimstdmib_invalid_join_prune": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable invalid-join-prune traps").String,
				Optional:            true,
			},
			"enable_traps_pimstdmib_rp_mapping_change": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable invalid rp-mapping-change").String,
				Optional:            true,
			},
			"enable_traps_pimstdmib_interface_election": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable interface-election traps").String,
				Optional:            true,
			},
			"enable_traps_pfr": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Allow SNMP PFR traps").String,
				Optional:            true,
			},
			"enable_traps_pppoe": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP pppoe traps").String,
				Optional:            true,
			},
			"enable_traps_resource_policy": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"enable_traps_rsvp": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable RSVP flow change traps").String,
				Optional:            true,
			},
			"enable_traps_vrrp": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP vrrp traps").String,
				Optional:            true,
			},
			"enable_traps_sonet": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP SONET traps").String,
				Optional:            true,
			},
			"enable_traps_srp": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SRP protocol traps").String,
				Optional:            true,
			},
			"enable_traps_voice": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP voice traps").String,
				Optional:            true,
			},
			"enable_traps_bgp": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Allow BGP state change traps (OBSOLETE)").String,
				Optional:            true,
			},
			"enable_traps_cbgp2": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable BGP MIBv2 traps (OBSOLETE - please use snmp configuration in Cisco-IOS-XE-bgp.yang)").String,
				Optional:            true,
			},
			"enable_traps_ospfv3_errors": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Error traps").String,
				Optional:            true,
			},
			"enable_traps_ospfv3_state_change": schema.BoolAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("State change traps").String,
				Optional:            true,
			},
			"source_interface_informs_gigabit_ethernet": schema.StringAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("GigabitEthernet IEEE 802.3z").String,
				Optional:            true,
			},
			"source_interface_informs_ten_gigabit_ethernet": schema.StringAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Ten Gigabit Ethernet").String,
				Optional:            true,
			},
			"source_interface_informs_forty_gigabit_ethernet": schema.StringAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Forty GigabitEthernet ").String,
				Optional:            true,
			},
			"source_interface_informs_hundred_gig_e": schema.StringAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Hundred GigabitEthernet").String,
				Optional:            true,
			},
			"source_interface_informs_loopback": schema.Int64Attribute{
				MarkdownDescription: helpers.NewAttributeDescription("Loopback interface").AddIntegerRangeDescription(0, 2147483647).String,
				Optional:            true,
				Validators: []validator.Int64{
					int64validator.Between(0, 2147483647),
				},
			},
			"source_interface_informs_port_channel": schema.Int64Attribute{
				MarkdownDescription: helpers.NewAttributeDescription("Ethernet Channel of interfaces").AddIntegerRangeDescription(0, 4294967295).String,
				Optional:            true,
				Validators: []validator.Int64{
					int64validator.Between(0, 4294967295),
				},
			},
			"source_interface_informs_port_channel_subinterface": schema.StringAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"source_interface_informs_vlan": schema.Int64Attribute{
				MarkdownDescription: helpers.NewAttributeDescription("Iosxr Vlans").AddIntegerRangeDescription(0, 65535).String,
				Optional:            true,
				Validators: []validator.Int64{
					int64validator.Between(0, 65535),
				},
			},
			"source_interface_traps_gigabit_ethernet": schema.StringAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("GigabitEthernet IEEE 802.3z").String,
				Optional:            true,
			},
			"source_interface_traps_ten_gigabit_ethernet": schema.StringAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Ten Gigabit Ethernet").String,
				Optional:            true,
			},
			"source_interface_traps_forty_gigabit_ethernet": schema.StringAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Forty GigabitEthernet ").String,
				Optional:            true,
			},
			"source_interface_traps_hundred_gig_e": schema.StringAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Hundred GigabitEthernet").String,
				Optional:            true,
			},
			"source_interface_traps_loopback": schema.Int64Attribute{
				MarkdownDescription: helpers.NewAttributeDescription("Loopback interface").AddIntegerRangeDescription(0, 2147483647).String,
				Optional:            true,
				Validators: []validator.Int64{
					int64validator.Between(0, 2147483647),
				},
			},
			"source_interface_traps_port_channel": schema.Int64Attribute{
				MarkdownDescription: helpers.NewAttributeDescription("Ethernet Channel of interfaces").AddIntegerRangeDescription(0, 4294967295).String,
				Optional:            true,
				Validators: []validator.Int64{
					int64validator.Between(0, 4294967295),
				},
			},
			"source_interface_traps_port_channel_subinterface": schema.StringAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"source_interface_traps_vlan": schema.Int64Attribute{
				MarkdownDescription: helpers.NewAttributeDescription("Iosxr Vlans").AddIntegerRangeDescription(0, 65535).String,
				Optional:            true,
				Validators: []validator.Int64{
					int64validator.Between(0, 65535),
				},
			},
			"trap_source_gigabit_ethernet": schema.StringAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("GigabitEthernet IEEE 802.3z").String,
				Optional:            true,
			},
			"trap_source_ten_gigabit_ethernet": schema.StringAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Ten Gigabit Ethernet").String,
				Optional:            true,
			},
			"trap_source_forty_gigabit_ethernet": schema.StringAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Forty GigabitEthernet ").String,
				Optional:            true,
			},
			"trap_source_hundred_gig_e": schema.StringAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Hundred GigabitEthernet").String,
				Optional:            true,
			},
			"trap_source_loopback": schema.Int64Attribute{
				MarkdownDescription: helpers.NewAttributeDescription("Loopback interface").AddIntegerRangeDescription(0, 2147483647).String,
				Optional:            true,
				Validators: []validator.Int64{
					int64validator.Between(0, 2147483647),
				},
			},
			"trap_source_port_channel": schema.Int64Attribute{
				MarkdownDescription: helpers.NewAttributeDescription("Ethernet Channel of interfaces").AddIntegerRangeDescription(0, 4294967295).String,
				Optional:            true,
				Validators: []validator.Int64{
					int64validator.Between(0, 4294967295),
				},
			},
			"trap_source_port_channel_subinterface": schema.StringAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
			},
			"trap_source_vlan": schema.Int64Attribute{
				MarkdownDescription: helpers.NewAttributeDescription("Iosxr Vlans").AddIntegerRangeDescription(0, 65535).String,
				Optional:            true,
				Validators: []validator.Int64{
					int64validator.Between(0, 65535),
				},
			},
			"snmp_communities": schema.ListNestedAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Enable SNMP; set community string and access privs").String,
				Optional:            true,
				NestedObject: schema.NestedAttributeObject{
					Attributes: map[string]schema.Attribute{
						"name": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("").String,
							Required:            true,
							Sensitive:           true,
						},
						"view": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("Restrict this community to a named MIB view").String,
							Optional:            true,
							Validators: []validator.String{
								stringvalidator.LengthBetween(1, 214),
							},
						},
						"permission": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("ro", "rw").String,
							Optional:            true,
							Validators: []validator.String{
								stringvalidator.OneOf("ro", "rw"),
							},
						},
						"ipv6": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("Specify IPv6 Named Access-List").String,
							Optional:            true,
							Validators: []validator.String{
								stringvalidator.LengthBetween(1, 219),
							},
						},
						"access_list_name": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("Access-list name").String,
							Optional:            true,
						},
					},
				},
			},
			"contexts": schema.ListNestedAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Create/Delete a context apart from default").String,
				Optional:            true,
				NestedObject: schema.NestedAttributeObject{
					Attributes: map[string]schema.Attribute{
						"name": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("").String,
							Required:            true,
						},
					},
				},
			},
			"views": schema.ListNestedAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Define an SNMPv2 MIB view").String,
				Optional:            true,
				NestedObject: schema.NestedAttributeObject{
					Attributes: map[string]schema.Attribute{
						"name": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("").String,
							Required:            true,
						},
						"mib": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("").String,
							Required:            true,
						},
						"inc_exl": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("excluded", "included").String,
							Optional:            true,
							Validators: []validator.String{
								stringvalidator.OneOf("excluded", "included"),
							},
						},
					},
				},
			},
			"groups": schema.ListNestedAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("Define a User Security Model group").String,
				Optional:            true,
				NestedObject: schema.NestedAttributeObject{
					Attributes: map[string]schema.Attribute{
						"name": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("").String,
							Required:            true,
						},
						"v3_security": schema.ListNestedAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("DEPRECATED group using security Level").String,
							Optional:            true,
							NestedObject: schema.NestedAttributeObject{
								Attributes: map[string]schema.Attribute{
									"security_level": schema.StringAttribute{
										MarkdownDescription: helpers.NewAttributeDescription("DEPRECATED security level type").AddStringEnumDescription("auth", "noauth", "priv").String,
										Required:            true,
										Validators: []validator.String{
											stringvalidator.OneOf("auth", "noauth", "priv"),
										},
									},
									"context_node": schema.StringAttribute{
										MarkdownDescription: helpers.NewAttributeDescription("DEPRECATED specify a context to associate these views for the group").String,
										Optional:            true,
									},
									"match_node": schema.StringAttribute{
										MarkdownDescription: helpers.NewAttributeDescription("DEPRECATED context name match criteria").AddStringEnumDescription("exact", "prefix").String,
										Optional:            true,
										Validators: []validator.String{
											stringvalidator.OneOf("exact", "prefix"),
										},
									},
									"read_node": schema.StringAttribute{
										MarkdownDescription: helpers.NewAttributeDescription("DEPRECATED specify a read view for the group").String,
										Optional:            true,
									},
									"write_node": schema.StringAttribute{
										MarkdownDescription: helpers.NewAttributeDescription("DEPRECATED specify a write view for the group").String,
										Optional:            true,
									},
									"notify_node": schema.StringAttribute{
										MarkdownDescription: helpers.NewAttributeDescription("DEPRECATED specify a notify view for the group").String,
										Optional:            true,
									},
									"access_ipv6_acl": schema.StringAttribute{
										MarkdownDescription: helpers.NewAttributeDescription("Specify IPv6 Named Access-List").String,
										Optional:            true,
										Validators: []validator.String{
											stringvalidator.LengthBetween(1, 194),
										},
									},
									"access_standard_acl": schema.Int64Attribute{
										MarkdownDescription: helpers.NewAttributeDescription("Standard IP Access-list allowing access with this community string").AddIntegerRangeDescription(1, 99).String,
										Optional:            true,
										Validators: []validator.Int64{
											int64validator.Between(1, 99),
										},
									},
									"access_acl_name": schema.StringAttribute{
										MarkdownDescription: helpers.NewAttributeDescription("Access-list name").String,
										Optional:            true,
										Validators: []validator.String{
											stringvalidator.LengthBetween(1, 183),
										},
									},
								},
							},
						},
					},
				},
			},
			"users": schema.ListNestedAttribute{
				MarkdownDescription: helpers.NewAttributeDescription("").String,
				Optional:            true,
				NestedObject: schema.NestedAttributeObject{
					Attributes: map[string]schema.Attribute{
						"username": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("Name of the user").String,
							Required:            true,
						},
						"grpname": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("Group to which the user belongs").String,
							Required:            true,
						},
						"v3_auth_algorithm": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("Use HMAC SHA/MD5 algorithm for authentication").AddStringEnumDescription("md5", "sha").String,
							Optional:            true,
							Validators: []validator.String{
								stringvalidator.OneOf("md5", "sha"),
							},
						},
						"v3_auth_password": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("Authentication password for user").String,
							Required:            true,
							Sensitive:           true,
						},
						"v3_auth_priv_aes_algorithm": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("128", "192", "256").String,
							Optional:            true,
							Validators: []validator.String{
								stringvalidator.OneOf("128", "192", "256"),
							},
						},
						"v3_auth_priv_aes_password": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("Authentication password for user").String,
							Optional:            true,
							Sensitive:           true,
						},
						"v3_auth_priv_aes_access_ipv6_acl": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("Specify IPv6 Named Access-List").String,
							Optional:            true,
							Validators: []validator.String{
								stringvalidator.LengthBetween(1, 194),
							},
						},
						"v3_auth_priv_aes_access_standard_acl": schema.Int64Attribute{
							MarkdownDescription: helpers.NewAttributeDescription("Standard IP Access-list allowing access with this community string").AddIntegerRangeDescription(1, 99).String,
							Optional:            true,
							Validators: []validator.Int64{
								int64validator.Between(1, 99),
							},
						},
						"v3_auth_priv_aes_access_acl_name": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("Access-list name").String,
							Optional:            true,
							Validators: []validator.String{
								stringvalidator.LengthBetween(1, 183),
							},
						},
						"v3_auth_priv_des_password": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("Authentication password for user").String,
							Optional:            true,
							Sensitive:           true,
						},
						"v3_auth_priv_des_access_ipv6_acl": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("Specify IPv6 Named Access-List").String,
							Optional:            true,
							Validators: []validator.String{
								stringvalidator.LengthBetween(1, 194),
							},
						},
						"v3_auth_priv_des_access_standard_acl": schema.Int64Attribute{
							MarkdownDescription: helpers.NewAttributeDescription("Standard IP Access-list allowing access with this community string").AddIntegerRangeDescription(1, 99).String,
							Optional:            true,
							Validators: []validator.Int64{
								int64validator.Between(1, 99),
							},
						},
						"v3_auth_priv_des_access_acl_name": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("Access-list name").String,
							Optional:            true,
							Validators: []validator.String{
								stringvalidator.LengthBetween(1, 183),
							},
						},
						"v3_auth_priv_des3_password": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("Authentication password for user").String,
							Optional:            true,
							Sensitive:           true,
						},
						"v3_auth_priv_des3_access_ipv6_acl": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("Specify IPv6 Named Access-List").String,
							Optional:            true,
							Validators: []validator.String{
								stringvalidator.LengthBetween(1, 194),
							},
						},
						"v3_auth_priv_des3_access_standard_acl": schema.Int64Attribute{
							MarkdownDescription: helpers.NewAttributeDescription("Standard IP Access-list allowing access with this community string").AddIntegerRangeDescription(1, 99).String,
							Optional:            true,
							Validators: []validator.Int64{
								int64validator.Between(1, 99),
							},
						},
						"v3_auth_priv_des3_access_acl_name": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("Access-list name").String,
							Optional:            true,
							Validators: []validator.String{
								stringvalidator.LengthBetween(1, 183),
							},
						},
						"v3_auth_access_ipv6_acl": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("Specify IPv6 Named Access-List").String,
							Optional:            true,
							Validators: []validator.String{
								stringvalidator.LengthBetween(1, 194),
							},
						},
						"v3_auth_access_standard_acl": schema.Int64Attribute{
							MarkdownDescription: helpers.NewAttributeDescription("Standard IP Access-list allowing access with this community string").AddIntegerRangeDescription(1, 99).String,
							Optional:            true,
							Validators: []validator.Int64{
								int64validator.Between(1, 99),
							},
						},
						"v3_auth_access_acl_name": schema.StringAttribute{
							MarkdownDescription: helpers.NewAttributeDescription("Access-list name").String,
							Optional:            true,
							Validators: []validator.String{
								stringvalidator.LengthBetween(1, 183),
							},
						},
					},
				},
			},
		},
	}
}

func (r *SNMPServerResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) {
	if req.ProviderData == nil {
		return
	}

	r.data = req.ProviderData.(*IosxeProviderData)
}

// End of section. //template:end model

// Section below is generated&owned by "gen/generator.go". //template:begin create

func (r *SNMPServerResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
	var plan SNMPServer

	// Read plan
	diags := req.Plan.Get(ctx, &plan)
	resp.Diagnostics.Append(diags...)
	if resp.Diagnostics.HasError() {
		return
	}

	tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.getPath()))

	device, ok := r.data.Devices[plan.Device.ValueString()]
	if !ok {
		resp.Diagnostics.AddAttributeError(path.Root("device"), "Invalid device", fmt.Sprintf("Device '%s' does not exist in provider configuration.", plan.Device.ValueString()))
		return
	}

	if device.Managed {
		// Create object
		body := plan.toBody(ctx)

		emptyLeafsDelete := plan.getEmptyLeafsDelete(ctx)
		tflog.Debug(ctx, fmt.Sprintf("List of empty leafs to delete: %+v", emptyLeafsDelete))

		if YangPatch {
			edits := []restconf.YangPatchEdit{restconf.NewYangPatchEdit("merge", plan.getPath(), restconf.Body{Str: body})}
			for _, i := range emptyLeafsDelete {
				edits = append(edits, restconf.NewYangPatchEdit("remove", i, restconf.Body{}))
			}
			_, err := device.Client.YangPatchData("", "1", "", edits)
			if err != nil {
				resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to configure object, got error: %s", err))
				return
			}
		} else {
			res, err := device.Client.PatchData(plan.getPathShort(), body)
			if len(res.Errors.Error) > 0 && res.Errors.Error[0].ErrorMessage == "patch to a nonexistent resource" {
				_, err = device.Client.PutData(plan.getPath(), body)
			}
			if err != nil {
				resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to configure object (PATCH, %s), got error: %s", plan.getPathShort(), err))
				return
			}
			for _, i := range emptyLeafsDelete {
				res, err := device.Client.DeleteData(i)
				if err != nil && res.StatusCode != 404 {
					resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object (%s), got error: %s", i, err))
					return
				}
			}
		}
	}

	plan.Id = types.StringValue(plan.getPath())

	tflog.Debug(ctx, fmt.Sprintf("%s: Create finished successfully", plan.getPath()))

	diags = resp.State.Set(ctx, &plan)
	resp.Diagnostics.Append(diags...)

	helpers.SetFlagImporting(ctx, false, resp.Private, &resp.Diagnostics)
}

// End of section. //template:end create

// Section below is generated&owned by "gen/generator.go". //template:begin read

func (r *SNMPServerResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
	var state SNMPServer

	// Read state
	diags := req.State.Get(ctx, &state)
	resp.Diagnostics.Append(diags...)
	if resp.Diagnostics.HasError() {
		return
	}

	tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Id.ValueString()))

	device, ok := r.data.Devices[state.Device.ValueString()]
	if !ok {
		resp.Diagnostics.AddAttributeError(path.Root("device"), "Invalid device", fmt.Sprintf("Device '%s' does not exist in provider configuration.", state.Device.ValueString()))
		return
	}

	if device.Managed {
		res, err := device.Client.GetData(state.Id.ValueString())
		if res.StatusCode == 404 {
			state = SNMPServer{Device: state.Device, Id: state.Id}
		} else {
			if err != nil {
				resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to retrieve object (%s), got error: %s", state.Id.ValueString(), err))
				return
			}

			imp, diags := helpers.IsFlagImporting(ctx, req)
			if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() {
				return
			}

			// After `terraform import` we switch to a full read.
			if imp {
				state.fromBody(ctx, res.Res)
			} else {
				state.updateFromBody(ctx, res.Res)
			}
		}
	}

	tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString()))

	diags = resp.State.Set(ctx, &state)
	resp.Diagnostics.Append(diags...)

	helpers.SetFlagImporting(ctx, false, resp.Private, &resp.Diagnostics)
}

// End of section. //template:end read

// Section below is generated&owned by "gen/generator.go". //template:begin update

func (r *SNMPServerResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
	var plan, state SNMPServer

	// Read plan
	diags := req.Plan.Get(ctx, &plan)
	resp.Diagnostics.Append(diags...)
	if resp.Diagnostics.HasError() {
		return
	}

	// Read state
	diags = req.State.Get(ctx, &state)
	resp.Diagnostics.Append(diags...)
	if resp.Diagnostics.HasError() {
		return
	}

	tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.Id.ValueString()))

	device, ok := r.data.Devices[plan.Device.ValueString()]
	if !ok {
		resp.Diagnostics.AddAttributeError(path.Root("device"), "Invalid device", fmt.Sprintf("Device '%s' does not exist in provider configuration.", plan.Device.ValueString()))
		return
	}

	if device.Managed {
		body := plan.toBody(ctx)

		deletedItems := plan.getDeletedItems(ctx, state)
		tflog.Debug(ctx, fmt.Sprintf("Removed items to delete: %+v", deletedItems))

		emptyLeafsDelete := plan.getEmptyLeafsDelete(ctx)
		tflog.Debug(ctx, fmt.Sprintf("List of empty leafs to delete: %+v", emptyLeafsDelete))

		if YangPatch {
			var edits []restconf.YangPatchEdit
			for _, i := range deletedItems {
				edits = append(edits, restconf.NewYangPatchEdit("remove", i, restconf.Body{}))
			}
			edits = append(edits, restconf.NewYangPatchEdit("merge", plan.getPath(), restconf.Body{Str: body}))
			for _, i := range emptyLeafsDelete {
				edits = append(edits, restconf.NewYangPatchEdit("remove", i, restconf.Body{}))
			}
			_, err := device.Client.YangPatchData("", "1", "", edits)
			if err != nil {
				resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to update object, got error: %s", err))
				return
			}
		} else {
			for _, i := range deletedItems {
				res, err := device.Client.DeleteData(i)
				if err != nil && res.StatusCode != 404 {
					resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object (%s), got error: %s", i, err))
					return
				}
			}
			res, err := device.Client.PatchData(plan.getPathShort(), body)
			if len(res.Errors.Error) > 0 && res.Errors.Error[0].ErrorMessage == "patch to a nonexistent resource" {
				_, err = device.Client.PutData(plan.getPath(), body)
			}
			if err != nil {
				resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to configure object (PATCH, %s), got error: %s", plan.getPathShort(), err))
				return
			}
			for _, i := range emptyLeafsDelete {
				res, err := device.Client.DeleteData(i)
				if err != nil && res.StatusCode != 404 {
					resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object (%s), got error: %s", i, err))
					return
				}
			}
		}
	}

	tflog.Debug(ctx, fmt.Sprintf("%s: Update finished successfully", plan.Id.ValueString()))

	diags = resp.State.Set(ctx, &plan)
	resp.Diagnostics.Append(diags...)
}

// End of section. //template:end update

// Section below is generated&owned by "gen/generator.go". //template:begin delete

func (r *SNMPServerResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
	var state SNMPServer

	// Read state
	diags := req.State.Get(ctx, &state)
	resp.Diagnostics.Append(diags...)
	if resp.Diagnostics.HasError() {
		return
	}

	tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Delete", state.Id.ValueString()))

	device, ok := r.data.Devices[state.Device.ValueString()]
	if !ok {
		resp.Diagnostics.AddAttributeError(path.Root("device"), "Invalid device", fmt.Sprintf("Device '%s' does not exist in provider configuration.", state.Device.ValueString()))
		return
	}

	if device.Managed {
		deleteMode := "all"
		if state.DeleteMode.ValueString() == "all" {
			deleteMode = "all"
		} else if state.DeleteMode.ValueString() == "attributes" {
			deleteMode = "attributes"
		}

		if deleteMode == "all" {
			res, err := device.Client.DeleteData(state.Id.ValueString())
			if err != nil && res.StatusCode != 404 && res.StatusCode != 400 {
				resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object (%s), got error: %s", state.Id.ValueString(), err))
				return
			}
		} else {
			deletePaths := state.getDeletePaths(ctx)
			tflog.Debug(ctx, fmt.Sprintf("Paths to delete: %+v", deletePaths))

			if YangPatch {
				edits := []restconf.YangPatchEdit{}
				for _, i := range deletePaths {
					edits = append(edits, restconf.NewYangPatchEdit("remove", i, restconf.Body{}))
				}
				_, err := device.Client.YangPatchData("", "1", "", edits)
				if err != nil {
					resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object, got error: %s", err))
					return
				}
			} else {
				for _, i := range deletePaths {
					res, err := device.Client.DeleteData(i)
					if err != nil && res.StatusCode != 404 {
						resp.Diagnostics.AddWarning("Client Warning", fmt.Sprintf("Failed to delete object (%s), got error: %s", i, err))
					}
				}
			}
		}
	}

	tflog.Debug(ctx, fmt.Sprintf("%s: Delete finished successfully", state.Id.ValueString()))

	resp.State.RemoveResource(ctx)
}

// End of section. //template:end delete

// Section below is generated&owned by "gen/generator.go". //template:begin import

func (r *SNMPServerResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) {
	idParts := strings.Split(req.ID, ",")
	idParts = helpers.RemoveEmptyStrings(idParts)

	if len(idParts) != 0 && len(idParts) != 1 {
		expectedIdentifier := "Expected import identifier with format: ''"
		expectedIdentifier += " or '<device>'"
		resp.Diagnostics.AddError(
			"Unexpected Import Identifier",
			fmt.Sprintf("%s. Got: %q", expectedIdentifier, req.ID),
		)
		return
	}
	if len(idParts) == 1 {
		resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("device"), idParts[len(idParts)-1])...)
	}

	// construct path for 'id' attribute
	var state SNMPServer
	resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), state.getPath())...)

	helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics)
}

// End of section. //template:end import
