From 2cdd0a2ab99e33e2f60bdd5505ba3d48e3be78c4 Mon Sep 17 00:00:00 2001 From: Blesswin Samuel Date: Thu, 24 Oct 2024 20:04:31 +0530 Subject: [PATCH] Add archive field to AppSpec to archive/restore apps (#746) * Add archive field to AppSpec to archive/restore apps * Add note about closed beta --- apps.gen.go | 3 +++ apps_accessors.go | 8 ++++++++ apps_accessors_test.go | 7 +++++++ 3 files changed, 18 insertions(+) diff --git a/apps.gen.go b/apps.gen.go index bf03259c..0232ae94 100644 --- a/apps.gen.go +++ b/apps.gen.go @@ -466,6 +466,9 @@ 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. + // Note that this feature is currently in closed beta. + 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()