Skip to content

Commit

Permalink
Adding NewScope to provider
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulomeeCb committed Feb 27, 2024
1 parent 3543468 commit 99354e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,6 @@ func (p *capellaProvider) Resources(_ context.Context) []func() resource.Resourc
resources.NewAppService,
resources.NewBackup,
resources.NewBackupSchedule,
resources.NewScope,
}
}
5 changes: 5 additions & 0 deletions internal/resources/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ type Scope struct {
*providerschema.Data
}

// NewScope is a helper function to simplify the provider implementation.
func NewScope() resource.Resource {
return &Scope{}
}

func (s *Scope) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) {
resource.ImportStatePassthroughID(ctx, path.Root("name"), req, resp)
}
Expand Down

0 comments on commit 99354e1

Please sign in to comment.