diff --git a/stackit/services/logme/credentials/resource.go b/stackit/services/logme/credentials/resource.go index bfc25a99..f0a1b6f0 100644 --- a/stackit/services/logme/credentials/resource.go +++ b/stackit/services/logme/credentials/resource.go @@ -25,9 +25,9 @@ import ( // Ensure the implementation satisfies the expected interfaces. var ( - _ resource.Resource = &logMeCredentialsResource{} - _ resource.ResourceWithConfigure = &logMeCredentialsResource{} - _ resource.ResourceWithImportState = &logMeCredentialsResource{} + _ resource.Resource = &credentialsResource{} + _ resource.ResourceWithConfigure = &credentialsResource{} + _ resource.ResourceWithImportState = &credentialsResource{} ) type Model struct { @@ -47,21 +47,21 @@ type Model struct { // NewCredentialsResource is a helper function to simplify the provider implementation. func NewCredentialsResource() resource.Resource { - return &logMeCredentialsResource{} + return &credentialsResource{} } // credentialsResource is the resource implementation. -type logMeCredentialsResource struct { +type credentialsResource struct { client *logme.APIClient } // Metadata returns the resource type name. -func (r *logMeCredentialsResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { +func (r *credentialsResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { resp.TypeName = req.ProviderTypeName + "_logme_credentials" } // Configure adds the provider configured client to the resource. -func (r *logMeCredentialsResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { +func (r *credentialsResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { // Prevent panic if the provider has not been configured. if req.ProviderData == nil { return @@ -97,7 +97,7 @@ func (r *logMeCredentialsResource) Configure(ctx context.Context, req resource.C } // Schema defines the schema for the resource. -func (r *logMeCredentialsResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { +func (r *credentialsResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { descriptions := map[string]string{ "main": "LogMe credentials resource schema.", "id": "Terraform's internal resource identifier. It is structured as \"`project_id`,`instance_id`,`credentials_id`\".", @@ -182,7 +182,7 @@ func (r *logMeCredentialsResource) Schema(_ context.Context, _ resource.SchemaRe } // Create creates the resource and sets the initial Terraform state. -func (r *logMeCredentialsResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { // nolint:gocritic // function signature required by Terraform +func (r *credentialsResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { // nolint:gocritic // function signature required by Terraform var model Model diags := req.Plan.Get(ctx, &model) resp.Diagnostics.Append(diags...) @@ -233,7 +233,7 @@ func (r *logMeCredentialsResource) Create(ctx context.Context, req resource.Crea } // Read refreshes the Terraform state with the latest data. -func (r *logMeCredentialsResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { // nolint:gocritic // function signature required by Terraform +func (r *credentialsResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { // nolint:gocritic // function signature required by Terraform var model Model diags := req.State.Get(ctx, &model) resp.Diagnostics.Append(diags...) @@ -270,13 +270,13 @@ func (r *logMeCredentialsResource) Read(ctx context.Context, req resource.ReadRe } // Update updates the resource and sets the updated Terraform state on success. -func (r *logMeCredentialsResource) Update(ctx context.Context, _ resource.UpdateRequest, resp *resource.UpdateResponse) { // nolint:gocritic // function signature required by Terraform +func (r *credentialsResource) Update(ctx context.Context, _ resource.UpdateRequest, resp *resource.UpdateResponse) { // nolint:gocritic // function signature required by Terraform // Update shouldn't be called core.LogAndAddError(ctx, &resp.Diagnostics, "Error updating credentials", "Credentials can't be updated") } // Delete deletes the resource and removes the Terraform state on success. -func (r *logMeCredentialsResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { // nolint:gocritic // function signature required by Terraform +func (r *credentialsResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { // nolint:gocritic // function signature required by Terraform var model Model diags := req.State.Get(ctx, &model) resp.Diagnostics.Append(diags...) @@ -306,7 +306,7 @@ func (r *logMeCredentialsResource) Delete(ctx context.Context, req resource.Dele // ImportState imports a resource into the Terraform state on success. // The expected format of the resource import identifier is: project_id,instance_id,credentials_id -func (r *logMeCredentialsResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { +func (r *credentialsResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { idParts := strings.Split(req.ID, core.Separator) if len(idParts) != 3 || idParts[0] == "" || idParts[1] == "" || idParts[2] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, diff --git a/stackit/services/mariadb/credentials/resource.go b/stackit/services/mariadb/credentials/resource.go index 93b0f113..b539b5cc 100644 --- a/stackit/services/mariadb/credentials/resource.go +++ b/stackit/services/mariadb/credentials/resource.go @@ -25,9 +25,9 @@ import ( // Ensure the implementation satisfies the expected interfaces. var ( - _ resource.Resource = &mariaDBCredentialsResource{} - _ resource.ResourceWithConfigure = &mariaDBCredentialsResource{} - _ resource.ResourceWithImportState = &mariaDBCredentialsResource{} + _ resource.Resource = &credentialsResource{} + _ resource.ResourceWithConfigure = &credentialsResource{} + _ resource.ResourceWithImportState = &credentialsResource{} ) type Model struct { @@ -47,21 +47,21 @@ type Model struct { // NewCredentialsResource is a helper function to simplify the provider implementation. func NewCredentialsResource() resource.Resource { - return &mariaDBCredentialsResource{} + return &credentialsResource{} } // credentialsResource is the resource implementation. -type mariaDBCredentialsResource struct { +type credentialsResource struct { client *mariadb.APIClient } // Metadata returns the resource type name. -func (r *mariaDBCredentialsResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { +func (r *credentialsResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { resp.TypeName = req.ProviderTypeName + "_mariadb_credentials" } // Configure adds the provider configured client to the resource. -func (r *mariaDBCredentialsResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { +func (r *credentialsResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { // Prevent panic if the provider has not been configured. if req.ProviderData == nil { return @@ -97,7 +97,7 @@ func (r *mariaDBCredentialsResource) Configure(ctx context.Context, req resource } // Schema defines the schema for the resource. -func (r *mariaDBCredentialsResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { +func (r *credentialsResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { descriptions := map[string]string{ "main": "MariaDB credentials resource schema.", "id": "Terraform's internal resource identifier. It is structured as \"`project_id`,`instance_id`,`credentials_id`\".", @@ -182,7 +182,7 @@ func (r *mariaDBCredentialsResource) Schema(_ context.Context, _ resource.Schema } // Create creates the resource and sets the initial Terraform state. -func (r *mariaDBCredentialsResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { // nolint:gocritic // function signature required by Terraform +func (r *credentialsResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { // nolint:gocritic // function signature required by Terraform var model Model diags := req.Plan.Get(ctx, &model) resp.Diagnostics.Append(diags...) @@ -233,7 +233,7 @@ func (r *mariaDBCredentialsResource) Create(ctx context.Context, req resource.Cr } // Read refreshes the Terraform state with the latest data. -func (r *mariaDBCredentialsResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { // nolint:gocritic // function signature required by Terraform +func (r *credentialsResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { // nolint:gocritic // function signature required by Terraform var model Model diags := req.State.Get(ctx, &model) resp.Diagnostics.Append(diags...) @@ -270,13 +270,13 @@ func (r *mariaDBCredentialsResource) Read(ctx context.Context, req resource.Read } // Update updates the resource and sets the updated Terraform state on success. -func (r *mariaDBCredentialsResource) Update(ctx context.Context, _ resource.UpdateRequest, resp *resource.UpdateResponse) { // nolint:gocritic // function signature required by Terraform +func (r *credentialsResource) Update(ctx context.Context, _ resource.UpdateRequest, resp *resource.UpdateResponse) { // nolint:gocritic // function signature required by Terraform // Update shouldn't be called core.LogAndAddError(ctx, &resp.Diagnostics, "Error updating credentials", "Credentials can't be updated") } // Delete deletes the resource and removes the Terraform state on success. -func (r *mariaDBCredentialsResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { // nolint:gocritic // function signature required by Terraform +func (r *credentialsResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { // nolint:gocritic // function signature required by Terraform var model Model diags := req.State.Get(ctx, &model) resp.Diagnostics.Append(diags...) @@ -306,7 +306,7 @@ func (r *mariaDBCredentialsResource) Delete(ctx context.Context, req resource.De // ImportState imports a resource into the Terraform state on success. // The expected format of the resource import identifier is: project_id,instance_id,credentials_id -func (r *mariaDBCredentialsResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { +func (r *credentialsResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { idParts := strings.Split(req.ID, core.Separator) if len(idParts) != 3 || idParts[0] == "" || idParts[1] == "" || idParts[2] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, diff --git a/stackit/services/opensearch/credentials/resource.go b/stackit/services/opensearch/credentials/resource.go index f6f5171b..12bd5f05 100644 --- a/stackit/services/opensearch/credentials/resource.go +++ b/stackit/services/opensearch/credentials/resource.go @@ -25,9 +25,9 @@ import ( // Ensure the implementation satisfies the expected interfaces. var ( - _ resource.Resource = &openSearchCredentialsResource{} - _ resource.ResourceWithConfigure = &openSearchCredentialsResource{} - _ resource.ResourceWithImportState = &openSearchCredentialsResource{} + _ resource.Resource = &credentialsResource{} + _ resource.ResourceWithConfigure = &credentialsResource{} + _ resource.ResourceWithImportState = &credentialsResource{} ) type Model struct { @@ -47,21 +47,21 @@ type Model struct { // NewCredentialsResource is a helper function to simplify the provider implementation. func NewCredentialsResource() resource.Resource { - return &openSearchCredentialsResource{} + return &credentialsResource{} } // credentialsResource is the resource implementation. -type openSearchCredentialsResource struct { +type credentialsResource struct { client *opensearch.APIClient } // Metadata returns the resource type name. -func (r *openSearchCredentialsResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { +func (r *credentialsResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { resp.TypeName = req.ProviderTypeName + "_opensearch_credentials" } // Configure adds the provider configured client to the resource. -func (r *openSearchCredentialsResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { +func (r *credentialsResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { // Prevent panic if the provider has not been configured. if req.ProviderData == nil { return @@ -97,7 +97,7 @@ func (r *openSearchCredentialsResource) Configure(ctx context.Context, req resou } // Schema defines the schema for the resource. -func (r *openSearchCredentialsResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { +func (r *credentialsResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { descriptions := map[string]string{ "main": "OpenSearch credentials resource schema.", "id": "Terraform's internal resource identifier. It is structured as \"`project_id`,`instance_id`,`credentials_id`\".", @@ -182,7 +182,7 @@ func (r *openSearchCredentialsResource) Schema(_ context.Context, _ resource.Sch } // Create creates the resource and sets the initial Terraform state. -func (r *openSearchCredentialsResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { // nolint:gocritic // function signature required by Terraform +func (r *credentialsResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { // nolint:gocritic // function signature required by Terraform var model Model diags := req.Plan.Get(ctx, &model) resp.Diagnostics.Append(diags...) @@ -233,7 +233,7 @@ func (r *openSearchCredentialsResource) Create(ctx context.Context, req resource } // Read refreshes the Terraform state with the latest data. -func (r *openSearchCredentialsResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { // nolint:gocritic // function signature required by Terraform +func (r *credentialsResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { // nolint:gocritic // function signature required by Terraform var model Model diags := req.State.Get(ctx, &model) resp.Diagnostics.Append(diags...) @@ -270,13 +270,13 @@ func (r *openSearchCredentialsResource) Read(ctx context.Context, req resource.R } // Update updates the resource and sets the updated Terraform state on success. -func (r *openSearchCredentialsResource) Update(ctx context.Context, _ resource.UpdateRequest, resp *resource.UpdateResponse) { // nolint:gocritic // function signature required by Terraform +func (r *credentialsResource) Update(ctx context.Context, _ resource.UpdateRequest, resp *resource.UpdateResponse) { // nolint:gocritic // function signature required by Terraform // Update shouldn't be called core.LogAndAddError(ctx, &resp.Diagnostics, "Error updating credentials", "Credentials can't be updated") } // Delete deletes the resource and removes the Terraform state on success. -func (r *openSearchCredentialsResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { // nolint:gocritic // function signature required by Terraform +func (r *credentialsResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { // nolint:gocritic // function signature required by Terraform var model Model diags := req.State.Get(ctx, &model) resp.Diagnostics.Append(diags...) @@ -306,7 +306,7 @@ func (r *openSearchCredentialsResource) Delete(ctx context.Context, req resource // ImportState imports a resource into the Terraform state on success. // The expected format of the resource import identifier is: project_id,instance_id,credentials_id -func (r *openSearchCredentialsResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { +func (r *credentialsResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { idParts := strings.Split(req.ID, core.Separator) if len(idParts) != 3 || idParts[0] == "" || idParts[1] == "" || idParts[2] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, diff --git a/stackit/services/postgresql/credentials/resource.go b/stackit/services/postgresql/credentials/resource.go index 9f399e9b..5551cecc 100644 --- a/stackit/services/postgresql/credentials/resource.go +++ b/stackit/services/postgresql/credentials/resource.go @@ -25,9 +25,9 @@ import ( // Ensure the implementation satisfies the expected interfaces. var ( - _ resource.Resource = &postgreSQLCredentialsResource{} - _ resource.ResourceWithConfigure = &postgreSQLCredentialsResource{} - _ resource.ResourceWithImportState = &postgreSQLCredentialsResource{} + _ resource.Resource = &credentialsResource{} + _ resource.ResourceWithConfigure = &credentialsResource{} + _ resource.ResourceWithImportState = &credentialsResource{} ) type Model struct { @@ -47,21 +47,21 @@ type Model struct { // NewCredentialsResource is a helper function to simplify the provider implementation. func NewCredentialsResource() resource.Resource { - return &postgreSQLCredentialsResource{} + return &credentialsResource{} } // credentialsResource is the resource implementation. -type postgreSQLCredentialsResource struct { +type credentialsResource struct { client *postgresql.APIClient } // Metadata returns the resource type name. -func (r *postgreSQLCredentialsResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { +func (r *credentialsResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { resp.TypeName = req.ProviderTypeName + "_postgresql_credentials" } // Configure adds the provider configured client to the resource. -func (r *postgreSQLCredentialsResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { +func (r *credentialsResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { // Prevent panic if the provider has not been configured. if req.ProviderData == nil { return @@ -97,7 +97,7 @@ func (r *postgreSQLCredentialsResource) Configure(ctx context.Context, req resou } // Schema defines the schema for the resource. -func (r *postgreSQLCredentialsResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { +func (r *credentialsResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { descriptions := map[string]string{ "main": "PostgreSQL credentials resource schema.", "id": "Terraform's internal resource identifier. It is structured as \"`project_id`,`instance_id`,`credentials_id`\".", @@ -182,7 +182,7 @@ func (r *postgreSQLCredentialsResource) Schema(_ context.Context, _ resource.Sch } // Create creates the resource and sets the initial Terraform state. -func (r *postgreSQLCredentialsResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { // nolint:gocritic // function signature required by Terraform +func (r *credentialsResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { // nolint:gocritic // function signature required by Terraform var model Model diags := req.Plan.Get(ctx, &model) resp.Diagnostics.Append(diags...) @@ -233,7 +233,7 @@ func (r *postgreSQLCredentialsResource) Create(ctx context.Context, req resource } // Read refreshes the Terraform state with the latest data. -func (r *postgreSQLCredentialsResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { // nolint:gocritic // function signature required by Terraform +func (r *credentialsResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { // nolint:gocritic // function signature required by Terraform var model Model diags := req.State.Get(ctx, &model) resp.Diagnostics.Append(diags...) @@ -270,13 +270,13 @@ func (r *postgreSQLCredentialsResource) Read(ctx context.Context, req resource.R } // Update updates the resource and sets the updated Terraform state on success. -func (r *postgreSQLCredentialsResource) Update(ctx context.Context, _ resource.UpdateRequest, resp *resource.UpdateResponse) { // nolint:gocritic // function signature required by Terraform +func (r *credentialsResource) Update(ctx context.Context, _ resource.UpdateRequest, resp *resource.UpdateResponse) { // nolint:gocritic // function signature required by Terraform // Update shouldn't be called core.LogAndAddError(ctx, &resp.Diagnostics, "Error updating credentials", "Credentials can't be updated") } // Delete deletes the resource and removes the Terraform state on success. -func (r *postgreSQLCredentialsResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { // nolint:gocritic // function signature required by Terraform +func (r *credentialsResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { // nolint:gocritic // function signature required by Terraform var model Model diags := req.State.Get(ctx, &model) resp.Diagnostics.Append(diags...) @@ -306,7 +306,7 @@ func (r *postgreSQLCredentialsResource) Delete(ctx context.Context, req resource // ImportState imports a resource into the Terraform state on success. // The expected format of the resource import identifier is: project_id,instance_id,credentials_id -func (r *postgreSQLCredentialsResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { +func (r *credentialsResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { idParts := strings.Split(req.ID, core.Separator) if len(idParts) != 3 || idParts[0] == "" || idParts[1] == "" || idParts[2] == "" { core.LogAndAddError(ctx, &resp.Diagnostics, diff --git a/stackit/services/rabbitmq/credentials/resource.go b/stackit/services/rabbitmq/credentials/resource.go index 9eaab878..bb835ebb 100644 --- a/stackit/services/rabbitmq/credentials/resource.go +++ b/stackit/services/rabbitmq/credentials/resource.go @@ -25,9 +25,9 @@ import ( // Ensure the implementation satisfies the expected interfaces. var ( - _ resource.Resource = &rabbitMQCredentialsResource{} - _ resource.ResourceWithConfigure = &rabbitMQCredentialsResource{} - _ resource.ResourceWithImportState = &rabbitMQCredentialsResource{} + _ resource.Resource = &credentialsResource{} + _ resource.ResourceWithConfigure = &credentialsResource{} + _ resource.ResourceWithImportState = &credentialsResource{} ) type Model struct { @@ -47,21 +47,21 @@ type Model struct { // NewCredentialsResource is a helper function to simplify the provider implementation. func NewCredentialsResource() resource.Resource { - return &rabbitMQCredentialsResource{} + return &credentialsResource{} } // credentialsResource is the resource implementation. -type rabbitMQCredentialsResource struct { +type credentialsResource struct { client *rabbitmq.APIClient } // Metadata returns the resource type name. -func (r *rabbitMQCredentialsResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { +func (r *credentialsResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { resp.TypeName = req.ProviderTypeName + "_rabbitmq_credentials" } // Configure adds the provider configured client to the resource. -func (r *rabbitMQCredentialsResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { +func (r *credentialsResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { // Prevent panic if the provider has not been configured. if req.ProviderData == nil { return @@ -97,7 +97,7 @@ func (r *rabbitMQCredentialsResource) Configure(ctx context.Context, req resourc } // Schema defines the schema for the resource. -func (r *rabbitMQCredentialsResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { +func (r *credentialsResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { descriptions := map[string]string{ "main": "RabbitMQ credentials resource schema.", "id": "Terraform's internal resource identifier. It is structured as \"`project_id`,`instance_id`,`credentials_id`\".", @@ -182,7 +182,7 @@ func (r *rabbitMQCredentialsResource) Schema(_ context.Context, _ resource.Schem } // Create creates the resource and sets the initial Terraform state. -func (r *rabbitMQCredentialsResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { // nolint:gocritic // function signature required by Terraform +func (r *credentialsResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { // nolint:gocritic // function signature required by Terraform var model Model diags := req.Plan.Get(ctx, &model) resp.Diagnostics.Append(diags...) @@ -233,7 +233,7 @@ func (r *rabbitMQCredentialsResource) Create(ctx context.Context, req resource.C } // Read refreshes the Terraform state with the latest data. -func (r *rabbitMQCredentialsResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { // nolint:gocritic // function signature required by Terraform +func (r *credentialsResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { // nolint:gocritic // function signature required by Terraform var model Model diags := req.State.Get(ctx, &model) resp.Diagnostics.Append(diags...) @@ -270,13 +270,13 @@ func (r *rabbitMQCredentialsResource) Read(ctx context.Context, req resource.Rea } // Update updates the resource and sets the updated Terraform state on success. -func (r *rabbitMQCredentialsResource) Update(ctx context.Context, _ resource.UpdateRequest, resp *resource.UpdateResponse) { // nolint:gocritic // function signature required by Terraform +func (r *credentialsResource) Update(ctx context.Context, _ resource.UpdateRequest, resp *resource.UpdateResponse) { // nolint:gocritic // function signature required by Terraform // Update shouldn't be called core.LogAndAddError(ctx, &resp.Diagnostics, "Error updating credentials", "Credentials can't be updated") } // Delete deletes the resource and removes the Terraform state on success. -func (r *rabbitMQCredentialsResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { // nolint:gocritic // function signature required by Terraform +func (r *credentialsResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { // nolint:gocritic // function signature required by Terraform var model Model diags := req.State.Get(ctx, &model) resp.Diagnostics.Append(diags...) @@ -306,7 +306,7 @@ func (r *rabbitMQCredentialsResource) Delete(ctx context.Context, req resource.D // ImportState imports a resource into the Terraform state on success. // The expected format of the resource import identifier is: project_id,instance_id,credentials_id -func (r *rabbitMQCredentialsResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { +func (r *credentialsResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { idParts := strings.Split(req.ID, core.Separator) if len(idParts) != 3 || idParts[0] == "" || idParts[1] == "" || idParts[2] == "" { core.LogAndAddError(ctx, &resp.Diagnostics,