@@ -11,58 +11,62 @@ import (
1111)
1212
1313type WebhookResourceModel struct {
14- Active types.Bool `tfsdk:"active"`
14+ ID types.String `tfsdk:"id"`
15+ SpaceID types.String `tfsdk:"space_id"`
16+ WebhookID types.String `tfsdk:"webhook_id"`
17+ Name types.String `tfsdk:"name"`
18+ URL types.String `tfsdk:"url"`
19+ Topics types.List `tfsdk:"topics"`
1520 Filters types.List `tfsdk:"filters"`
16- Headers types.Map `tfsdk:"headers"`
1721 HTTPBasicPassword types.String `tfsdk:"http_basic_password"`
1822 HTTPBasicUsername types.String `tfsdk:"http_basic_username"`
19- Name types.String `tfsdk:"name"`
20- SpaceID types.String `tfsdk:"space_id"`
21- Topics types.List `tfsdk:"topics"`
23+ Headers types.Map `tfsdk:"headers"`
2224 Transformation WebhookTransformationValue `tfsdk:"transformation"`
23- URL types.String `tfsdk:"url"`
24- WebhookID types.String `tfsdk:"webhook_id"`
25+ Active types.Bool `tfsdk:"active"`
2526}
2627
2728func WebhookResourceSchema (ctx context.Context ) schema.Schema {
2829 return schema.Schema {
2930 Attributes : map [string ]schema.Attribute {
30- "active" : schema.BoolAttribute {
31- Optional : true ,
31+ "id" : schema.StringAttribute {
3232 Computed : true ,
33- Default : booldefault .StaticBool (true ),
3433 },
35- "filters" : WebhookFiltersSchema (ctx , true ),
36- "headers" : WebhookHeadersSchema (ctx , true ),
37- "http_basic_password" : schema.StringAttribute {
38- Optional : true ,
34+ "space_id" : schema.StringAttribute {
35+ Required : true ,
36+ PlanModifiers : []planmodifier.String {
37+ stringplanmodifier .RequiresReplace (),
38+ },
3939 },
40- "http_basic_username" : schema.StringAttribute {
40+ "webhook_id" : schema.StringAttribute {
41+ Computed : true ,
42+ PlanModifiers : []planmodifier.String {
43+ stringplanmodifier .UseStateForUnknown (),
44+ },
45+ },
46+ "active" : schema.BoolAttribute {
4147 Optional : true ,
48+ Computed : true ,
49+ Default : booldefault .StaticBool (true ),
4250 },
4351 "name" : schema.StringAttribute {
4452 Required : true ,
4553 },
46- "space_id " : schema.StringAttribute {
54+ "url " : schema.StringAttribute {
4755 Required : true ,
48- PlanModifiers : []planmodifier.String {
49- stringplanmodifier .RequiresReplace (),
50- },
5156 },
5257 "topics" : schema.ListAttribute {
5358 ElementType : types .StringType ,
5459 Optional : true ,
5560 },
56- "transformation " : WebhookTransformationSchema (ctx , true ),
57- "url " : schema.StringAttribute {
58- Required : true ,
61+ "filters " : WebhookFiltersSchema (ctx , true ),
62+ "http_basic_password " : schema.StringAttribute {
63+ Optional : true ,
5964 },
60- "webhook_id" : schema.StringAttribute {
61- Computed : true ,
62- PlanModifiers : []planmodifier.String {
63- stringplanmodifier .UseStateForUnknown (),
64- },
65+ "http_basic_username" : schema.StringAttribute {
66+ Optional : true ,
6567 },
68+ "headers" : WebhookHeadersSchema (ctx , true ),
69+ "transformation" : WebhookTransformationSchema (ctx , true ),
6670 },
6771 }
6872}
0 commit comments