@@ -234,6 +234,65 @@ var (
234
234
},
235
235
},
236
236
},
237
+ "ignore_query_string" : {
238
+ Type : schema .TypeList ,
239
+ MaxItems : 1 ,
240
+ Optional : true ,
241
+ Description : "" ,
242
+ Elem : & schema.Resource {
243
+ Schema : map [string ]* schema.Schema {
244
+ "enabled" : {
245
+ Type : schema .TypeBool ,
246
+ Optional : true ,
247
+ Default : true ,
248
+ },
249
+ "value" : {
250
+ Type : schema .TypeBool ,
251
+ Required : true ,
252
+ },
253
+ },
254
+ },
255
+ },
256
+ "query_params_whitelist" : {
257
+ Type : schema .TypeList ,
258
+ MaxItems : 1 ,
259
+ Optional : true ,
260
+ Description : "" ,
261
+ Elem : & schema.Resource {
262
+ Schema : map [string ]* schema.Schema {
263
+ "enabled" : {
264
+ Type : schema .TypeBool ,
265
+ Optional : true ,
266
+ Default : true ,
267
+ },
268
+ "value" : {
269
+ Type : schema .TypeSet ,
270
+ Elem : & schema.Schema {Type : schema .TypeString },
271
+ Required : true ,
272
+ },
273
+ },
274
+ },
275
+ },
276
+ "query_params_blacklist" : {
277
+ Type : schema .TypeList ,
278
+ MaxItems : 1 ,
279
+ Optional : true ,
280
+ Description : "" ,
281
+ Elem : & schema.Resource {
282
+ Schema : map [string ]* schema.Schema {
283
+ "enabled" : {
284
+ Type : schema .TypeBool ,
285
+ Optional : true ,
286
+ Default : true ,
287
+ },
288
+ "value" : {
289
+ Type : schema .TypeSet ,
290
+ Elem : & schema.Schema {Type : schema .TypeString },
291
+ Required : true ,
292
+ },
293
+ },
294
+ },
295
+ },
237
296
},
238
297
},
239
298
}
@@ -544,6 +603,40 @@ func listToOptions(l []interface{}) *gcdn.Options {
544
603
CustomHostname : opt ["custom_hostname" ].(string ),
545
604
}
546
605
}
606
+ if opt , ok := getOptByName (fields , "ignore_query_string" ); ok {
607
+ enabled := true
608
+ if _ , ok := opt ["enabled" ]; ok {
609
+ enabled = opt ["enabled" ].(bool )
610
+ }
611
+ opts .IgnoreQueryString = & gcdn.IgnoreQueryString {
612
+ Enabled : enabled ,
613
+ Value : opt ["value" ].(bool ),
614
+ }
615
+ }
616
+ if opt , ok := getOptByName (fields , "query_params_whitelist" ); ok {
617
+ enabled := true
618
+ if _ , ok := opt ["enabled" ]; ok {
619
+ enabled = opt ["enabled" ].(bool )
620
+ }
621
+ opts .QueryParamsWhitelist = & gcdn.QueryParamsWhitelist {
622
+ Enabled : enabled ,
623
+ }
624
+ for _ , v := range opt ["value" ].(* schema.Set ).List () {
625
+ opts .QueryParamsWhitelist .Value = append (opts .QueryParamsWhitelist .Value , v .(string ))
626
+ }
627
+ }
628
+ if opt , ok := getOptByName (fields , "query_params_blacklist" ); ok {
629
+ enabled := true
630
+ if _ , ok := opt ["enabled" ]; ok {
631
+ enabled = opt ["enabled" ].(bool )
632
+ }
633
+ opts .QueryParamsBlacklist = & gcdn.QueryParamsBlacklist {
634
+ Enabled : enabled ,
635
+ }
636
+ for _ , v := range opt ["value" ].(* schema.Set ).List () {
637
+ opts .QueryParamsBlacklist .Value = append (opts .QueryParamsBlacklist .Value , v .(string ))
638
+ }
639
+ }
547
640
return & opts
548
641
}
549
642
@@ -607,6 +700,18 @@ func optionsToList(options *gcdn.Options) []interface{} {
607
700
m := structToMap (options .SNI )
608
701
result ["sni" ] = []interface {}{m }
609
702
}
703
+ if options .IgnoreQueryString != nil {
704
+ m := structToMap (options .IgnoreQueryString )
705
+ result ["ignore_query_string" ] = []interface {}{m }
706
+ }
707
+ if options .QueryParamsWhitelist != nil {
708
+ m := structToMap (options .QueryParamsWhitelist )
709
+ result ["query_params_whitelist" ] = []interface {}{m }
710
+ }
711
+ if options .QueryParamsBlacklist != nil {
712
+ m := structToMap (options .QueryParamsBlacklist )
713
+ result ["query_params_blacklist" ] = []interface {}{m }
714
+ }
610
715
return []interface {}{result }
611
716
}
612
717
0 commit comments