From 9b76e3f632d063a737acc3c0c3d66e31f2d0a9fd Mon Sep 17 00:00:00 2001 From: YanniHu1996 Date: Thu, 29 Jun 2023 16:08:12 +0800 Subject: [PATCH] fix: Run make docs --- docs/data-sources/regions.md | 2 +- docs/resources/region.md | 2 +- pkg/provider/utils.go | 24 ++++++++++++------------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/data-sources/regions.md b/docs/data-sources/regions.md index af45515d..141ae738 100644 --- a/docs/data-sources/regions.md +++ b/docs/data-sources/regions.md @@ -40,7 +40,7 @@ output "cloud_provider_id" { ### Required -- `cloud_provider` (String) Cloud provider to list the regions. For example, "aws" or "azure". +- `cloud_provider` (String) Cloud provider to list the regions. For example, "aws", "azure" or "bah:aws". - `project_id` (String) BigAnimal Project ID. ### Optional diff --git a/docs/resources/region.md b/docs/resources/region.md index 3839dc66..af081226 100644 --- a/docs/resources/region.md +++ b/docs/resources/region.md @@ -43,7 +43,7 @@ output "region_continent" { ### Required -- `cloud_provider` (String) Cloud provider. For example, "aws" or "azure". +- `cloud_provider` (String) Cloud provider. For example, "aws", "azure" or "bah:aws". - `project_id` (String) BigAnimal Project ID. - `region_id` (String) Region ID of the region. For example, "germanywestcentral" in the Azure cloud provider or "eu-west-1" in the AWS cloud provider. diff --git a/pkg/provider/utils.go b/pkg/provider/utils.go index 3d82fd81..bb08ea3e 100644 --- a/pkg/provider/utils.go +++ b/pkg/provider/utils.go @@ -11,38 +11,38 @@ import ( sdkdiag "github.com/hashicorp/terraform-plugin-sdk/v2/diag" ) -func fromBigAnimalErr(err error) diag.Diagnostics { +func fromBigAnimalErr(err error) sdkdiag.Diagnostics { if err == nil { return nil } var baError *api.BigAnimalError if errors.As(err, &baError) { - return diag.Diagnostics{ - diag.Diagnostic{ - Severity: diag.Error, + return sdkdiag.Diagnostics{ + sdkdiag.Diagnostic{ + Severity: sdkdiag.Error, Summary: baError.Error(), Detail: baError.GetDetails(), }, } } - return diag.FromErr(err) + return sdkdiag.FromErr(err) } -func unsupportedWarning(message string) diag.Diagnostics { - return diag.Diagnostics{ - diag.Diagnostic{ - Severity: diag.Warning, +func unsupportedWarning(message string) sdkdiag.Diagnostics { + return sdkdiag.Diagnostics{ + sdkdiag.Diagnostic{ + Severity: sdkdiag.Warning, Summary: "Unsupported", Detail: message, }, } } -func fromErr(err error, summary string, args ...any) diag2.Diagnostics { +func fromErr(err error, summary string, args ...any) frameworkdiag.Diagnostics { summary = fmt.Sprintf(summary, args...) - return diag2.Diagnostics{ - diag2.NewErrorDiagnostic( + return frameworkdiag.Diagnostics{ + frameworkdiag.NewErrorDiagnostic( summary, err.Error(), ), }