diff --git a/service/databases/model.go b/service/databases/model.go index b9bee48..b64c505 100644 --- a/service/databases/model.go +++ b/service/databases/model.go @@ -171,9 +171,14 @@ type UpdateDatabase struct { SourceIP []*string `json:"sourceIp,omitempty"` ClientSSLCertificate *string `json:"clientSslCertificate,omitempty"` Password *string `json:"password,omitempty"` - Alerts []*UpdateAlert `json:"alerts,omitempty"` - EnableTls *bool `json:"enableTls,omitempty"` - RemoteBackup *DatabaseBackupConfig `json:"remoteBackup,omitempty"` + + // It's important to use a pointer here, because the terraform user may want to send an empty list. + // In that case, the developer must pass a (pointer to a) non-nil, zero-length slice + // If the developer really wants to omit this value, passing a nil slice value would work + Alerts *[]*UpdateAlert `json:"alerts,omitempty"` + + EnableTls *bool `json:"enableTls,omitempty"` + RemoteBackup *DatabaseBackupConfig `json:"remoteBackup,omitempty"` } func (o UpdateDatabase) String() string { diff --git a/service/databases/model_active_active.go b/service/databases/model_active_active.go index a832e5b..753119b 100644 --- a/service/databases/model_active_active.go +++ b/service/databases/model_active_active.go @@ -88,18 +88,19 @@ func (o LocalThroughput) String() string { } type UpdateActiveActiveDatabase struct { - DryRun *bool `json:"dryRun,omitempty"` - MemoryLimitInGB *float64 `json:"memoryLimitInGb,omitempty"` - SupportOSSClusterAPI *bool `json:"supportOSSClusterApi,omitempty"` - UseExternalEndpointForOSSClusterAPI *bool `json:"useExternalEndpointForOSSClusterApi,omitempty"` - ClientSSLCertificate *string `json:"clientSslCertificate,omitempty"` - EnableTls *bool `json:"enableTls,omitempty"` - GlobalDataPersistence *string `json:"globalDataPersistence,omitempty"` - GlobalPassword *string `json:"globalPassword,omitempty"` - GlobalSourceIP []*string `json:"globalSourceIp,omitempty"` - GlobalAlerts []*UpdateAlert `json:"globalAlerts,omitempty"` - Regions []*LocalRegionProperties `json:"regions,omitempty"` - DataEvictionPolicy *string `json:"dataEvictionPolicy,omitempty"` + DryRun *bool `json:"dryRun,omitempty"` + MemoryLimitInGB *float64 `json:"memoryLimitInGb,omitempty"` + SupportOSSClusterAPI *bool `json:"supportOSSClusterApi,omitempty"` + UseExternalEndpointForOSSClusterAPI *bool `json:"useExternalEndpointForOSSClusterApi,omitempty"` + ClientSSLCertificate *string `json:"clientSslCertificate,omitempty"` + EnableTls *bool `json:"enableTls,omitempty"` + GlobalDataPersistence *string `json:"globalDataPersistence,omitempty"` + GlobalPassword *string `json:"globalPassword,omitempty"` + GlobalSourceIP []*string `json:"globalSourceIp,omitempty"` + // Using a pointer to allow empty slices to be serialised/sent + GlobalAlerts *[]*UpdateAlert `json:"globalAlerts,omitempty"` + Regions []*LocalRegionProperties `json:"regions,omitempty"` + DataEvictionPolicy *string `json:"dataEvictionPolicy,omitempty"` } func (o UpdateActiveActiveDatabase) String() string { @@ -113,7 +114,8 @@ type LocalRegionProperties struct { DataPersistence *string `json:"dataPersistence,omitempty"` Password *string `json:"password,omitempty"` SourceIP []*string `json:"sourceIp,omitempty"` - Alerts []*UpdateAlert `json:"alerts,omitempty"` + // Using a pointer to allow empty slices to be serialised/sent + Alerts *[]*UpdateAlert `json:"alerts,omitempty"` } func (o LocalRegionProperties) String() string {