generated from FrangipaneTeam/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 1
/
float64_type.go
67 lines (53 loc) · 1.79 KB
/
float64_type.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// -------------------------------------------------------------------- //
// ! DO NOT EDIT. This file is auto-generated from template ! //
// -------------------------------------------------------------------- //
package supertypes
import (
"context"
"fmt"
"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/diag"
"github.com/hashicorp/terraform-plugin-framework/types/basetypes"
"github.com/hashicorp/terraform-plugin-go/tftypes"
)
// Ensure the implementation satisfies the expected interfaces.
var _ basetypes.Float64Typable = Float64Type{}
type Float64Type struct {
basetypes.Float64Type
}
func (t Float64Type) Equal(o attr.Type) bool {
other, ok := o.(Float64Type)
if !ok {
return false
}
return t.Float64Type.Equal(other.Float64Type)
}
func (t Float64Type) String() string {
return "supertypes.Float64Type"
}
func (t Float64Type) ValueFromFloat64(_ context.Context, in basetypes.Float64Value) (basetypes.Float64Valuable, diag.Diagnostics) {
value := Float64Value{
Float64Value: in,
}
return value, nil
}
func (t Float64Type) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error) {
attrValue, err := t.Float64Type.ValueFromTerraform(ctx, in)
if err != nil {
return nil, err
}
Float64Value, ok := attrValue.(basetypes.Float64Value)
if !ok {
return nil, fmt.Errorf("unexpected value type of %T", attrValue)
}
Float64Valuable, diags := t.ValueFromFloat64(ctx, Float64Value)
if diags.HasError() {
return nil, fmt.Errorf("unexpected error converting Float64Value to Float64Valuable: %v", diags)
}
return Float64Valuable, nil
}
func (t Float64Type) ValueType(ctx context.Context) attr.Value {
return Float64Value{
Float64Value: t.Float64Type.ValueType(ctx).(basetypes.Float64Value),
}
}