Skip to content

Commit

Permalink
move service model
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm committed Aug 8, 2024
1 parent 6836b63 commit 9f5b854
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package resource
package model

import (
"context"
Expand Down
9 changes: 5 additions & 4 deletions internal/resource/service_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"time"

"terraform-provider-plural/internal/common"
"terraform-provider-plural/internal/model"

"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/resource"
Expand Down Expand Up @@ -53,7 +54,7 @@ func (r *ServiceDeploymentResource) Configure(_ context.Context, req resource.Co
}

func (r *ServiceDeploymentResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
data := new(ServiceDeployment)
data := new(model.ServiceDeployment)
resp.Diagnostics.Append(req.Plan.Get(ctx, data)...)
if resp.Diagnostics.HasError() {
return
Expand All @@ -71,7 +72,7 @@ func (r *ServiceDeploymentResource) Create(ctx context.Context, req resource.Cre
}

func (r *ServiceDeploymentResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
data := new(ServiceDeployment)
data := new(model.ServiceDeployment)
resp.Diagnostics.Append(req.State.Get(ctx, data)...)
if resp.Diagnostics.HasError() {
return
Expand All @@ -88,7 +89,7 @@ func (r *ServiceDeploymentResource) Read(ctx context.Context, req resource.ReadR
}

func (r *ServiceDeploymentResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
data := new(ServiceDeployment)
data := new(model.ServiceDeployment)
resp.Diagnostics.Append(req.Plan.Get(ctx, data)...)
if resp.Diagnostics.HasError() {
return
Expand All @@ -104,7 +105,7 @@ func (r *ServiceDeploymentResource) Update(ctx context.Context, req resource.Upd
}

func (r *ServiceDeploymentResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
data := new(ServiceDeployment)
data := new(model.ServiceDeployment)
resp.Diagnostics.Append(req.State.Get(ctx, data)...)
if resp.Diagnostics.HasError() {
return
Expand Down

0 comments on commit 9f5b854

Please sign in to comment.