Skip to content

Commit aad5fd4

Browse files
author
Marcin Parafiniuk
committed
rebase fixes
1 parent 580c70c commit aad5fd4

13 files changed

+28
-7
lines changed

gen/generator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333

3434
"gopkg.in/yaml.v3"
3535

36-
"github.com/netascode/terraform-provider-meraki/gen"
36+
"github.com/CiscoDevNet/terraform-provider-meraki/gen"
3737
)
3838

3939
const (

gen/yamlconfig.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ type YamlConfig struct {
2626
TestTags []string `yaml:"test_tags,omitempty"`
2727
TestPrerequisites string `yaml:"test_prerequisites,omitempty"`
2828
IdName string `yaml:"id_name,omitempty"`
29+
NoDataSource bool `yaml:"no_data_source"`
30+
NoResource bool `yaml:"no_resource"`
31+
NoImport bool `yaml:"no_import"`
2932
}
3033

3134
type YamlConfigAttribute struct {

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ require (
2020
gopkg.in/yaml.v3 v3.0.1
2121
)
2222

23+
replace github.com/netascode/go-meraki v0.0.0-20240901102824-a67592c39438 => /Users/maparafi/go-meraki
24+
2325
require (
2426
github.com/BurntSushi/toml v1.2.1 // indirect
2527
github.com/Kunde21/markdownfmt/v3 v3.1.0 // indirect

internal/provider/model_meraki_admin.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ func (data Admin) getPath() string {
6868

6969
func (data Admin) toBody(ctx context.Context, state Admin) string {
7070
body := ""
71+
if data.Id.ValueString() != "" {
72+
body, _ = sjson.Set(body, "id", data.Id.ValueString())
73+
}
7174
if !data.Email.IsNull() {
7275
body, _ = sjson.Set(body, "email", data.Email.ValueString())
7376
}

internal/provider/model_meraki_network.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ func (data Network) getPath() string {
5757

5858
func (data Network) toBody(ctx context.Context, state Network) string {
5959
body := ""
60+
if data.Id.ValueString() != "" {
61+
body, _ = sjson.Set(body, "id", data.Id.ValueString())
62+
}
6063
if !data.Name.IsNull() {
6164
body, _ = sjson.Set(body, "name", data.Name.ValueString())
6265
}

internal/provider/model_meraki_network_device_claim.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ func (data NetworkDeviceClaim) getDevicesPath() string {
6161

6262
func (data NetworkDeviceClaim) toBody(ctx context.Context, state NetworkDeviceClaim) string {
6363
body := ""
64+
if data.Id.ValueString() != "" {
65+
body, _ = sjson.Set(body, "id", data.Id.ValueString())
66+
}
6467
if !data.Serials.IsNull() {
6568
var values []string
6669
data.Serials.ElementsAs(ctx, &values, false)

internal/provider/model_meraki_network_group_policy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ import (
2525
"slices"
2626
"strconv"
2727

28+
"github.com/CiscoDevNet/terraform-provider-meraki/internal/provider/helpers"
2829
"github.com/hashicorp/terraform-plugin-framework/types"
2930
"github.com/hashicorp/terraform-plugin-log/tflog"
30-
"github.com/netascode/terraform-provider-meraki/internal/provider/helpers"
3131
"github.com/tidwall/gjson"
3232
"github.com/tidwall/sjson"
3333
)

internal/provider/model_meraki_network_snmp.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ func (data NetworkSNMP) getPath() string {
6161

6262
func (data NetworkSNMP) toBody(ctx context.Context, state NetworkSNMP) string {
6363
body := ""
64+
if data.Id.ValueString() != "" {
65+
body, _ = sjson.Set(body, "id", data.Id.ValueString())
66+
}
6467
if !data.Access.IsNull() {
6568
body, _ = sjson.Set(body, "access", data.Access.ValueString())
6669
}

internal/provider/model_meraki_organization.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ func (data Organization) getPath() string {
5858

5959
func (data Organization) toBody(ctx context.Context, state Organization) string {
6060
body := ""
61+
if data.Id.ValueString() != "" {
62+
body, _ = sjson.Set(body, "id", data.Id.ValueString())
63+
}
6164
if !data.Name.IsNull() {
6265
body, _ = sjson.Set(body, "name", data.Name.ValueString())
6366
}

internal/provider/model_meraki_organization_inventory_claim.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ func (data OrganizationInventoryClaim) getDevicesPath() string {
6161

6262
func (data OrganizationInventoryClaim) toBody(ctx context.Context, state OrganizationInventoryClaim) string {
6363
body := ""
64+
if data.Id.ValueString() != "" {
65+
body, _ = sjson.Set(body, "id", data.Id.ValueString())
66+
}
6467
if !data.Serials.IsNull() {
6568
var values []string
6669
data.Serials.ElementsAs(ctx, &values, false)

internal/provider/resource_meraki_network_group_policy.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"net/url"
2525
"strings"
2626

27+
"github.com/CiscoDevNet/terraform-provider-meraki/internal/provider/helpers"
2728
"github.com/hashicorp/terraform-plugin-framework/path"
2829
"github.com/hashicorp/terraform-plugin-framework/resource"
2930
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
@@ -32,7 +33,6 @@ import (
3233
"github.com/hashicorp/terraform-plugin-framework/types"
3334
"github.com/hashicorp/terraform-plugin-log/tflog"
3435
"github.com/netascode/go-meraki"
35-
"github.com/netascode/terraform-provider-meraki/internal/provider/helpers"
3636
)
3737

3838
// End of section. //template:end imports
@@ -494,7 +494,6 @@ func (r *NetworkGroupPolicyResource) Delete(ctx context.Context, req resource.De
494494
// End of section. //template:end delete
495495

496496
// Section below is generated&owned by "gen/generator.go". //template:begin import
497-
498497
func (r *NetworkGroupPolicyResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) {
499498
idParts := strings.Split(req.ID, ",")
500499

internal/provider/resource_meraki_network_settings.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ import (
2323
"fmt"
2424
"strings"
2525

26+
"github.com/CiscoDevNet/terraform-provider-meraki/internal/provider/helpers"
2627
"github.com/hashicorp/terraform-plugin-framework/path"
2728
"github.com/hashicorp/terraform-plugin-framework/resource"
2829
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
2930
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
3031
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
3132
"github.com/hashicorp/terraform-plugin-log/tflog"
3233
"github.com/netascode/go-meraki"
33-
"github.com/netascode/terraform-provider-meraki/internal/provider/helpers"
3434
)
3535

3636
// End of section. //template:end imports
@@ -243,7 +243,6 @@ func (r *NetworkSettingsResource) Delete(ctx context.Context, req resource.Delet
243243
// End of section. //template:end delete
244244

245245
// Section below is generated&owned by "gen/generator.go". //template:begin import
246-
247246
func (r *NetworkSettingsResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) {
248247
idParts := strings.Split(req.ID, ",")
249248

openapiconverter/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"regexp"
88
"strings"
99

10-
"github.com/netascode/terraform-provider-meraki/gen"
10+
"github.com/CiscoDevNet/terraform-provider-meraki/gen"
1111
"github.com/tidwall/gjson"
1212
"gopkg.in/yaml.v2"
1313
)

0 commit comments

Comments
 (0)