-
Notifications
You must be signed in to change notification settings - Fork 91
/
framework_models.go
33 lines (29 loc) · 1.18 KB
/
framework_models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package kernel
import (
"context"
"github.com/hashicorp/terraform-plugin-framework-timetypes/timetypes"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/linode/linodego"
)
type DataSourceModel struct {
ID types.String `tfsdk:"id"`
Architecture types.String `tfsdk:"architecture"`
Built timetypes.RFC3339 `tfsdk:"built"`
Deprecated types.Bool `tfsdk:"deprecated"`
KVM types.Bool `tfsdk:"kvm"`
Label types.String `tfsdk:"label"`
PVOPS types.Bool `tfsdk:"pvops"`
Version types.String `tfsdk:"version"`
XEN types.Bool `tfsdk:"xen"`
}
func (data *DataSourceModel) ParseKernel(ctx context.Context, kernel *linodego.LinodeKernel) {
data.ID = types.StringValue(kernel.ID)
data.Architecture = types.StringValue(kernel.Architecture)
data.Built = timetypes.NewRFC3339TimePointerValue(kernel.Built)
data.Deprecated = types.BoolValue(kernel.Deprecated)
data.KVM = types.BoolValue(kernel.KVM)
data.Label = types.StringValue(kernel.Label)
data.PVOPS = types.BoolValue(kernel.PVOPS)
data.Version = types.StringValue(kernel.Version)
data.XEN = types.BoolValue(kernel.XEN)
}