Skip to content

Commit

Permalink
Merge pull request #206 from hashicorp/b/fix-chaos-studio-common-id-d…
Browse files Browse the repository at this point in the history
…efinition

commonids: pass in address of chaos studio IDs
  • Loading branch information
jackofallops authored Jan 18, 2024
2 parents 32a0e4e + 79a1755 commit cebe537
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions resourcemanager/commonids/chaos_studio_capability.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids"
)

var _ resourceids.ResourceId = ChaosStudioCapabilityId{}
var _ resourceids.ResourceId = &ChaosStudioCapabilityId{}

// ChaosStudioCapabilityId is a struct representing the Resource ID for an App Service Plan
type ChaosStudioCapabilityId struct {
Expand All @@ -30,7 +30,7 @@ func NewChaosStudioCapabilityID(scope string, targetName string, capabilityName

// ParseChaosStudioCapabilityID parses 'input' into a ChaosStudioCapabilityId
func ParseChaosStudioCapabilityID(input string) (*ChaosStudioCapabilityId, error) {
parser := resourceids.NewParserFromResourceIdType(ChaosStudioCapabilityId{})
parser := resourceids.NewParserFromResourceIdType(&ChaosStudioCapabilityId{})
parsed, err := parser.Parse(input, false)
if err != nil {
return nil, fmt.Errorf("parsing %q: %+v", input, err)
Expand All @@ -47,14 +47,14 @@ func ParseChaosStudioCapabilityID(input string) (*ChaosStudioCapabilityId, error
// ParseChaosStudioCapabilityIDInsensitively parses 'input' case-insensitively into a ChaosStudioCapabilityId
// note: this method should only be used for API response data and not user input
func ParseChaosStudioCapabilityIDInsensitively(input string) (*ChaosStudioCapabilityId, error) {
parser := resourceids.NewParserFromResourceIdType(ChaosStudioCapabilityId{})
parser := resourceids.NewParserFromResourceIdType(&ChaosStudioCapabilityId{})
parsed, err := parser.Parse(input, true)
if err != nil {
return nil, fmt.Errorf("parsing %q: %+v", input, err)
}

id := ChaosStudioCapabilityId{}
if err := id.FromParseResult(*parsed); err != nil {
if err = id.FromParseResult(*parsed); err != nil {
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion resourcemanager/commonids/chaos_studio_capability_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids"
)

var _ resourceids.ResourceId = ChaosStudioCapabilityId{}
var _ resourceids.ResourceId = &ChaosStudioCapabilityId{}

func TestNewChaosStudioCapabilityId(t *testing.T) {
id := NewChaosStudioCapabilityID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "targetName", "capabilityName")
Expand Down
8 changes: 4 additions & 4 deletions resourcemanager/commonids/chaos_studio_target.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids"
)

var _ resourceids.ResourceId = ChaosStudioTargetId{}
var _ resourceids.ResourceId = &ChaosStudioTargetId{}

// ChaosStudioTargetId is a struct representing the Resource ID for an App Service Plan
type ChaosStudioTargetId struct {
Expand All @@ -28,7 +28,7 @@ func NewChaosStudioTargetID(scope string, targetName string) ChaosStudioTargetId

// ParseChaosStudioTargetID parses 'input' into a ChaosStudioTargetId
func ParseChaosStudioTargetID(input string) (*ChaosStudioTargetId, error) {
parser := resourceids.NewParserFromResourceIdType(ChaosStudioTargetId{})
parser := resourceids.NewParserFromResourceIdType(&ChaosStudioTargetId{})
parsed, err := parser.Parse(input, false)
if err != nil {
return nil, fmt.Errorf("parsing %q: %+v", input, err)
Expand All @@ -45,14 +45,14 @@ func ParseChaosStudioTargetID(input string) (*ChaosStudioTargetId, error) {
// ParseChaosStudioTargetIDInsensitively parses 'input' case-insensitively into a ChaosStudioTargetId
// note: this method should only be used for API response data and not user input
func ParseChaosStudioTargetIDInsensitively(input string) (*ChaosStudioTargetId, error) {
parser := resourceids.NewParserFromResourceIdType(ChaosStudioTargetId{})
parser := resourceids.NewParserFromResourceIdType(&ChaosStudioTargetId{})
parsed, err := parser.Parse(input, true)
if err != nil {
return nil, fmt.Errorf("parsing %q: %+v", input, err)
}

id := ChaosStudioTargetId{}
if err := id.FromParseResult(*parsed); err != nil {
if err = id.FromParseResult(*parsed); err != nil {
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion resourcemanager/commonids/chaos_studio_target_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids"
)

var _ resourceids.ResourceId = ChaosStudioTargetId{}
var _ resourceids.ResourceId = &ChaosStudioTargetId{}

func TestNewChaosStudioTargetId(t *testing.T) {
id := NewChaosStudioTargetID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "targetName")
Expand Down

0 comments on commit cebe537

Please sign in to comment.