dnszone_update.go raw
1 package bunny
2
3 import (
4 "context"
5 "fmt"
6 )
7
8 // DNSZoneUpdateOptions represents the request parameters for the Update DNS
9 // Zone API endpoint.
10 //
11 // Bunny.net API docs: https://docs.bunny.net/reference/dnszonepublic_update
12 type DNSZoneUpdateOptions struct {
13 CustomNameserversEnabled *bool `json:"CustomNameserversEnabled,omitempty"`
14 Nameserver1 *string `json:"Nameserver1,omitempty"`
15 Nameserver2 *string `json:"Nameserver2,omitempty"`
16 SoaEmail *string `json:"SoaEmail,omitempty"`
17 LoggingEnabled *bool `json:"LoggingEnabled,omitempty"`
18 LoggingIPAnonymizationEnabled *bool `json:"LoggingIPAnonymizationEnabled,omitempty"`
19 LogAnonymizationType *int `json:"LogAnonymizationType,omitempty"`
20 }
21
22 // Update changes the configuration the DNS Zone with the given ID.
23 // The updated DNS Zone is returned.
24 // Bunny.net API docs: https://docs.bunny.net/reference/dnszonepublic_update
25 func (s *DNSZoneService) Update(ctx context.Context, id int64, opts *DNSZoneUpdateOptions) (*DNSZone, error) {
26 path := fmt.Sprintf("dnszone/%d", id)
27 return resourcePostWithResponse[DNSZone](ctx, s.client, path, opts)
28 }
29