chore: updated files - work save
This commit is contained in:
parent
51663cd8d0
commit
e91e10e29a
37 changed files with 1121 additions and 118 deletions
|
|
@ -0,0 +1,48 @@
|
|||
package sqlserverflexalpha
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
)
|
||||
|
||||
var _ datasource.DataSource = (*backupDataSource)(nil)
|
||||
|
||||
func NewBackupDataSource() datasource.DataSource {
|
||||
return &backupDataSource{}
|
||||
}
|
||||
|
||||
type backupDataSource struct{}
|
||||
|
||||
type backupDataSourceModel struct {
|
||||
Id types.String `tfsdk:"id"`
|
||||
}
|
||||
|
||||
func (d *backupDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
|
||||
resp.TypeName = req.ProviderTypeName + "sqlserverflexalpha_backup"
|
||||
}
|
||||
|
||||
func (d *backupDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) {
|
||||
resp.Schema = sqlserverflexalphaGen.BackupDataSourceSchema(ctx)
|
||||
}
|
||||
|
||||
func (d *backupDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
|
||||
var data sqlserverflexalphaGen.backupDataSourceModel
|
||||
|
||||
// Read Terraform configuration data into the model
|
||||
resp.Diagnostics.Append(req.Config.Get(ctx, &data)...)
|
||||
|
||||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
// Todo: Read API call logic
|
||||
|
||||
// Example data value setting
|
||||
data.Id = types.StringValue("example-id")
|
||||
|
||||
// Save data into Terraform state
|
||||
resp.Diagnostics.Append(resp.State.Set(ctx, &data)...)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue