diff --git a/internal/provider/data_source_nxos_feature_ngmvpn.go b/internal/provider/data_source_nxos_feature_ngmvpn.go index 73a52526..e6338806 100644 --- a/internal/provider/data_source_nxos_feature_ngmvpn.go +++ b/internal/provider/data_source_nxos_feature_ngmvpn.go @@ -33,23 +33,23 @@ import ( // Ensure the implementation satisfies the expected interfaces. var ( - _ datasource.DataSource = &FeatureNgMvpnDataSource{} - _ datasource.DataSourceWithConfigure = &FeatureNgMvpnDataSource{} + _ datasource.DataSource = &FeatureNgMVPNDataSource{} + _ datasource.DataSourceWithConfigure = &FeatureNgMVPNDataSource{} ) -func NewFeatureNgMvpnDataSource() datasource.DataSource { - return &FeatureNgMvpnDataSource{} +func NewFeatureNgMVPNDataSource() datasource.DataSource { + return &FeatureNgMVPNDataSource{} } -type FeatureNgMvpnDataSource struct { +type FeatureNgMVPNDataSource struct { clients map[string]*nxos.Client } -func (d *FeatureNgMvpnDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { +func (d *FeatureNgMVPNDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { resp.TypeName = req.ProviderTypeName + "_feature_ngmvpn" } -func (d *FeatureNgMvpnDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { +func (d *FeatureNgMVPNDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. MarkdownDescription: helpers.NewResourceDescription("This data source can read the Next Generation Multicast VPN Feature.", "fmNgmvpn", "Feature%20Management/fm:NgMvpn/").String, @@ -71,7 +71,7 @@ func (d *FeatureNgMvpnDataSource) Schema(ctx context.Context, req datasource.Sch } } -func (d *FeatureNgMvpnDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { +func (d *FeatureNgMVPNDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -79,8 +79,8 @@ func (d *FeatureNgMvpnDataSource) Configure(_ context.Context, req datasource.Co d.clients = req.ProviderData.(map[string]*nxos.Client) } -func (d *FeatureNgMvpnDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { - var config FeatureNgMvpn +func (d *FeatureNgMVPNDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var config FeatureNgMVPN // Read config diags := req.Config.Get(ctx, &config) diff --git a/internal/provider/data_source_nxos_feature_ngmvpn_test.go b/internal/provider/data_source_nxos_feature_ngmvpn_test.go index 1e3f47be..55022fd1 100644 --- a/internal/provider/data_source_nxos_feature_ngmvpn_test.go +++ b/internal/provider/data_source_nxos_feature_ngmvpn_test.go @@ -25,13 +25,13 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) -func TestAccDataSourceNxosFeatureNgMvpn(t *testing.T) { +func TestAccDataSourceNxosFeatureNgMVPN(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccDataSourceNxosFeatureNgMvpnConfig, + Config: testAccDataSourceNxosFeatureNgMVPNConfig, Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("data.nxos_feature_ngmvpn.test", "admin_state", "enabled"), ), @@ -40,7 +40,7 @@ func TestAccDataSourceNxosFeatureNgMvpn(t *testing.T) { }) } -const testAccDataSourceNxosFeatureNgMvpnConfig = ` +const testAccDataSourceNxosFeatureNgMVPNConfig = ` resource "nxos_feature_ngmvpn" "test" { admin_state = "enabled" diff --git a/internal/provider/model_nxos_feature_ngmvpn.go b/internal/provider/model_nxos_feature_ngmvpn.go index 0f8c72d9..47feefec 100644 --- a/internal/provider/model_nxos_feature_ngmvpn.go +++ b/internal/provider/model_nxos_feature_ngmvpn.go @@ -26,21 +26,21 @@ import ( "github.com/tidwall/sjson" ) -type FeatureNgMvpn struct { +type FeatureNgMVPN struct { Device types.String `tfsdk:"device"` Dn types.String `tfsdk:"id"` AdminState types.String `tfsdk:"admin_state"` } -func (data FeatureNgMvpn) getDn() string { +func (data FeatureNgMVPN) getDn() string { return "sys/fm/ngmvpn" } -func (data FeatureNgMvpn) getClassName() string { +func (data FeatureNgMVPN) getClassName() string { return "fmNgmvpn" } -func (data FeatureNgMvpn) toBody() nxos.Body { +func (data FeatureNgMVPN) toBody() nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes", map[string]interface{}{}) if (!data.AdminState.IsUnknown() && !data.AdminState.IsNull()) || true { @@ -50,7 +50,7 @@ func (data FeatureNgMvpn) toBody() nxos.Body { return nxos.Body{body} } -func (data *FeatureNgMvpn) fromBody(res gjson.Result, all bool) { +func (data *FeatureNgMVPN) fromBody(res gjson.Result, all bool) { if !data.AdminState.IsNull() || all { data.AdminState = types.StringValue(res.Get(data.getClassName() + ".attributes.adminSt").String()) } else { @@ -58,7 +58,7 @@ func (data *FeatureNgMvpn) fromBody(res gjson.Result, all bool) { } } -func (data FeatureNgMvpn) toDeleteBody() nxos.Body { +func (data FeatureNgMVPN) toDeleteBody() nxos.Body { body := "" body, _ = sjson.Set(body, data.getClassName()+".attributes."+"adminSt", "disabled") diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 2b7d8897..3fd8c84d 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -316,7 +316,7 @@ func (p *NxosProvider) Resources(ctx context.Context) []func() resource.Resource NewFeatureLLDPResource, NewFeatureMACsecResource, NewFeatureNetflowResource, - NewFeatureNgMvpnResource, + NewFeatureNgMVPNResource, NewFeatureNVOverlayResource, NewFeatureOSPFResource, NewFeatureOSPFv3Resource, @@ -454,7 +454,7 @@ func (p *NxosProvider) DataSources(ctx context.Context) []func() datasource.Data NewFeatureLLDPDataSource, NewFeatureMACsecDataSource, NewFeatureNetflowDataSource, - NewFeatureNgMvpnDataSource, + NewFeatureNgMVPNDataSource, NewFeatureNVOverlayDataSource, NewFeatureOSPFDataSource, NewFeatureOSPFv3DataSource, diff --git a/internal/provider/resource_nxos_feature_ngmvpn.go b/internal/provider/resource_nxos_feature_ngmvpn.go index 5aa49650..386691df 100644 --- a/internal/provider/resource_nxos_feature_ngmvpn.go +++ b/internal/provider/resource_nxos_feature_ngmvpn.go @@ -37,22 +37,22 @@ import ( ) // Ensure provider defined types fully satisfy framework interfaces -var _ resource.Resource = &FeatureNgMvpnResource{} -var _ resource.ResourceWithImportState = &FeatureNgMvpnResource{} +var _ resource.Resource = &FeatureNgMVPNResource{} +var _ resource.ResourceWithImportState = &FeatureNgMVPNResource{} -func NewFeatureNgMvpnResource() resource.Resource { - return &FeatureNgMvpnResource{} +func NewFeatureNgMVPNResource() resource.Resource { + return &FeatureNgMVPNResource{} } -type FeatureNgMvpnResource struct { +type FeatureNgMVPNResource struct { clients map[string]*nxos.Client } -func (r *FeatureNgMvpnResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { +func (r *FeatureNgMVPNResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { resp.TypeName = req.ProviderTypeName + "_feature_ngmvpn" } -func (r *FeatureNgMvpnResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { +func (r *FeatureNgMVPNResource) 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: helpers.NewResourceDescription("This resource can manage the Next Generation Multicast VPN Feature.", "fmNgmvpn", "Feature%20Management/fm:NgMvpn/").String, @@ -80,7 +80,7 @@ func (r *FeatureNgMvpnResource) Schema(ctx context.Context, req resource.SchemaR } } -func (r *FeatureNgMvpnResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { +func (r *FeatureNgMVPNResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { // Prevent panic if the provider has not been configured. if req.ProviderData == nil { return @@ -89,8 +89,8 @@ func (r *FeatureNgMvpnResource) Configure(ctx context.Context, req resource.Conf r.clients = req.ProviderData.(map[string]*nxos.Client) } -func (r *FeatureNgMvpnResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - var plan FeatureNgMvpn +func (r *FeatureNgMVPNResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan FeatureNgMVPN // Read plan diags := req.Plan.Get(ctx, &plan) @@ -119,8 +119,8 @@ func (r *FeatureNgMvpnResource) Create(ctx context.Context, req resource.CreateR helpers.SetFlagImporting(ctx, false, resp.Private, &resp.Diagnostics) } -func (r *FeatureNgMvpnResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - var state FeatureNgMvpn +func (r *FeatureNgMVPNResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state FeatureNgMVPN // Read state diags := req.State.Get(ctx, &state) @@ -152,8 +152,8 @@ func (r *FeatureNgMvpnResource) Read(ctx context.Context, req resource.ReadReque helpers.SetFlagImporting(ctx, false, resp.Private, &resp.Diagnostics) } -func (r *FeatureNgMvpnResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - var plan FeatureNgMvpn +func (r *FeatureNgMVPNResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan FeatureNgMVPN // Read plan diags := req.Plan.Get(ctx, &plan) @@ -177,8 +177,8 @@ func (r *FeatureNgMvpnResource) Update(ctx context.Context, req resource.UpdateR resp.Diagnostics.Append(diags...) } -func (r *FeatureNgMvpnResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - var state FeatureNgMvpn +func (r *FeatureNgMVPNResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state FeatureNgMVPN // Read state diags := req.State.Get(ctx, &state) @@ -214,7 +214,7 @@ func (r *FeatureNgMvpnResource) Delete(ctx context.Context, req resource.DeleteR resp.State.RemoveResource(ctx) } -func (r *FeatureNgMvpnResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { +func (r *FeatureNgMVPNResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) diff --git a/internal/provider/resource_nxos_feature_ngmvpn_test.go b/internal/provider/resource_nxos_feature_ngmvpn_test.go index 9dccce9b..14ea6e2f 100644 --- a/internal/provider/resource_nxos_feature_ngmvpn_test.go +++ b/internal/provider/resource_nxos_feature_ngmvpn_test.go @@ -25,13 +25,13 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) -func TestAccNxosFeatureNgMvpn(t *testing.T) { +func TestAccNxosFeatureNgMVPN(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccNxosFeatureNgMvpnConfig_all(), + Config: testAccNxosFeatureNgMVPNConfig_all(), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("nxos_feature_ngmvpn.test", "admin_state", "enabled"), ), @@ -45,7 +45,7 @@ func TestAccNxosFeatureNgMvpn(t *testing.T) { }) } -func testAccNxosFeatureNgMvpnConfig_minimum() string { +func testAccNxosFeatureNgMVPNConfig_minimum() string { return ` resource "nxos_feature_ngmvpn" "test" { admin_state = "enabled" @@ -53,7 +53,7 @@ func testAccNxosFeatureNgMvpnConfig_minimum() string { ` } -func testAccNxosFeatureNgMvpnConfig_all() string { +func testAccNxosFeatureNgMVPNConfig_all() string { return ` resource "nxos_feature_ngmvpn" "test" { admin_state = "enabled"