1package ctydebug_test
2
3import (
4	"fmt"
5
6	"github.com/zclconf/go-cty-debug/ctydebug"
7	"github.com/zclconf/go-cty/cty"
8)
9
10func ExampleTypeString() {
11	ty := cty.Object(map[string]cty.Type{
12		"source_account":  cty.String,
13		"fee":             cty.Number,
14		"sequence_number": cty.Number,
15		"time_bounds":     cty.Tuple([]cty.Type{cty.String, cty.String}),
16		"memo":            cty.DynamicPseudoType,
17		"payments": cty.List(cty.Object(map[string]cty.Type{
18			"destination_account": cty.String,
19			"asset":               cty.String,
20			"amount":              cty.Number,
21		})),
22	})
23
24	fmt.Print(ctydebug.TypeString(ty))
25
26	// Output:
27	// cty.Object(map[string]cty.Type{
28	//     "fee": cty.Number,
29	//     "memo": cty.DynamicPseudoType,
30	//     "payments": cty.List(
31	//         cty.Object(map[string]cty.Type{
32	//             "amount": cty.Number,
33	//             "asset": cty.String,
34	//             "destination_account": cty.String,
35	//         }),
36	//     ),
37	//     "sequence_number": cty.Number,
38	//     "source_account": cty.String,
39	//     "time_bounds": cty.Tuple([]cty.Type{
40	//         cty.String,
41	//         cty.String,
42	//     }),
43	// })
44}
45