From 8ac0227f188e41c07a58e7804bd9cac3f9a071f3 Mon Sep 17 00:00:00 2001 From: Blesswin Samuel Date: Thu, 24 Oct 2024 16:48:42 +0530 Subject: [PATCH 1/2] Add archive field to AppSpec to archive/restore apps --- apps.gen.go | 2 ++ apps_accessors.go | 8 ++++++++ apps_accessors_test.go | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/apps.gen.go b/apps.gen.go index bf03259c..8023688a 100644 --- a/apps.gen.go +++ b/apps.gen.go @@ -466,6 +466,8 @@ type AppLogDestinationSpecPapertrail struct { type AppMaintenanceSpec struct { // Indicates whether maintenance mode should be enabled for the app. Enabled bool `json:"enabled,omitempty"` + // Indicates whether the app should be archived. Setting this to true implies that enabled is set to true. + Archive bool `json:"archive,omitempty"` } // AppRouteSpec struct for AppRouteSpec diff --git a/apps_accessors.go b/apps_accessors.go index 0293734e..02e7c4b1 100644 --- a/apps_accessors.go +++ b/apps_accessors.go @@ -1421,6 +1421,14 @@ func (a *AppLogDestinationSpecPapertrail) GetEndpoint() string { return a.Endpoint } +// GetArchive returns the Archive field. +func (a *AppMaintenanceSpec) GetArchive() bool { + if a == nil { + return false + } + return a.Archive +} + // GetEnabled returns the Enabled field. func (a *AppMaintenanceSpec) GetEnabled() bool { if a == nil { diff --git a/apps_accessors_test.go b/apps_accessors_test.go index 9138c5a7..418f4330 100644 --- a/apps_accessors_test.go +++ b/apps_accessors_test.go @@ -1245,6 +1245,13 @@ func TestAppLogDestinationSpecPapertrail_GetEndpoint(tt *testing.T) { a.GetEndpoint() } +func TestAppMaintenanceSpec_GetArchive(tt *testing.T) { + a := &AppMaintenanceSpec{} + a.GetArchive() + a = nil + a.GetArchive() +} + func TestAppMaintenanceSpec_GetEnabled(tt *testing.T) { a := &AppMaintenanceSpec{} a.GetEnabled() From 7fd189c2e5d75dc9fe762059eefbc31a134146e8 Mon Sep 17 00:00:00 2001 From: Blesswin Samuel Date: Thu, 24 Oct 2024 19:48:47 +0530 Subject: [PATCH 2/2] Add note about closed beta --- apps.gen.go | 1 + 1 file changed, 1 insertion(+) diff --git a/apps.gen.go b/apps.gen.go index 8023688a..0232ae94 100644 --- a/apps.gen.go +++ b/apps.gen.go @@ -467,6 +467,7 @@ type AppMaintenanceSpec struct { // Indicates whether maintenance mode should be enabled for the app. Enabled bool `json:"enabled,omitempty"` // Indicates whether the app should be archived. Setting this to true implies that enabled is set to true. + // Note that this feature is currently in closed beta. Archive bool `json:"archive,omitempty"` }