Skip to content

Commit

Permalink
feat(d/query_specification): local-only datasource
Browse files Browse the repository at this point in the history
  • Loading branch information
jharley committed Oct 8, 2024
1 parent 99acda7 commit 06e66ca
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions internal/provider/query_specification_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,14 @@ import (

// Ensure the implementation satisfies the expected interfaces.
var (
_ datasource.DataSource = &querySpecDataSource{}
_ datasource.DataSourceWithConfigure = &querySpecDataSource{}
_ datasource.DataSource = &querySpecDataSource{}
)

func NewQuerySpecDataSource() datasource.DataSource {
return &querySpecDataSource{}
}

type querySpecDataSource struct {
client *client.Client
}
type querySpecDataSource struct{}

func (d *querySpecDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
resp.TypeName = req.ProviderTypeName + "_query_specification"
Expand Down Expand Up @@ -199,20 +196,6 @@ func (d *querySpecDataSource) Schema(_ context.Context, _ datasource.SchemaReque
}
}

func (d *querySpecDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) {
w := getClientFromDatasourceRequest(&req)
if w == nil {
return
}

c, err := w.V1Client()
if err != nil || c == nil {
resp.Diagnostics.AddError("Failed to configure client", err.Error())
return
}
d.client = c
}

func (d *querySpecDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
var data models.QuerySpecificationModel

Expand Down

0 comments on commit 06e66ca

Please sign in to comment.