Skip to content

Commit

Permalink
feat!: remove deprecated import list sync_interval
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuochi committed Aug 17, 2023
1 parent 2e6b5c2 commit 17b4490
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 17 deletions.
1 change: 0 additions & 1 deletion docs/data-sources/import_list_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ data "radarr_import_list_config" "example" {
### Read-Only

- `id` (Number) Import List Config ID.
- `sync_interval` (Number) List Update Interval.
- `sync_level` (String) Clean library level.


1 change: 0 additions & 1 deletion docs/resources/import_list_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ resource "radarr_import_list_config" "example" {

### Required

- `sync_interval` (Number) List Update Interval.
- `sync_level` (String) Clean library level.

### Read-Only
Expand Down
1 change: 0 additions & 1 deletion examples/resources/radarr_import_list_config/resource.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
resource "radarr_import_list_config" "example" {
sync_interval = 24
sync_level = "logOnly"
}
4 changes: 0 additions & 4 deletions internal/provider/import_list_config_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ func (d *ImportListConfigDataSource) Schema(_ context.Context, _ datasource.Sche
MarkdownDescription: "Import List Config ID.",
Computed: true,
},
"sync_interval": schema.Int64Attribute{
MarkdownDescription: "List Update Interval.",
Computed: true,
},
"sync_level": schema.StringAttribute{
MarkdownDescription: "Clean library level.",
Computed: true,
Expand Down
11 changes: 2 additions & 9 deletions internal/provider/import_list_config_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ type ImportListConfigResource struct {

// ImportListConfig describes the import list config data model.
type ImportListConfig struct {
SyncLevel types.String `tfsdk:"sync_level"`
SyncInterval types.Int64 `tfsdk:"sync_interval"`
ID types.Int64 `tfsdk:"id"`
SyncLevel types.String `tfsdk:"sync_level"`
ID types.Int64 `tfsdk:"id"`
}

func (r *ImportListConfigResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
Expand All @@ -56,10 +55,6 @@ func (r *ImportListConfigResource) Schema(_ context.Context, _ resource.SchemaRe
int64planmodifier.UseStateForUnknown(),
},
},
"sync_interval": schema.Int64Attribute{
MarkdownDescription: "List Update Interval.",
Required: true,
},
"sync_level": schema.StringAttribute{
MarkdownDescription: "Clean library level.",
Required: true,
Expand Down Expand Up @@ -169,15 +164,13 @@ func (r *ImportListConfigResource) ImportState(ctx context.Context, _ resource.I

func (c *ImportListConfig) write(importListConfig *radarr.ImportListConfigResource) {
c.ID = types.Int64Value(int64(importListConfig.GetId()))
c.SyncInterval = types.Int64Value(int64(importListConfig.GetImportListSyncInterval()))
c.SyncLevel = types.StringValue(importListConfig.GetListSyncLevel())
}

func (c *ImportListConfig) read() *radarr.ImportListConfigResource {
config := radarr.NewImportListConfigResource()
config.SetId(int32(c.ID.ValueInt64()))
config.SetListSyncLevel(c.SyncLevel.ValueString())
config.SetImportListSyncInterval(int32(c.SyncInterval.ValueInt64()))

return config
}
1 change: 0 additions & 1 deletion internal/provider/import_list_config_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ func TestAccImportListConfigResource(t *testing.T) {
func testAccImportListConfigResourceConfig(level string) string {
return fmt.Sprintf(`
resource "radarr_import_list_config" "test" {
sync_interval = 24
sync_level = "%s"
}`, level)
}

0 comments on commit 17b4490

Please sign in to comment.