99 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
1010)
1111
12- type listIPAccessListsResponse struct {
13- ListIPAccessListsResponse []ipAccessListStatus `json:"ip_access_lists,omitempty"`
12+ type ListIPAccessListsResponse struct {
13+ ListIPAccessListsResponse []IpAccessListStatus `json:"ip_access_lists,omitempty"`
1414}
1515
1616type createIPAccessListRequest struct {
@@ -19,7 +19,7 @@ type createIPAccessListRequest struct {
1919 IPAddresses []string `json:"ip_addresses"`
2020}
2121
22- type ipAccessListStatus struct {
22+ type IpAccessListStatus struct {
2323 ListID string `json:"list_id"`
2424 Label string `json:"label"`
2525 ListType string `json:"list_type"`
@@ -32,15 +32,15 @@ type ipAccessListStatus struct {
3232 Enabled bool `json:"enabled,omitempty"`
3333}
3434
35- type ipAccessListStatusWrapper struct {
36- IPAccessList ipAccessListStatus `json:"ip_access_list,omitempty"`
35+ type IpAccessListStatusWrapper struct {
36+ IPAccessList IpAccessListStatus `json:"ip_access_list,omitempty"`
3737}
3838
3939type ipAccessListUpdateRequest struct {
4040 Label string `json:"label"`
4141 ListType string `json:"list_type"`
4242 IPAddresses []string `json:"ip_addresses"`
43- Enabled bool `json:"enabled,omitempty"`
43+ Enabled bool `json:"enabled,omitempty" tf:"default:true" `
4444}
4545
4646// Preview feature: https://docs.databricks.com/security/network/ip-access-list.html
@@ -59,8 +59,8 @@ func NewIPAccessListsAPI(ctx context.Context, m interface{}) ipAccessListsAPI {
5959}
6060
6161// Create creates the IP Access List to given the instance pool configuration
62- func (a ipAccessListsAPI ) Create (cr createIPAccessListRequest ) (status ipAccessListStatus , err error ) {
63- wrapper := ipAccessListStatusWrapper {}
62+ func (a ipAccessListsAPI ) Create (cr createIPAccessListRequest ) (status IpAccessListStatus , err error ) {
63+ wrapper := IpAccessListStatusWrapper {}
6464 err = a .client .Post (a .context , "/ip-access-lists" , cr , & wrapper )
6565 if err != nil {
6666 return
@@ -78,16 +78,16 @@ func (a ipAccessListsAPI) Delete(objectID string) (err error) {
7878 return
7979}
8080
81- func (a ipAccessListsAPI ) Read (objectID string ) (status ipAccessListStatus , err error ) {
82- wrapper := ipAccessListStatusWrapper {}
81+ func (a ipAccessListsAPI ) Read (objectID string ) (status IpAccessListStatus , err error ) {
82+ wrapper := IpAccessListStatusWrapper {}
8383 err = a .client .Get (a .context , "/ip-access-lists/" + objectID , nil , & wrapper )
8484 status = wrapper .IPAccessList
8585 return
8686}
8787
88- func (a ipAccessListsAPI ) List () (listResponse listIPAccessListsResponse , err error ) {
89- listResponse = listIPAccessListsResponse {}
90- err = a .client .Get (a .context , "/ip-access-lists" , & listResponse , nil )
88+ func (a ipAccessListsAPI ) List () (listResponse ListIPAccessListsResponse , err error ) {
89+ listResponse = ListIPAccessListsResponse {}
90+ err = a .client .Get (a .context , "/ip-access-lists" , nil , & listResponse )
9191 return
9292}
9393
@@ -100,7 +100,6 @@ func ResourceIPAccessList() *schema.Resource {
100100 Type : schema .TypeString ,
101101 ValidateFunc : validation .Any (validation .IsIPv4Address , validation .IsCIDR ),
102102 }
103- s ["enabled" ].Default = true
104103 return s
105104 })
106105 return common.Resource {
0 commit comments