Files
opentf/internal/cloud/cloudplan/remote_plan_json.go
Kuba Martin ebcf7455eb Rename root module name. (#4)
* Rename module name from "github.com/hashicorp/terraform" to "github.com/placeholderplaceholderplaceholder/opentf".

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Gofmt.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Regenerate protobuf.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Fix comments.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Undo issue and pull request link changes.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Undo comment changes.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Fix comment.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Undo some link changes.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* make generate && make protobuf

Signed-off-by: Jakub Martin <kubam@spacelift.io>

---------

Signed-off-by: Jakub Martin <kubam@spacelift.io>
2023-08-17 14:45:11 +02:00

40 lines
1.7 KiB
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package cloudplan
import (
"github.com/placeholderplaceholderplaceholder/opentf/internal/plans"
)
// RemotePlanJSON is a wrapper struct that associates a pre-baked JSON plan with
// several pieces of metadata that can't be derived directly from the JSON
// contents and must instead be discovered from a tfe.Run or tfe.Plan. The
// wrapper is useful for moving data between the Cloud backend (which is the
// only thing able to fetch the JSON and determine values for the metadata) and
// the command.ShowCommand and views.Show interface (which need to have all of
// this information together).
type RemotePlanJSON struct {
// The raw bytes of json we got from the API.
JSONBytes []byte
// Indicates whether the json bytes are the "redacted json plan" format, or
// the unredacted stable "external json plan" format. These formats are
// actually very different under the hood; the redacted one can be decoded
// directly into a jsonformat.Plan struct and is intended for formatting a
// plan for human consumption, while the unredacted one matches what is
// returned by the jsonplan.Marshal() function, cannot be directly decoded
// into a public type (it's actually a jsonplan.plan struct), and will
// generally be spat back out verbatim.
Redacted bool
// Normal/destroy/refresh. Required by (jsonformat.Renderer).RenderHumanPlan.
Mode plans.Mode
// Unchanged/errored. Required by (jsonformat.Renderer).RenderHumanPlan.
Qualities []plans.Quality
// A human-readable header with a link to view the associated run in the
// Terraform Cloud UI.
RunHeader string
// A human-readable footer with information relevant to the likely next
// actions for this plan.
RunFooter string
}