-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
97 additions
and
13 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package tfsdk | ||
|
||
import ( | ||
"github.com/hashicorp/terraform-plugin-go/tftypes" | ||
) | ||
|
||
type ConfigureProviderRequest struct { | ||
Config *tftypes.Value | ||
} | ||
|
||
type CreateResourceRequest struct { | ||
Config *tftypes.Value | ||
PriorState State | ||
PlannedState State | ||
} | ||
|
||
type ReadResourceRequest struct { | ||
Config *tftypes.Value | ||
CurrentState State | ||
} | ||
|
||
type DeleteResourceRequest struct { | ||
Config *tftypes.Value | ||
} | ||
|
||
type UpdateResourceRequest struct { | ||
Config *tftypes.Value | ||
PriorState State | ||
PlannedState State | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package tfsdk | ||
|
||
import ( | ||
"github.com/hashicorp/terraform-plugin-go/tfprotov6" | ||
"github.com/hashicorp/terraform-plugin-go/tftypes" | ||
) | ||
|
||
type ConfigureProviderResponse struct { | ||
Diagnostics []*tfprotov6.Diagnostic | ||
} | ||
|
||
type CreateResourceResponse struct { | ||
NewState State | ||
|
||
Diagnostics []*tfprotov6.Diagnostic | ||
} | ||
|
||
func (r *CreateResourceResponse) AddWarning(summary, detail string) { | ||
r.Diagnostics = append(r.Diagnostics, &tfprotov6.Diagnostic{ | ||
Summary: summary, | ||
Detail: detail, | ||
Severity: tfprotov6.DiagnosticSeverityWarning, | ||
}) | ||
} | ||
|
||
func (r *CreateResourceResponse) AddAttributeWarning(attributePath *tftypes.AttributePath, summary, detail string) { | ||
r.Diagnostics = append(r.Diagnostics, &tfprotov6.Diagnostic{ | ||
Attribute: attributePath, | ||
Summary: summary, | ||
Detail: detail, | ||
Severity: tfprotov6.DiagnosticSeverityWarning, | ||
}) | ||
} | ||
|
||
func (r *CreateResourceResponse) AddError(summary, detail string) { | ||
r.Diagnostics = append(r.Diagnostics, &tfprotov6.Diagnostic{ | ||
Summary: summary, | ||
Detail: detail, | ||
Severity: tfprotov6.DiagnosticSeverityError, | ||
}) | ||
} | ||
|
||
func (r *CreateResourceResponse) AddAttributeError(attributePath *tftypes.AttributePath, summary, detail string) { | ||
r.Diagnostics = append(r.Diagnostics, &tfprotov6.Diagnostic{ | ||
Attribute: attributePath, | ||
Summary: summary, | ||
Detail: detail, | ||
Severity: tfprotov6.DiagnosticSeverityError, | ||
}) | ||
} | ||
|
||
type ReadResourceResponse struct { | ||
Diagnostics []*tfprotov6.Diagnostic | ||
} | ||
|
||
type DeleteResourceResponse struct { | ||
Diagnostics []*tfprotov6.Diagnostic | ||
} | ||
|
||
type UpdateResourceResponse struct { | ||
NewState State | ||
|
||
Diagnostics []*tfprotov6.Diagnostic | ||
} |