From a9b5908c1417c6c2e5dda09e8869a6309c5d501b Mon Sep 17 00:00:00 2001 From: Dana Fallon <8871189+danafallon@users.noreply.github.com> Date: Mon, 5 Aug 2024 18:36:11 -0700 Subject: [PATCH] Make port fields int32 --- internal/provider/deployment_resource.go | 4 ++-- internal/provider/destination_resource.go | 2 +- internal/provider/models/deployment_api_model.go | 2 +- internal/provider/models/deployment_resource_model.go | 4 ++-- internal/provider/models/destination_api_model.go | 2 +- internal/provider/models/destination_resource_model.go | 2 +- internal/provider/models/translate_deployment.go | 8 ++++---- internal/provider/models/translate_destination.go | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/internal/provider/deployment_resource.go b/internal/provider/deployment_resource.go index 0758777..83e5cf4 100644 --- a/internal/provider/deployment_resource.go +++ b/internal/provider/deployment_resource.go @@ -54,7 +54,7 @@ func (r *DeploymentResource) Schema(ctx context.Context, req resource.SchemaRequ Optional: true, Attributes: map[string]schema.Attribute{ "host": schema.StringAttribute{Required: true}, - "port": schema.Int64Attribute{Required: true}, + "port": schema.Int32Attribute{Required: true}, "user": schema.StringAttribute{Required: true}, "password": schema.StringAttribute{Required: true, Sensitive: true}, "database": schema.StringAttribute{Required: true}, @@ -64,7 +64,7 @@ func (r *DeploymentResource) Schema(ctx context.Context, req resource.SchemaRequ Optional: true, Attributes: map[string]schema.Attribute{ "host": schema.StringAttribute{Required: true}, - "port": schema.Int64Attribute{Required: true}, + "port": schema.Int32Attribute{Required: true}, "user": schema.StringAttribute{Required: true}, "password": schema.StringAttribute{Required: true, Sensitive: true}, "database": schema.StringAttribute{Required: true}, diff --git a/internal/provider/destination_resource.go b/internal/provider/destination_resource.go index 246924f..ba3458c 100644 --- a/internal/provider/destination_resource.go +++ b/internal/provider/destination_resource.go @@ -67,7 +67,7 @@ func (r *DestinationResource) Schema(ctx context.Context, req resource.SchemaReq Attributes: map[string]schema.Attribute{ "endpoint": schema.StringAttribute{Required: true}, "host": schema.StringAttribute{Required: true}, - "port": schema.Int64Attribute{Required: true}, + "port": schema.Int32Attribute{Required: true}, "username": schema.StringAttribute{Required: true}, "password": schema.StringAttribute{Required: true, Sensitive: true}, }, diff --git a/internal/provider/models/deployment_api_model.go b/internal/provider/models/deployment_api_model.go index 3a1d582..2e17e10 100644 --- a/internal/provider/models/deployment_api_model.go +++ b/internal/provider/models/deployment_api_model.go @@ -22,7 +22,7 @@ type SourceAPIModel struct { type SourceConfigAPIModel struct { Host string `json:"host"` SnapshotHost string `json:"snapshotHost"` - Port int64 `json:"port"` + Port int32 `json:"port"` User string `json:"user"` Password string `json:"password"` Database string `json:"database"` diff --git a/internal/provider/models/deployment_resource_model.go b/internal/provider/models/deployment_resource_model.go index 829cb44..17d0ebe 100644 --- a/internal/provider/models/deployment_resource_model.go +++ b/internal/provider/models/deployment_resource_model.go @@ -27,7 +27,7 @@ type SourceModel struct { type PostgresConfigModel struct { Host types.String `tfsdk:"host"` - Port types.Int64 `tfsdk:"port"` + Port types.Int32 `tfsdk:"port"` User types.String `tfsdk:"user"` Database types.String `tfsdk:"database"` Password types.String `tfsdk:"password"` @@ -35,7 +35,7 @@ type PostgresConfigModel struct { type MySQLConfigModel struct { Host types.String `tfsdk:"host"` - Port types.Int64 `tfsdk:"port"` + Port types.Int32 `tfsdk:"port"` User types.String `tfsdk:"user"` Database types.String `tfsdk:"database"` Password types.String `tfsdk:"password"` diff --git a/internal/provider/models/destination_api_model.go b/internal/provider/models/destination_api_model.go index 3574fe0..d7ced40 100644 --- a/internal/provider/models/destination_api_model.go +++ b/internal/provider/models/destination_api_model.go @@ -10,7 +10,7 @@ type DestinationAPIModel struct { type DestinationSharedConfigAPIModel struct { Host string `json:"host"` - Port int64 `json:"port"` + Port int32 `json:"port"` Endpoint string `json:"endpoint"` Username string `json:"username"` Password string `json:"password"` diff --git a/internal/provider/models/destination_resource_model.go b/internal/provider/models/destination_resource_model.go index c3ab588..84c7a1e 100644 --- a/internal/provider/models/destination_resource_model.go +++ b/internal/provider/models/destination_resource_model.go @@ -37,7 +37,7 @@ type BigQuerySharedConfigModel struct { type RedshiftSharedConfigModel struct { Endpoint types.String `tfsdk:"endpoint"` Host types.String `tfsdk:"host"` - Port types.Int64 `tfsdk:"port"` + Port types.Int32 `tfsdk:"port"` Username types.String `tfsdk:"username"` Password types.String `tfsdk:"password"` } diff --git a/internal/provider/models/translate_deployment.go b/internal/provider/models/translate_deployment.go index 3a7500a..29eca19 100644 --- a/internal/provider/models/translate_deployment.go +++ b/internal/provider/models/translate_deployment.go @@ -30,7 +30,7 @@ func DeploymentAPIToResourceModel(apiModel DeploymentAPIModel, resourceModel *De case string(PostgreSQL): resourceModel.Source.PostgresConfig = &PostgresConfigModel{ Host: types.StringValue(apiModel.Source.Config.Host), - Port: types.Int64Value(apiModel.Source.Config.Port), + Port: types.Int32Value(apiModel.Source.Config.Port), User: types.StringValue(apiModel.Source.Config.User), Password: types.StringValue(apiModel.Source.Config.Password), Database: types.StringValue(apiModel.Source.Config.Database), @@ -38,7 +38,7 @@ func DeploymentAPIToResourceModel(apiModel DeploymentAPIModel, resourceModel *De case string(MySQL): resourceModel.Source.MySQLConfig = &MySQLConfigModel{ Host: types.StringValue(apiModel.Source.Config.Host), - Port: types.Int64Value(apiModel.Source.Config.Port), + Port: types.Int32Value(apiModel.Source.Config.Port), User: types.StringValue(apiModel.Source.Config.User), Password: types.StringValue(apiModel.Source.Config.Password), Database: types.StringValue(apiModel.Source.Config.Database), @@ -95,7 +95,7 @@ func DeploymentResourceToAPIModel(resourceModel DeploymentResourceModel) Deploym case string(PostgreSQL): apiModel.Source.Config = SourceConfigAPIModel{ Host: resourceModel.Source.PostgresConfig.Host.ValueString(), - Port: resourceModel.Source.PostgresConfig.Port.ValueInt64(), + Port: resourceModel.Source.PostgresConfig.Port.ValueInt32(), User: resourceModel.Source.PostgresConfig.User.ValueString(), Password: resourceModel.Source.PostgresConfig.Password.ValueString(), Database: resourceModel.Source.PostgresConfig.Database.ValueString(), @@ -103,7 +103,7 @@ func DeploymentResourceToAPIModel(resourceModel DeploymentResourceModel) Deploym case string(MySQL): apiModel.Source.Config = SourceConfigAPIModel{ Host: resourceModel.Source.MySQLConfig.Host.ValueString(), - Port: resourceModel.Source.MySQLConfig.Port.ValueInt64(), + Port: resourceModel.Source.MySQLConfig.Port.ValueInt32(), User: resourceModel.Source.MySQLConfig.User.ValueString(), Password: resourceModel.Source.MySQLConfig.Password.ValueString(), Database: resourceModel.Source.MySQLConfig.Database.ValueString(), diff --git a/internal/provider/models/translate_destination.go b/internal/provider/models/translate_destination.go index e3dc3f6..e5c9308 100644 --- a/internal/provider/models/translate_destination.go +++ b/internal/provider/models/translate_destination.go @@ -30,7 +30,7 @@ func DestinationAPIToResourceModel(apiModel DestinationAPIModel, resourceModel * resourceModel.RedshiftConfig = &RedshiftSharedConfigModel{ Endpoint: types.StringValue(apiModel.Config.Endpoint), Host: types.StringValue(apiModel.Config.Host), - Port: types.Int64Value(apiModel.Config.Port), + Port: types.Int32Value(apiModel.Config.Port), Username: types.StringValue(apiModel.Config.Username), Password: types.StringValue(apiModel.Config.Password), } @@ -68,7 +68,7 @@ func DestinationResourceToAPIModel(resourceModel DestinationResourceModel) Desti apiModel.Config = DestinationSharedConfigAPIModel{ Endpoint: resourceModel.RedshiftConfig.Endpoint.ValueString(), Host: resourceModel.RedshiftConfig.Host.ValueString(), - Port: resourceModel.RedshiftConfig.Port.ValueInt64(), + Port: resourceModel.RedshiftConfig.Port.ValueInt32(), Username: resourceModel.RedshiftConfig.Username.ValueString(), Password: resourceModel.RedshiftConfig.Password.ValueString(), }