Skip to content

Commit

Permalink
make all children optional from optional parents
Browse files Browse the repository at this point in the history
  • Loading branch information
lantoli committed Dec 13, 2023
1 parent aea8965 commit b06471c
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions internal/service/onlinearchive/resource_online_archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ func getMongoDBAtlasOnlineArchiveSchema() map[string]*schema.Schema {
Type: schema.TypeList,
MinItems: 1,
MaxItems: 1,
Required: true,
Optional: true,
Computed: true,
ConfigMode: schema.SchemaConfigModeAttr,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"type": {
Type: schema.TypeString,
Required: true,
Optional: true,
Computed: true,
ValidateFunc: validation.StringInSlice([]string{"DATE", "CUSTOM"}, false),
},
"date_field": {
Expand Down Expand Up @@ -104,15 +106,18 @@ func getMongoDBAtlasOnlineArchiveSchema() map[string]*schema.Schema {
},
},
"data_expiration_rule": {
Type: schema.TypeList,
MinItems: 1,
MaxItems: 1,
Optional: true,
Type: schema.TypeList,
MinItems: 1,
MaxItems: 1,
Optional: true,
Computed: true,
ConfigMode: schema.SchemaConfigModeAttr,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"expire_after_days": {
Type: schema.TypeInt,
Required: true,
Optional: true,
Computed: true,
},
},
},
Expand Down Expand Up @@ -150,7 +155,8 @@ func getMongoDBAtlasOnlineArchiveSchema() map[string]*schema.Schema {
Schema: map[string]*schema.Schema{
"type": {
Type: schema.TypeString,
Required: true,
Optional: true,
Computed: true,
ValidateFunc: validation.StringInSlice([]string{"DAILY", "MONTHLY", "WEEKLY"}, false),
},
"end_hour": {
Expand Down Expand Up @@ -195,11 +201,13 @@ func getMongoDBAtlasOnlineArchiveSchema() map[string]*schema.Schema {
Schema: map[string]*schema.Schema{
"field_name": {
Type: schema.TypeString,
Required: true,
Optional: true,
Computed: true,
},
"order": {
Type: schema.TypeInt,
Required: true,
Optional: true,
Computed: true,
ValidateFunc: validation.IntAtLeast(0),
},
"field_type": {
Expand Down

0 comments on commit b06471c

Please sign in to comment.