1
- export type AttributeType = 'bool' | 'number' | 'string' | unknown [ ] ;
1
+ /**
2
+ * https://developer.hashicorp.com/terraform/language/expressions/type-constraints
3
+ */
4
+ export type PrimitiveType = 'string' | 'number' | 'bool' ;
5
+ export type CollectionType = 'list' | 'map' | 'set' ;
6
+ export type StructuralType = 'object' | 'tuple' ;
7
+
8
+ export type AttributeType =
9
+ | PrimitiveType
10
+ | [ CollectionType , PrimitiveType ]
11
+ | [ CollectionType , [ StructuralType , { [ key : string ] : AttributeType } ] ] ;
2
12
3
13
export interface Attribute {
4
14
/**
@@ -8,6 +18,7 @@ export interface Attribute {
8
18
*/
9
19
type : AttributeType ;
10
20
description ?: string ;
21
+ description_kind ?: 'markdown' | 'plain' ;
11
22
/**
12
23
* If attribute is marked as optional, then it should be optional in the interface.
13
24
*/
@@ -20,6 +31,8 @@ export interface Attribute {
20
31
* If the attribute is required, then it should be required in the interface.
21
32
*/
22
33
required ?: boolean ;
34
+ sensitive ?: boolean ;
35
+ deprecated ?: boolean ;
23
36
}
24
37
25
38
/**
@@ -28,20 +41,22 @@ export interface Attribute {
28
41
* jq '[.. | objects | select(has("nesting_mode")) | {nesting_mode, min_items, max_items}] | unique' google/schema.json
29
42
*/
30
43
export interface BlockType {
31
- nesting_mode : 'single ' | 'list ' | 'set ' ;
44
+ nesting_mode : 'list ' | 'set ' | 'single ' ;
32
45
block : Block ;
33
46
min_items ?: number ;
34
47
max_items ?: number ;
35
48
}
36
49
37
50
export interface Block {
38
- description ?: string ;
39
51
attributes ?: {
40
52
[ key : string ] : Attribute ;
41
53
} ;
42
54
block_types ?: {
43
55
[ key : string ] : BlockType ;
44
56
} ;
57
+ description ?: string ;
58
+ description_kind ?: 'markdown' | 'plain' ;
59
+ deprecated ?: boolean ;
45
60
}
46
61
47
62
/**
@@ -52,14 +67,30 @@ export interface ProviderSchema {
52
67
block : Block ;
53
68
} ;
54
69
resource_schemas : {
55
- [ resource : string ] : {
70
+ [ resource_name : string ] : {
56
71
block : Block ;
57
72
} ;
58
73
} ;
59
- data_source_schemas : {
60
- [ resource : string ] : {
74
+ data_source_schemas ? : {
75
+ [ resource_name : string ] : {
61
76
block : Block ;
62
77
} ;
63
78
} ;
64
- functions ?: Record < string , any > ;
79
+ ephemeral_resource_schemas ?: {
80
+ [ resource_name : string ] : {
81
+ block : Block ;
82
+ } ;
83
+ } ;
84
+ functions ?: {
85
+ [ function_name : string ] : {
86
+ description ?: string ;
87
+ summary ?: string ;
88
+ return_type ?: string ;
89
+ parameters ?: {
90
+ name : string ;
91
+ description ?: string ;
92
+ type : string ;
93
+ } [ ] ;
94
+ } ;
95
+ } ;
65
96
}
0 commit comments