From 02e136cdf2a13b3856f3161da94773962e2036ce Mon Sep 17 00:00:00 2001 From: Matthias Theuermann Date: Thu, 4 Jul 2024 11:34:29 +0200 Subject: [PATCH] fix: removed unnecessary string conversion Signed-off-by: Matthias Theuermann --- internal/provider/integration_aws_resource.go | 8 ++++---- internal/provider/integration_azure_resource.go | 4 ++-- internal/provider/integration_gcp_resource.go | 4 ++-- internal/provider/integration_ms365_resource.go | 4 ++-- internal/provider/integration_slack_resource.go | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/provider/integration_aws_resource.go b/internal/provider/integration_aws_resource.go index a983367..2588105 100644 --- a/internal/provider/integration_aws_resource.go +++ b/internal/provider/integration_aws_resource.go @@ -290,15 +290,15 @@ func (r *integrationAwsResource) ImportState(ctx context.Context, req resource.I model := integrationAwsResourceModel{ SpaceId: types.StringValue(strings.Split(integration.Mrn, "/")[len(strings.Split(integration.Mrn, "/"))-3]), - Mrn: types.StringValue(string(integration.Mrn)), - Name: types.StringValue(string(integration.Name)), + Mrn: types.StringValue(integration.Mrn), + Name: types.StringValue(integration.Name), Credential: integrationAwsCredentialModel{ Role: &roleCredentialModel{ - RoleArn: types.StringValue(string(integration.ConfigurationOptions.HostedAwsConfigurationOptions.Role)), + RoleArn: types.StringValue(integration.ConfigurationOptions.HostedAwsConfigurationOptions.Role), ExternalId: basetypes.NewStringNull(), // cannot be imported }, Key: &accessKeyCredentialModel{ - AccessKey: types.StringValue(string(integration.ConfigurationOptions.HostedAwsConfigurationOptions.AccessKeyId)), + AccessKey: types.StringValue(integration.ConfigurationOptions.HostedAwsConfigurationOptions.AccessKeyId), SecretKey: basetypes.NewStringNull(), // cannot be imported }, }, diff --git a/internal/provider/integration_azure_resource.go b/internal/provider/integration_azure_resource.go index f5061f2..4b1d0e6 100644 --- a/internal/provider/integration_azure_resource.go +++ b/internal/provider/integration_azure_resource.go @@ -304,8 +304,8 @@ func (r *integrationAzureResource) ImportState(ctx context.Context, req resource model := integrationAzureResourceModel{ SpaceId: types.StringValue(strings.Split(integration.Mrn, "/")[len(strings.Split(integration.Mrn, "/"))-3]), - Mrn: types.StringValue(string(integration.Mrn)), - Name: types.StringValue(string(integration.Name)), + Mrn: types.StringValue(integration.Mrn), + Name: types.StringValue(integration.Name), ClientId: types.StringValue(integration.ConfigurationOptions.AzureConfigurationOptions.ClientId), TenantId: types.StringValue(integration.ConfigurationOptions.AzureConfigurationOptions.TenantId), SubscriptionAllowList: allowList, diff --git a/internal/provider/integration_gcp_resource.go b/internal/provider/integration_gcp_resource.go index 688e06b..e047b24 100644 --- a/internal/provider/integration_gcp_resource.go +++ b/internal/provider/integration_gcp_resource.go @@ -230,8 +230,8 @@ func (r *integrationGcpResource) ImportState(ctx context.Context, req resource.I } model := integrationGcpResourceModel{ - Mrn: types.StringValue(string(integration.Mrn)), - Name: types.StringValue(string(integration.Name)), + Mrn: types.StringValue(integration.Mrn), + Name: types.StringValue(integration.Name), SpaceId: types.StringValue(strings.Split(integration.Mrn, "/")[len(strings.Split(integration.Mrn, "/"))-3]), ProjectId: types.StringValue(integration.ConfigurationOptions.GcpConfigurationOptions.ProjectId), Credential: integrationGcpCredentialModel{ diff --git a/internal/provider/integration_ms365_resource.go b/internal/provider/integration_ms365_resource.go index 7ecb9ef..cdec3b5 100644 --- a/internal/provider/integration_ms365_resource.go +++ b/internal/provider/integration_ms365_resource.go @@ -232,8 +232,8 @@ func (r *integrationMs365Resource) ImportState(ctx context.Context, req resource } model := integrationMs365ResourceModel{ - Mrn: types.StringValue(string(integration.Mrn)), - Name: types.StringValue(string(integration.Name)), + Mrn: types.StringValue(integration.Mrn), + Name: types.StringValue(integration.Name), SpaceId: types.StringValue(strings.Split(integration.Mrn, "/")[len(strings.Split(integration.Mrn, "/"))-3]), TenantId: types.StringValue(integration.ConfigurationOptions.Ms365ConfigurationOptions.TenantId), ClientId: types.StringValue(integration.ConfigurationOptions.Ms365ConfigurationOptions.ClientId), diff --git a/internal/provider/integration_slack_resource.go b/internal/provider/integration_slack_resource.go index c300c81..59c13bd 100644 --- a/internal/provider/integration_slack_resource.go +++ b/internal/provider/integration_slack_resource.go @@ -217,8 +217,8 @@ func (r *integrationSlackResource) ImportState(ctx context.Context, req resource } model := integrationSlackResourceModel{ - Mrn: types.StringValue(string(integration.Mrn)), - Name: types.StringValue(string(integration.Name)), + Mrn: types.StringValue(integration.Mrn), + Name: types.StringValue(integration.Name), SlackToken: types.StringPointerValue(nil), SpaceId: types.StringValue(strings.Split(integration.Mrn, "/")[len(strings.Split(integration.Mrn, "/"))-3]), }