@@ -10,7 +10,9 @@ import (
1010 "github.com/hashicorp/terraform-plugin-sdk/v2/diag"
1111 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
1212 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
13+
1314 honeycombio "github.com/honeycombio/terraform-provider-honeycombio/client"
15+ "github.com/honeycombio/terraform-provider-honeycombio/internal/helper"
1416 "github.com/honeycombio/terraform-provider-honeycombio/internal/helper/hashcode"
1517)
1618
@@ -27,7 +29,7 @@ func dataSourceHoneycombioQuerySpec() *schema.Resource {
2729 "op" : {
2830 Type : schema .TypeString ,
2931 Required : true ,
30- ValidateFunc : validation .StringInSlice (calculationOpStrings ( ), false ),
32+ ValidateFunc : validation .StringInSlice (helper . AsStringSlice ( honeycombio . CalculationOps () ), false ),
3133 },
3234 "column" : {
3335 Type : schema .TypeString ,
@@ -48,7 +50,7 @@ func dataSourceHoneycombioQuerySpec() *schema.Resource {
4850 "op" : {
4951 Type : schema .TypeString ,
5052 Required : true ,
51- ValidateFunc : validation .StringInSlice (filterOpStrings ( ), false ),
53+ ValidateFunc : validation .StringInSlice (helper . AsStringSlice ( honeycombio . FilterOps () ), false ),
5254 },
5355 "value" : {
5456 Type : schema .TypeString ,
@@ -90,7 +92,7 @@ func dataSourceHoneycombioQuerySpec() *schema.Resource {
9092 "calculate_op" : {
9193 Type : schema .TypeString ,
9294 Required : true ,
93- ValidateFunc : validation .StringInSlice (havingCalculateOpStrings ( ), false ),
95+ ValidateFunc : validation .StringInSlice (helper . AsStringSlice ( honeycombio . HavingCalculationOps () ), false ),
9496 },
9597 "column" : {
9698 Type : schema .TypeString ,
@@ -100,7 +102,7 @@ func dataSourceHoneycombioQuerySpec() *schema.Resource {
100102 "op" : {
101103 Type : schema .TypeString ,
102104 Required : true ,
103- ValidateFunc : validation .StringInSlice (havingOpStrings ( ), false ),
105+ ValidateFunc : validation .StringInSlice (helper . AsStringSlice ( honeycombio . HavingOps () ), false ),
104106 },
105107 "value" : {
106108 // API currently assumes this is a number
@@ -131,7 +133,7 @@ func dataSourceHoneycombioQuerySpec() *schema.Resource {
131133 "op" : {
132134 Type : schema .TypeString ,
133135 Optional : true ,
134- ValidateFunc : validation .StringInSlice (calculationOpStrings ( ), false ),
136+ ValidateFunc : validation .StringInSlice (helper . AsStringSlice ( honeycombio . CalculationOps () ), false ),
135137 },
136138 "column" : {
137139 Type : schema .TypeString ,
@@ -140,7 +142,7 @@ func dataSourceHoneycombioQuerySpec() *schema.Resource {
140142 "order" : {
141143 Type : schema .TypeString ,
142144 Optional : true ,
143- ValidateFunc : validation .StringInSlice (sortOrderStrings ( ), false ),
145+ ValidateFunc : validation .StringInSlice (helper . AsStringSlice ( honeycombio . SortOrders () ), false ),
144146 },
145147 },
146148 },
0 commit comments