You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
terraform/internal/plans/action_invocation.go

52 lines
1.4 KiB

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package plans
import (
"github.com/hashicorp/terraform/internal/addrs"
"github.com/hashicorp/terraform/internal/providers"
)
type ActionInvocationInstance struct {
Addr addrs.AbsActionInstance // mildwonkey TODO: this will be a *trigger* instance when that pr merges
// Provider is the address of the provider configuration that was used
// to plan this action, and thus the configuration that must also be
// used to apply it.
ProviderAddr addrs.AbsProviderConfig
}
// Encode produces a variant of the receiver that has its change values
// serialized so it can be written to a plan file. Pass the implied type of the
// corresponding resource type schema for correct operation.
func (ai *ActionInvocationInstance) Encode(schema providers.Schema) (*ActionInvocationInstanceSrc, error) {
return &ActionInvocationInstanceSrc{
Addr: ai.Addr,
ProviderAddr: ai.ProviderAddr,
}, nil
}
type ActionInvocationInstances []*ActionInvocationInstance
func (ais ActionInvocationInstances) DeepCopy() ActionInvocationInstances {
if ais == nil {
return ais
}
ret := make(ActionInvocationInstances, len(ais))
for i, ai := range ais {
ret[i] = ai.DeepCopy()
}
return ret
}
func (ai *ActionInvocationInstance) DeepCopy() *ActionInvocationInstance {
if ai == nil {
return ai
}
ret := *ai
return &ret
}