Skip to content

Commit

Permalink
Migrate resource pagerduty_extension
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgajard committed Apr 2, 2024
1 parent abea7ca commit adc4d2b
Show file tree
Hide file tree
Showing 22 changed files with 1,501 additions and 279 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/hashicorp/terraform-exec v0.20.0
github.com/hashicorp/terraform-json v0.20.0
github.com/hashicorp/terraform-plugin-framework v1.5.0
github.com/hashicorp/terraform-plugin-framework-jsontypes v0.1.0
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0
github.com/hashicorp/terraform-plugin-go v0.20.0
github.com/hashicorp/terraform-plugin-mux v0.13.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ github.com/hashicorp/terraform-json v0.20.0 h1:cJcvn4gIOTi0SD7pIy+xiofV1zFA3hza+
github.com/hashicorp/terraform-json v0.20.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk=
github.com/hashicorp/terraform-plugin-framework v1.5.0 h1:8kcvqJs/x6QyOFSdeAyEgsenVOUeC/IyKpi2ul4fjTg=
github.com/hashicorp/terraform-plugin-framework v1.5.0/go.mod h1:6waavirukIlFpVpthbGd2PUNYaFedB0RwW3MDzJ/rtc=
github.com/hashicorp/terraform-plugin-framework-jsontypes v0.1.0 h1:b8vZYB/SkXJT4YPbT3trzE6oJ7dPyMy68+9dEDKsJjE=
github.com/hashicorp/terraform-plugin-framework-jsontypes v0.1.0/go.mod h1:tP9BC3icoXBz72evMS5UTFvi98CiKhPdXF6yLs1wS8A=
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc=
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0/go.mod h1:jfHGE/gzjxYz6XoUwi/aYiiKrJDeutQNUtGQXkaHklg=
github.com/hashicorp/terraform-plugin-go v0.20.0 h1:oqvoUlL+2EUbKNsJbIt3zqqZ7wi6lzn4ufkn/UA51xQ=
Expand Down
1 change: 0 additions & 1 deletion pagerduty/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ func Provider(isMux bool) *schema.Provider {
"pagerduty_user": resourcePagerDutyUser(),
"pagerduty_user_contact_method": resourcePagerDutyUserContactMethod(),
"pagerduty_user_notification_rule": resourcePagerDutyUserNotificationRule(),
"pagerduty_extension": resourcePagerDutyExtension(),
"pagerduty_extension_servicenow": resourcePagerDutyExtensionServiceNow(),
"pagerduty_event_rule": resourcePagerDutyEventRule(),
"pagerduty_ruleset": resourcePagerDutyRuleset(),
Expand Down
253 changes: 0 additions & 253 deletions pagerduty/resource_pagerduty_extension.go

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ func TestAccPagerDutyExtension_import(t *testing.T) {
url := "https://example.com/receive_a_pagerduty_webhook"

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckPagerDutyExtensionDestroy,
PreCheck: func() { testAccPreCheck(t) },
ProtoV5ProviderFactories: testAccProtoV5ProviderFactories(),
CheckDestroy: testAccCheckPagerDutyExtensionDestroy,
Steps: []resource.TestStep{
{
Config: testAccCheckPagerDutyExtensionConfig(name, extension_name, url, "false", "any"),
Expand Down
3 changes: 2 additions & 1 deletion pagerdutyplugin/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ func (p *Provider) DataSources(ctx context.Context) [](func() datasource.DataSou
func (p *Provider) Resources(ctx context.Context) [](func() resource.Resource) {
return [](func() resource.Resource){
func() resource.Resource { return &resourceBusinessService{} },
func() resource.Resource { return &resourceTag{} },
func() resource.Resource { return &resourceExtension{} },
func() resource.Resource { return &resourceTagAssignment{} },
func() resource.Resource { return &resourceTag{} },
}
}

Expand Down
2 changes: 1 addition & 1 deletion pagerdutyplugin/resource_pagerduty_business_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func requestGetBusinessService(ctx context.Context, client *pagerduty.Client, id
return model
}

func buildPagerdutyBusinessService(ctx context.Context, model *resourceBusinessServiceModel) *pagerduty.BusinessService {
func buildPagerdutyBusinessService(_ context.Context, model *resourceBusinessServiceModel) *pagerduty.BusinessService {
businessService := pagerduty.BusinessService{
ID: model.ID.ValueString(),
Description: model.Description.ValueString(),
Expand Down
Loading

0 comments on commit adc4d2b

Please sign in to comment.