diff --git a/docs/resources/client_vaultrecord.md b/docs/resources/client_vaultrecord.md index 6836e0c..377897b 100644 --- a/docs/resources/client_vaultrecord.md +++ b/docs/resources/client_vaultrecord.md @@ -22,6 +22,7 @@ description: |- ### Optional +- `additional` (List of String) - `color` (String) - `delete_tile` (Boolean) - `end_date` (String) diff --git a/docs/resources/clientapplication.md b/docs/resources/clientapplication.md index 9e4f42c..2920611 100644 --- a/docs/resources/clientapplication.md +++ b/docs/resources/clientapplication.md @@ -21,6 +21,7 @@ description: |- ### Optional +- `additional` (List of String) - `client_id` (String) - `delete_tile` (Boolean) - `groupclients` (Attributes List) (see [below for nested schema](#nestedatt--groupclients)) @@ -51,6 +52,7 @@ description: |- Optional: - `activation_required` (Boolean) +- `additional` (List of String) Read-Only: @@ -184,6 +186,7 @@ Required: Optional: +- `additional` (List of String) - `application_administration` (Boolean) - `audit_config` (Attributes) (see [below for nested schema](#nestedatt--groups--audit_config)) - `authorizing_group_auditing_uuid` (String) diff --git a/docs/resources/group.md b/docs/resources/group.md index d33a410..2646b5f 100644 --- a/docs/resources/group.md +++ b/docs/resources/group.md @@ -37,6 +37,7 @@ resource "keyhubpreview_group" "terra" { ### Optional - `accounts` (Attributes List) (see [below for nested schema](#nestedatt--accounts)) +- `additional` (List of String) - `admins` (Attributes List, Deprecated) (see [below for nested schema](#nestedatt--admins)) - `application_administration` (Boolean) - `audit_config` (Attributes) (see [below for nested schema](#nestedatt--audit_config)) @@ -102,6 +103,7 @@ Required: Optional: +- `additional` (List of String) - `end_date` (String) Read-Only: @@ -125,6 +127,7 @@ Required: Optional: +- `additional` (List of String) - `end_date` (String) Read-Only: @@ -182,6 +185,7 @@ Required: Optional: +- `additional` (List of String) - `client_uuid` (String) - `for_group_uuid` (String) - `for_system_uuid` (String) @@ -223,6 +227,7 @@ Required: Optional: +- `additional` (List of String) - `client_id` (String) - `ldap_client` (Attributes) (see [below for nested schema](#nestedatt--administered_clients--ldap_client)) - `o_auth2_client` (Attributes) (see [below for nested schema](#nestedatt--administered_clients--o_auth2_client)) @@ -339,6 +344,7 @@ Optional: - `abstract_provisioned_ldap` (Attributes) (see [below for nested schema](#nestedatt--administered_systems--abstract_provisioned_ldap)) - `active` (Boolean) +- `additional` (List of String) - `organizational_unit_uuid` (String) - `provisioned_a_d` (Attributes) (see [below for nested schema](#nestedatt--administered_systems--provisioned_a_d)) - `provisioned_azure_oidc_directory` (Attributes) (see [below for nested schema](#nestedatt--administered_systems--provisioned_azure_oidc_directory)) @@ -461,6 +467,7 @@ Required: Optional: +- `additional` (List of String) - `next_uid` (Number) Read-Only: @@ -563,6 +570,7 @@ Required: Optional: +- `additional` (List of String) - `application_administration` (Boolean) - `audit_config` (Attributes) (see [below for nested schema](#nestedatt--authorized_groups--items--audit_config)) - `authorizing_group_auditing_uuid` (String) @@ -657,6 +665,7 @@ Optional: Optional: - `activation_required` (Boolean) +- `additional` (List of String) Read-Only: @@ -704,6 +713,7 @@ Optional: - `abstract_provisioned_ldap` (Attributes) (see [below for nested schema](#nestedatt--content_administered_systems--abstract_provisioned_ldap)) - `active` (Boolean) +- `additional` (List of String) - `organizational_unit_uuid` (String) - `provisioned_a_d` (Attributes) (see [below for nested schema](#nestedatt--content_administered_systems--provisioned_a_d)) - `provisioned_azure_oidc_directory` (Attributes) (see [below for nested schema](#nestedatt--content_administered_systems--provisioned_azure_oidc_directory)) @@ -826,6 +836,7 @@ Required: Optional: +- `additional` (List of String) - `next_uid` (Number) Read-Only: @@ -1017,6 +1028,7 @@ Required: Optional: +- `additional` (List of String) - `end_date` (String) Read-Only: @@ -1040,6 +1052,7 @@ Required: Optional: +- `additional` (List of String) - `end_date` (String) Read-Only: @@ -1103,6 +1116,7 @@ Required: Optional: +- `additional` (List of String) - `client_id` (String) - `ldap_client` (Attributes) (see [below for nested schema](#nestedatt--owned_clients--ldap_client)) - `o_auth2_client` (Attributes) (see [below for nested schema](#nestedatt--owned_clients--o_auth2_client)) @@ -1217,6 +1231,7 @@ Required: Optional: - `active` (Boolean) +- `additional` (List of String) - `default_directory` (Boolean) - `helpdesk_group_uuid` (String) - `internal_directory` (Attributes) (see [below for nested schema](#nestedatt--owned_directories--internal_directory)) @@ -1336,6 +1351,7 @@ Required: Optional: +- `additional` (List of String) - `display_name` (String) Read-Only: @@ -1378,6 +1394,7 @@ Required: Optional: +- `additional` (List of String) - `description` (String) Read-Only: @@ -1425,6 +1442,7 @@ Optional: - `abstract_provisioned_ldap` (Attributes) (see [below for nested schema](#nestedatt--owned_systems--abstract_provisioned_ldap)) - `active` (Boolean) +- `additional` (List of String) - `organizational_unit_uuid` (String) - `provisioned_a_d` (Attributes) (see [below for nested schema](#nestedatt--owned_systems--provisioned_a_d)) - `provisioned_azure_oidc_directory` (Attributes) (see [below for nested schema](#nestedatt--owned_systems--provisioned_azure_oidc_directory)) @@ -1547,6 +1565,7 @@ Required: Optional: +- `additional` (List of String) - `next_uid` (Number) Read-Only: @@ -1642,6 +1661,7 @@ Required: Optional: - `accounts` (Attributes List) (see [below for nested schema](#nestedatt--recent_audits--accounts)) +- `additional` (List of String) - `comment` (String) Read-Only: @@ -1738,6 +1758,7 @@ Required: Optional: - `active` (Boolean) +- `additional` (List of String) - `description` (String) - `technical_administrator_uuid` (String) @@ -1782,6 +1803,7 @@ Required: Optional: - `activation_required` (Boolean) +- `additional` (List of String) Read-Only: @@ -1800,6 +1822,7 @@ Required: Optional: +- `additional` (List of String) - `display_name` (String) Read-Only: @@ -1902,6 +1925,7 @@ Optional: - `account_uuid` (String) - `active` (Boolean) +- `additional` (List of String) - `all_types` (Boolean) - `authentication_scheme` (String) - `basic_auth_password` (String) diff --git a/docs/resources/group_vaultrecord.md b/docs/resources/group_vaultrecord.md index f886bab..429d7d7 100644 --- a/docs/resources/group_vaultrecord.md +++ b/docs/resources/group_vaultrecord.md @@ -22,6 +22,7 @@ description: |- ### Optional +- `additional` (List of String) - `color` (String) - `delete_tile` (Boolean) - `end_date` (String) diff --git a/docs/resources/grouponsystem.md b/docs/resources/grouponsystem.md index 32b8694..401e358 100644 --- a/docs/resources/grouponsystem.md +++ b/docs/resources/grouponsystem.md @@ -24,6 +24,7 @@ description: |- ### Optional +- `additional` (List of String) - `display_name` (String) - `provgroups` (Attributes List) (see [below for nested schema](#nestedatt--provgroups)) - `service_accounts` (Attributes List) (see [below for nested schema](#nestedatt--service_accounts)) @@ -45,6 +46,7 @@ Required: Optional: - `activation_required` (Boolean) +- `additional` (List of String) Read-Only: @@ -63,6 +65,7 @@ Required: Optional: +- `additional` (List of String) - `display_name` (String) Read-Only: diff --git a/docs/resources/serviceaccount.md b/docs/resources/serviceaccount.md index 3b7deeb..fd91f09 100644 --- a/docs/resources/serviceaccount.md +++ b/docs/resources/serviceaccount.md @@ -24,6 +24,7 @@ description: |- ### Optional - `active` (Boolean) +- `additional` (List of String) - `description` (String) - `secret` (Attributes) (see [below for nested schema](#nestedatt--secret)) - `technical_administrator_uuid` (String) @@ -69,6 +70,7 @@ Required: Optional: +- `additional` (List of String) - `display_name` (String) Read-Only: diff --git a/examples/provider-install-verification/main.tf b/examples/provider-install-verification/main.tf index 61853bd..1ac8d36 100644 --- a/examples/provider-install-verification/main.tf +++ b/examples/provider-install-verification/main.tf @@ -34,6 +34,7 @@ resource "keyhubpreview_group" "terra" { client_uuid = "ebdf81ac-b02b-4335-9dc4-4a9bc4eb406d" value = "GROUP_FULL_VAULT_ACCESS" }] + additional = ["audit"] } resource "keyhubpreview_group_vaultrecord" "terrarecord" { diff --git a/internal/provider/datasource-account.go b/internal/provider/datasource-account.go index 6c8e88b..10074ea 100644 --- a/internal/provider/datasource-account.go +++ b/internal/provider/datasource-account.go @@ -72,8 +72,8 @@ func (d *accountDataSource) Read(ctx context.Context, req datasource.ReadRequest } tflog.Debug(ctx, "Reading account from Topicus KeyHub by UUID") - listValue, _ := data.Additional.ToListValue(ctx) - additional, _ := tfToSlice(listValue, func(val attr.Value, diags *diag.Diagnostics) string { + additionalBackup := data.Additional + additional, _ := tfToSlice(data.Additional, func(val attr.Value, diags *diag.Diagnostics) string { return val.(basetypes.StringValue).ValueString() }) uuid := data.UUID.ValueString() @@ -100,7 +100,7 @@ func (d *accountDataSource) Read(ctx context.Context, req datasource.ReadRequest } fillDataStructFromTFObjectDSAuthAccount(&data, tf) - data.Additional = listValue + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } diff --git a/internal/provider/datasource-certificate.go b/internal/provider/datasource-certificate.go index af7624b..6bfdf8b 100644 --- a/internal/provider/datasource-certificate.go +++ b/internal/provider/datasource-certificate.go @@ -72,8 +72,8 @@ func (d *certificateDataSource) Read(ctx context.Context, req datasource.ReadReq } tflog.Debug(ctx, "Reading certificate from Topicus KeyHub by UUID") - listValue, _ := data.Additional.ToListValue(ctx) - additional, _ := tfToSlice(listValue, func(val attr.Value, diags *diag.Diagnostics) string { + additionalBackup := data.Additional + additional, _ := tfToSlice(data.Additional, func(val attr.Value, diags *diag.Diagnostics) string { return val.(basetypes.StringValue).ValueString() }) uuid := data.UUID.ValueString() @@ -100,7 +100,7 @@ func (d *certificateDataSource) Read(ctx context.Context, req datasource.ReadReq } fillDataStructFromTFObjectDSCertificateCertificate(&data, tf) - data.Additional = listValue + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } diff --git a/internal/provider/datasource-client.go b/internal/provider/datasource-client.go index 2b0af9f..646bf40 100644 --- a/internal/provider/datasource-client.go +++ b/internal/provider/datasource-client.go @@ -72,8 +72,8 @@ func (d *clientDataSource) Read(ctx context.Context, req datasource.ReadRequest, } tflog.Debug(ctx, "Reading client from Topicus KeyHub by UUID") - listValue, _ := data.Additional.ToListValue(ctx) - additional, _ := tfToSlice(listValue, func(val attr.Value, diags *diag.Diagnostics) string { + additionalBackup := data.Additional + additional, _ := tfToSlice(data.Additional, func(val attr.Value, diags *diag.Diagnostics) string { return val.(basetypes.StringValue).ValueString() }) uuid := data.UUID.ValueString() @@ -100,7 +100,7 @@ func (d *clientDataSource) Read(ctx context.Context, req datasource.ReadRequest, } fillDataStructFromTFObjectDSClientClientApplication(&data, tf) - data.Additional = listValue + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } diff --git a/internal/provider/datasource-directory.go b/internal/provider/datasource-directory.go index d958ce6..aaa1ff2 100644 --- a/internal/provider/datasource-directory.go +++ b/internal/provider/datasource-directory.go @@ -72,8 +72,8 @@ func (d *directoryDataSource) Read(ctx context.Context, req datasource.ReadReque } tflog.Debug(ctx, "Reading directory from Topicus KeyHub by UUID") - listValue, _ := data.Additional.ToListValue(ctx) - additional, _ := tfToSlice(listValue, func(val attr.Value, diags *diag.Diagnostics) string { + additionalBackup := data.Additional + additional, _ := tfToSlice(data.Additional, func(val attr.Value, diags *diag.Diagnostics) string { return val.(basetypes.StringValue).ValueString() }) uuid := data.UUID.ValueString() @@ -100,7 +100,7 @@ func (d *directoryDataSource) Read(ctx context.Context, req datasource.ReadReque } fillDataStructFromTFObjectDSDirectoryAccountDirectory(&data, tf) - data.Additional = listValue + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } diff --git a/internal/provider/datasource-group.go b/internal/provider/datasource-group.go index 9f934ab..3565fae 100644 --- a/internal/provider/datasource-group.go +++ b/internal/provider/datasource-group.go @@ -72,8 +72,8 @@ func (d *groupDataSource) Read(ctx context.Context, req datasource.ReadRequest, } tflog.Debug(ctx, "Reading group from Topicus KeyHub by UUID") - listValue, _ := data.Additional.ToListValue(ctx) - additional, _ := tfToSlice(listValue, func(val attr.Value, diags *diag.Diagnostics) string { + additionalBackup := data.Additional + additional, _ := tfToSlice(data.Additional, func(val attr.Value, diags *diag.Diagnostics) string { return val.(basetypes.StringValue).ValueString() }) uuid := data.UUID.ValueString() @@ -100,7 +100,7 @@ func (d *groupDataSource) Read(ctx context.Context, req datasource.ReadRequest, } fillDataStructFromTFObjectDSGroupGroup(&data, tf) - data.Additional = listValue + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } diff --git a/internal/provider/datasource-groupclassification.go b/internal/provider/datasource-groupclassification.go index 1385653..49b557b 100644 --- a/internal/provider/datasource-groupclassification.go +++ b/internal/provider/datasource-groupclassification.go @@ -72,8 +72,8 @@ func (d *groupclassificationDataSource) Read(ctx context.Context, req datasource } tflog.Debug(ctx, "Reading groupclassification from Topicus KeyHub by UUID") - listValue, _ := data.Additional.ToListValue(ctx) - additional, _ := tfToSlice(listValue, func(val attr.Value, diags *diag.Diagnostics) string { + additionalBackup := data.Additional + additional, _ := tfToSlice(data.Additional, func(val attr.Value, diags *diag.Diagnostics) string { return val.(basetypes.StringValue).ValueString() }) uuid := data.UUID.ValueString() @@ -100,7 +100,7 @@ func (d *groupclassificationDataSource) Read(ctx context.Context, req datasource } fillDataStructFromTFObjectDSGroupGroupClassification(&data, tf) - data.Additional = listValue + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } diff --git a/internal/provider/datasource-organizationalunit.go b/internal/provider/datasource-organizationalunit.go index 5dbc722..1252aab 100644 --- a/internal/provider/datasource-organizationalunit.go +++ b/internal/provider/datasource-organizationalunit.go @@ -72,8 +72,8 @@ func (d *organizationalunitDataSource) Read(ctx context.Context, req datasource. } tflog.Debug(ctx, "Reading organizationalunit from Topicus KeyHub by UUID") - listValue, _ := data.Additional.ToListValue(ctx) - additional, _ := tfToSlice(listValue, func(val attr.Value, diags *diag.Diagnostics) string { + additionalBackup := data.Additional + additional, _ := tfToSlice(data.Additional, func(val attr.Value, diags *diag.Diagnostics) string { return val.(basetypes.StringValue).ValueString() }) uuid := data.UUID.ValueString() @@ -100,7 +100,7 @@ func (d *organizationalunitDataSource) Read(ctx context.Context, req datasource. } fillDataStructFromTFObjectDSOrganizationOrganizationalUnit(&data, tf) - data.Additional = listValue + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } diff --git a/internal/provider/datasource-serviceaccount.go b/internal/provider/datasource-serviceaccount.go index f76d4bf..710482c 100644 --- a/internal/provider/datasource-serviceaccount.go +++ b/internal/provider/datasource-serviceaccount.go @@ -72,8 +72,8 @@ func (d *serviceaccountDataSource) Read(ctx context.Context, req datasource.Read } tflog.Debug(ctx, "Reading serviceaccount from Topicus KeyHub by UUID") - listValue, _ := data.Additional.ToListValue(ctx) - additional, _ := tfToSlice(listValue, func(val attr.Value, diags *diag.Diagnostics) string { + additionalBackup := data.Additional + additional, _ := tfToSlice(data.Additional, func(val attr.Value, diags *diag.Diagnostics) string { return val.(basetypes.StringValue).ValueString() }) uuid := data.UUID.ValueString() @@ -100,7 +100,7 @@ func (d *serviceaccountDataSource) Read(ctx context.Context, req datasource.Read } fillDataStructFromTFObjectDSServiceaccountServiceAccount(&data, tf) - data.Additional = listValue + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } diff --git a/internal/provider/datasource-system.go b/internal/provider/datasource-system.go index 1f91ce8..8ab8f59 100644 --- a/internal/provider/datasource-system.go +++ b/internal/provider/datasource-system.go @@ -72,8 +72,8 @@ func (d *systemDataSource) Read(ctx context.Context, req datasource.ReadRequest, } tflog.Debug(ctx, "Reading system from Topicus KeyHub by UUID") - listValue, _ := data.Additional.ToListValue(ctx) - additional, _ := tfToSlice(listValue, func(val attr.Value, diags *diag.Diagnostics) string { + additionalBackup := data.Additional + additional, _ := tfToSlice(data.Additional, func(val attr.Value, diags *diag.Diagnostics) string { return val.(basetypes.StringValue).ValueString() }) uuid := data.UUID.ValueString() @@ -100,7 +100,7 @@ func (d *systemDataSource) Read(ctx context.Context, req datasource.ReadRequest, } fillDataStructFromTFObjectDSProvisioningProvisionedSystem(&data, tf) - data.Additional = listValue + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } diff --git a/internal/provider/datasource-vaultrecord.go b/internal/provider/datasource-vaultrecord.go index c436542..9b4a7da 100644 --- a/internal/provider/datasource-vaultrecord.go +++ b/internal/provider/datasource-vaultrecord.go @@ -72,8 +72,8 @@ func (d *vaultrecordDataSource) Read(ctx context.Context, req datasource.ReadReq } tflog.Debug(ctx, "Reading vaultrecord from Topicus KeyHub by UUID") - listValue, _ := data.Additional.ToListValue(ctx) - additional, _ := tfToSlice(listValue, func(val attr.Value, diags *diag.Diagnostics) string { + additionalBackup := data.Additional + additional, _ := tfToSlice(data.Additional, func(val attr.Value, diags *diag.Diagnostics) string { return val.(basetypes.StringValue).ValueString() }) uuid := data.UUID.ValueString() @@ -100,7 +100,7 @@ func (d *vaultrecordDataSource) Read(ctx context.Context, req datasource.ReadReq } fillDataStructFromTFObjectDSVaultVaultRecord(&data, tf) - data.Additional = listValue + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } diff --git a/internal/provider/datasource-webhook.go b/internal/provider/datasource-webhook.go index 2bf9fa6..7fbc7a0 100644 --- a/internal/provider/datasource-webhook.go +++ b/internal/provider/datasource-webhook.go @@ -72,8 +72,8 @@ func (d *webhookDataSource) Read(ctx context.Context, req datasource.ReadRequest } tflog.Debug(ctx, "Reading webhook from Topicus KeyHub by UUID") - listValue, _ := data.Additional.ToListValue(ctx) - additional, _ := tfToSlice(listValue, func(val attr.Value, diags *diag.Diagnostics) string { + additionalBackup := data.Additional + additional, _ := tfToSlice(data.Additional, func(val attr.Value, diags *diag.Diagnostics) string { return val.(basetypes.StringValue).ValueString() }) uuid := data.UUID.ValueString() @@ -100,7 +100,7 @@ func (d *webhookDataSource) Read(ctx context.Context, req datasource.ReadRequest } fillDataStructFromTFObjectDSWebhookWebhook(&data, tf) - data.Additional = listValue + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } diff --git a/internal/provider/full-data-struct-rs.go b/internal/provider/full-data-struct-rs.go index c48718c..909607f 100644 --- a/internal/provider/full-data-struct-rs.go +++ b/internal/provider/full-data-struct-rs.go @@ -103,6 +103,7 @@ type clientApplicationVaultVaultRecordDataRS struct { Name types.String `tfsdk:"name"` ShareEndTime types.String `tfsdk:"share_end_time"` UUID types.String `tfsdk:"uuid"` + Additional types.List `tfsdk:"additional"` Audit types.Object `tfsdk:"audit" tkhao:"audit"` DeleteTile types.Bool `tfsdk:"delete_tile" tkhao:"deleteTile"` ParentUUID types.String `tfsdk:"parent_uuid" tkhao:"parent"` @@ -133,6 +134,7 @@ type clientClientApplicationDataRS struct { Scopes types.List `tfsdk:"scopes"` SsoApplication types.Bool `tfsdk:"sso_application"` UUID types.String `tfsdk:"uuid"` + Additional types.List `tfsdk:"additional"` Audit types.Object `tfsdk:"audit" tkhao:"audit"` DeleteTile types.Bool `tfsdk:"delete_tile" tkhao:"deleteTile"` Groupclients types.List `tfsdk:"groupclients" tkhao:"groupclients"` @@ -217,6 +219,7 @@ var clientOAuth2ClientPermissionAttrTypesRSRecurse = objectAttrsTypeRSClientOAut type clientOAuth2ClientPermissionDataRS struct { Links types.List `tfsdk:"links"` Permissions types.List `tfsdk:"permissions"` + Additional types.List `tfsdk:"additional"` Audit types.Object `tfsdk:"audit" tkhao:"audit"` ForGroupUUID types.String `tfsdk:"for_group_uuid"` ForSystemUUID types.String `tfsdk:"for_system_uuid"` @@ -229,6 +232,7 @@ var clientOAuth2ClientPermissionWithClientAttrTypesRSRecurse = objectAttrsTypeRS type clientOAuth2ClientPermissionWithClientDataRS struct { Links types.List `tfsdk:"links"` Permissions types.List `tfsdk:"permissions"` + Additional types.List `tfsdk:"additional"` Audit types.Object `tfsdk:"audit" tkhao:"audit"` ForGroupUUID types.String `tfsdk:"for_group_uuid"` ForSystemUUID types.String `tfsdk:"for_system_uuid"` @@ -271,6 +275,7 @@ type directoryAccountDirectoryDataRS struct { DirectoryAccountDirectoryPrimerType types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` UUID types.String `tfsdk:"uuid"` + Additional types.List `tfsdk:"additional"` Audit types.Object `tfsdk:"audit" tkhao:"audit"` Markers types.Object `tfsdk:"markers" tkhao:"markers"` Status types.Object `tfsdk:"status" tkhao:"status"` @@ -413,6 +418,7 @@ type groupGroupDataRS struct { Name types.String `tfsdk:"name"` OrganizationalUnitUUID types.String `tfsdk:"organizational_unit_uuid"` UUID types.String `tfsdk:"uuid"` + Additional types.List `tfsdk:"additional"` Accounts types.List `tfsdk:"accounts" tkhao:"accounts"` AdministeredClients types.List `tfsdk:"administered_clients" tkhao:"administeredClients"` AdministeredSystems types.List `tfsdk:"administered_systems" tkhao:"administeredSystems"` @@ -467,6 +473,7 @@ var groupGroupAccountAttrTypesRSRecurse = objectAttrsTypeRSGroupGroupAccount(tru type groupGroupAccountDataRS struct { UUID types.String `tfsdk:"uuid"` + Additional types.List `tfsdk:"additional"` Audit types.Object `tfsdk:"audit" tkhao:"audit"` DirectoryUUID types.String `tfsdk:"directory_uuid"` DisconnectedNested types.Bool `tfsdk:"disconnected_nested"` @@ -499,6 +506,7 @@ var groupGroupAuditAttrTypesRSRecurse = objectAttrsTypeRSGroupGroupAudit(true) type groupGroupAuditDataRS struct { Links types.List `tfsdk:"links"` Permissions types.List `tfsdk:"permissions"` + Additional types.List `tfsdk:"additional"` Accounts types.List `tfsdk:"accounts"` Audit types.Object `tfsdk:"audit" tkhao:"audit"` Comment types.String `tfsdk:"comment"` @@ -586,6 +594,7 @@ var groupGroupClientAttrTypesRSRecurse = objectAttrsTypeRSGroupGroupClient(true) type groupGroupClientDataRS struct { Links types.List `tfsdk:"links"` Permissions types.List `tfsdk:"permissions"` + Additional types.List `tfsdk:"additional"` ActivationRequired types.Bool `tfsdk:"activation_required"` Audit types.Object `tfsdk:"audit" tkhao:"audit"` ClientUUID types.String `tfsdk:"client_uuid"` @@ -685,6 +694,7 @@ var groupProvisioningGroupAttrTypesRSRecurse = objectAttrsTypeRSGroupProvisionin type groupProvisioningGroupDataRS struct { Links types.List `tfsdk:"links"` Permissions types.List `tfsdk:"permissions"` + Additional types.List `tfsdk:"additional"` ActivationRequired types.Bool `tfsdk:"activation_required"` Audit types.Object `tfsdk:"audit" tkhao:"audit"` GroupUUID types.String `tfsdk:"group_uuid"` @@ -716,6 +726,7 @@ type groupVaultVaultRecordDataRS struct { Name types.String `tfsdk:"name"` ShareEndTime types.String `tfsdk:"share_end_time"` UUID types.String `tfsdk:"uuid"` + Additional types.List `tfsdk:"additional"` Audit types.Object `tfsdk:"audit" tkhao:"audit"` DeleteTile types.Bool `tfsdk:"delete_tile" tkhao:"deleteTile"` ParentUUID types.String `tfsdk:"parent_uuid" tkhao:"parent"` @@ -774,6 +785,7 @@ type nestedProvisioningGroupOnSystemDataRS struct { NameInSystem types.String `tfsdk:"name_in_system"` ProvisioningGroupOnSystemPrimerType types.String `tfsdk:"type"` ShortNameInSystem types.String `tfsdk:"short_name_in_system"` + Additional types.List `tfsdk:"additional"` Audit types.Object `tfsdk:"audit" tkhao:"audit"` Provgroups types.List `tfsdk:"provgroups" tkhao:"provgroups"` ServiceAccounts types.List `tfsdk:"service_accounts" tkhao:"serviceAccounts"` @@ -788,6 +800,7 @@ type organizationOrganizationalUnitDataRS struct { Permissions types.List `tfsdk:"permissions"` Name types.String `tfsdk:"name"` UUID types.String `tfsdk:"uuid"` + Additional types.List `tfsdk:"additional"` Audit types.Object `tfsdk:"audit" tkhao:"audit"` CreateAsParentOf types.List `tfsdk:"create_as_parent_of" tkhao:"createAsParentOf"` Depth types.Int64 `tfsdk:"depth"` @@ -870,6 +883,7 @@ type provisioningGroupOnSystemDataRS struct { NameInSystem types.String `tfsdk:"name_in_system"` ProvisioningGroupOnSystemPrimerType types.String `tfsdk:"type"` ShortNameInSystem types.String `tfsdk:"short_name_in_system"` + Additional types.List `tfsdk:"additional"` Audit types.Object `tfsdk:"audit" tkhao:"audit"` Provgroups types.List `tfsdk:"provgroups" tkhao:"provgroups"` ServiceAccounts types.List `tfsdk:"service_accounts" tkhao:"serviceAccounts"` @@ -925,6 +939,7 @@ var provisioningProvisionNumberSequenceAttrTypesRSRecurse = objectAttrsTypeRSPro type provisioningProvisionNumberSequenceDataRS struct { Links types.List `tfsdk:"links"` Permissions types.List `tfsdk:"permissions"` + Additional types.List `tfsdk:"additional"` AccountCount types.Int64 `tfsdk:"account_count"` Audit types.Object `tfsdk:"audit" tkhao:"audit"` Systems types.List `tfsdk:"systems" tkhao:"systems"` @@ -951,9 +966,10 @@ var provisioningProvisionedAccountAttrTypesRS = objectAttrsTypeRSProvisioningPro var provisioningProvisionedAccountAttrTypesRSRecurse = objectAttrsTypeRSProvisioningProvisionedAccount(true) type provisioningProvisionedAccountDataRS struct { - UUID types.String `tfsdk:"uuid"` - Audit types.Object `tfsdk:"audit" tkhao:"audit"` - UID types.Int64 `tfsdk:"uid"` + UUID types.String `tfsdk:"uuid"` + Additional types.List `tfsdk:"additional"` + Audit types.Object `tfsdk:"audit" tkhao:"audit"` + UID types.Int64 `tfsdk:"uid"` } var provisioningProvisionedAccount_additionalObjectsAttrTypesRS = objectAttrsTypeRSProvisioningProvisionedAccount_additionalObjects(false) @@ -1035,6 +1051,7 @@ type provisioningProvisionedSystemDataRS struct { OrganizationalUnitUUID types.String `tfsdk:"organizational_unit_uuid"` ProvisioningProvisionedSystemPrimerType types.String `tfsdk:"type"` UUID types.String `tfsdk:"uuid"` + Additional types.List `tfsdk:"additional"` AccountCount types.Int64 `tfsdk:"account_count"` Account types.Object `tfsdk:"account" tkhao:"account"` Audit types.Object `tfsdk:"audit" tkhao:"audit"` @@ -1126,6 +1143,7 @@ type serviceaccountServiceAccountDataRS struct { SystemUUID types.String `tfsdk:"system_uuid"` Username types.String `tfsdk:"username"` UUID types.String `tfsdk:"uuid"` + Additional types.List `tfsdk:"additional"` Audit types.Object `tfsdk:"audit" tkhao:"audit"` Groups types.List `tfsdk:"groups" tkhao:"groups"` Secret types.Object `tfsdk:"secret" tkhao:"secret"` @@ -1145,6 +1163,7 @@ type serviceaccountServiceAccountGroupDataRS struct { NameInSystem types.String `tfsdk:"name_in_system"` ProvisioningGroupOnSystemPrimerType types.String `tfsdk:"type"` ShortNameInSystem types.String `tfsdk:"short_name_in_system"` + Additional types.List `tfsdk:"additional"` Audit types.Object `tfsdk:"audit" tkhao:"audit"` } @@ -1240,6 +1259,7 @@ type vaultVaultRecordDataRS struct { Name types.String `tfsdk:"name"` ShareEndTime types.String `tfsdk:"share_end_time"` UUID types.String `tfsdk:"uuid"` + Additional types.List `tfsdk:"additional"` Audit types.Object `tfsdk:"audit" tkhao:"audit"` DeleteTile types.Bool `tfsdk:"delete_tile" tkhao:"deleteTile"` ParentUUID types.String `tfsdk:"parent_uuid" tkhao:"parent"` @@ -1325,6 +1345,7 @@ var webhookWebhookAttrTypesRSRecurse = objectAttrsTypeRSWebhookWebhook(true) type webhookWebhookDataRS struct { Links types.List `tfsdk:"links"` Permissions types.List `tfsdk:"permissions"` + Additional types.List `tfsdk:"additional"` AccountUUID types.String `tfsdk:"account_uuid"` Active types.Bool `tfsdk:"active"` Audit types.Object `tfsdk:"audit" tkhao:"audit"` diff --git a/internal/provider/full-helpers.go b/internal/provider/full-helpers.go index e49fa1d..4b9508b 100644 --- a/internal/provider/full-helpers.go +++ b/internal/provider/full-helpers.go @@ -12,6 +12,8 @@ import ( "strings" "time" + "golang.org/x/exp/slices" + "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/diag" rsschema "github.com/hashicorp/terraform-plugin-framework/resource/schema" @@ -569,16 +571,19 @@ func setAttributeValue(ctx context.Context, tf basetypes.ObjectValue, key string return types.ObjectValueMust(tf.AttributeTypes(ctx), obj) } -func collectAdditional(data any) []string { +func collectAdditional(ctx context.Context, data any, additional types.List) []string { + listValue, _ := additional.ToListValue(ctx) + ret, _ := tfToSlice(listValue, func(val attr.Value, diags *diag.Diagnostics) string { + return val.(basetypes.StringValue).ValueString() + }) reflectValue := reflect.ValueOf(data) reflectType := reflectValue.Type() - ret := make([]string, 0) for i := 0; i < reflectType.NumField(); i++ { field := reflectType.Field(i) tkhoa := field.Tag.Get("tkhao") if tkhoa != "" { attr := reflectValue.Field(i).Interface().(attr.Value) - if !attr.IsNull() && !attr.IsUnknown() { + if !attr.IsNull() && !attr.IsUnknown() && !slices.Contains(ret, tkhoa) { ret = append(ret, tkhoa) } } diff --git a/internal/provider/full-object-attrs-rs.go b/internal/provider/full-object-attrs-rs.go index 32c30e9..04b5a8a 100644 --- a/internal/provider/full-object-attrs-rs.go +++ b/internal/provider/full-object-attrs-rs.go @@ -105,6 +105,7 @@ func objectAttrsTypeRSClientApplicationVaultVaultRecord(recurse bool) map[string objectAttrs["name"] = types.StringType objectAttrs["share_end_time"] = types.StringType objectAttrs["uuid"] = types.StringType + objectAttrs["additional"] = types.ListType{ElemType: types.StringType} objectAttrs["derived"] = types.BoolType objectAttrs["end_date"] = types.StringType objectAttrs["filename"] = types.StringType @@ -134,6 +135,7 @@ func objectAttrsTypeRSClientClientApplication(recurse bool) map[string]attr.Type objectAttrs["scopes"] = types.ListType{ElemType: types.StringType} objectAttrs["sso_application"] = types.BoolType objectAttrs["uuid"] = types.StringType + objectAttrs["additional"] = types.ListType{ElemType: types.StringType} objectAttrs["last_modified_at"] = types.StringType objectAttrs["owner_uuid"] = types.StringType objectAttrs["technical_administrator_uuid"] = types.StringType @@ -208,6 +210,7 @@ func objectAttrsTypeRSClientOAuth2ClientPermission(recurse bool) map[string]attr } objectAttrs["links"] = types.ListType{ElemType: types.ObjectType{AttrTypes: objectAttrsTypeRSRestLink(recurse)}} objectAttrs["permissions"] = types.ListType{ElemType: types.ObjectType{AttrTypes: objectAttrsTypeRSAuthPermission(recurse)}} + objectAttrs["additional"] = types.ListType{ElemType: types.StringType} objectAttrs["for_group_uuid"] = types.StringType objectAttrs["for_system_uuid"] = types.StringType objectAttrs["value"] = types.StringType @@ -221,6 +224,7 @@ func objectAttrsTypeRSClientOAuth2ClientPermissionWithClient(recurse bool) map[s } objectAttrs["links"] = types.ListType{ElemType: types.ObjectType{AttrTypes: objectAttrsTypeRSRestLink(recurse)}} objectAttrs["permissions"] = types.ListType{ElemType: types.ObjectType{AttrTypes: objectAttrsTypeRSAuthPermission(recurse)}} + objectAttrs["additional"] = types.ListType{ElemType: types.StringType} objectAttrs["for_group_uuid"] = types.StringType objectAttrs["for_system_uuid"] = types.StringType objectAttrs["value"] = types.StringType @@ -263,6 +267,7 @@ func objectAttrsTypeRSDirectoryAccountDirectory(recurse bool) map[string]attr.Ty objectAttrs["type"] = types.StringType objectAttrs["name"] = types.StringType objectAttrs["uuid"] = types.StringType + objectAttrs["additional"] = types.ListType{ElemType: types.StringType} objectAttrs["base_organizational_unit_uuid"] = types.StringType objectAttrs["default_directory"] = types.BoolType objectAttrs["helpdesk_group_uuid"] = types.StringType @@ -419,6 +424,7 @@ func objectAttrsTypeRSGroupGroup(recurse bool) map[string]attr.Type { objectAttrs["name"] = types.StringType objectAttrs["organizational_unit_uuid"] = types.StringType objectAttrs["uuid"] = types.StringType + objectAttrs["additional"] = types.ListType{ElemType: types.StringType} objectAttrs["application_administration"] = types.BoolType objectAttrs["audit_config"] = types.ObjectType{AttrTypes: objectAttrsTypeRSGroupGroupAuditConfig(false)} objectAttrs["audit_requested"] = types.BoolType @@ -448,6 +454,7 @@ func objectAttrsTypeRSGroupGroupAccount(recurse bool) map[string]attr.Type { objectAttrs["audit"] = types.ObjectType{AttrTypes: objectAttrsTypeRSAuditInfo(false)} } objectAttrs["uuid"] = types.StringType + objectAttrs["additional"] = types.ListType{ElemType: types.StringType} objectAttrs["directory_uuid"] = types.StringType objectAttrs["disconnected_nested"] = types.BoolType objectAttrs["end_date"] = types.StringType @@ -479,6 +486,7 @@ func objectAttrsTypeRSGroupGroupAudit(recurse bool) map[string]attr.Type { } objectAttrs["links"] = types.ListType{ElemType: types.ObjectType{AttrTypes: objectAttrsTypeRSRestLink(recurse)}} objectAttrs["permissions"] = types.ListType{ElemType: types.ObjectType{AttrTypes: objectAttrsTypeRSAuthPermission(recurse)}} + objectAttrs["additional"] = types.ListType{ElemType: types.StringType} objectAttrs["accounts"] = types.ListType{ElemType: types.ObjectType{AttrTypes: objectAttrsTypeRSGroupGroupAuditAccount(false)}} objectAttrs["comment"] = types.StringType objectAttrs["created_at"] = types.StringType @@ -561,6 +569,7 @@ func objectAttrsTypeRSGroupGroupClient(recurse bool) map[string]attr.Type { } objectAttrs["links"] = types.ListType{ElemType: types.ObjectType{AttrTypes: objectAttrsTypeRSRestLink(recurse)}} objectAttrs["permissions"] = types.ListType{ElemType: types.ObjectType{AttrTypes: objectAttrsTypeRSAuthPermission(recurse)}} + objectAttrs["additional"] = types.ListType{ElemType: types.StringType} objectAttrs["activation_required"] = types.BoolType objectAttrs["client_uuid"] = types.StringType objectAttrs["group_uuid"] = types.StringType @@ -654,6 +663,7 @@ func objectAttrsTypeRSGroupProvisioningGroup(recurse bool) map[string]attr.Type } objectAttrs["links"] = types.ListType{ElemType: types.ObjectType{AttrTypes: objectAttrsTypeRSRestLink(recurse)}} objectAttrs["permissions"] = types.ListType{ElemType: types.ObjectType{AttrTypes: objectAttrsTypeRSAuthPermission(recurse)}} + objectAttrs["additional"] = types.ListType{ElemType: types.StringType} objectAttrs["activation_required"] = types.BoolType objectAttrs["group_uuid"] = types.StringType objectAttrs["group_on_system"] = types.ObjectType{AttrTypes: objectAttrsTypeRSProvisioningGroupOnSystem(false)} @@ -692,6 +702,7 @@ func objectAttrsTypeRSGroupVaultVaultRecord(recurse bool) map[string]attr.Type { objectAttrs["name"] = types.StringType objectAttrs["share_end_time"] = types.StringType objectAttrs["uuid"] = types.StringType + objectAttrs["additional"] = types.ListType{ElemType: types.StringType} objectAttrs["derived"] = types.BoolType objectAttrs["end_date"] = types.StringType objectAttrs["filename"] = types.StringType @@ -741,6 +752,7 @@ func objectAttrsTypeRSNestedProvisioningGroupOnSystem(recurse bool) map[string]a objectAttrs["name_in_system"] = types.StringType objectAttrs["type"] = types.StringType objectAttrs["short_name_in_system"] = types.StringType + objectAttrs["additional"] = types.ListType{ElemType: types.StringType} objectAttrs["owner_uuid"] = types.StringType return objectAttrs } @@ -755,6 +767,7 @@ func objectAttrsTypeRSOrganizationOrganizationalUnit(recurse bool) map[string]at objectAttrs["permissions"] = types.ListType{ElemType: types.ObjectType{AttrTypes: objectAttrsTypeRSAuthPermission(recurse)}} objectAttrs["name"] = types.StringType objectAttrs["uuid"] = types.StringType + objectAttrs["additional"] = types.ListType{ElemType: types.StringType} objectAttrs["depth"] = types.Int64Type objectAttrs["description"] = types.StringType objectAttrs["owner_uuid"] = types.StringType @@ -833,6 +846,7 @@ func objectAttrsTypeRSProvisioningGroupOnSystem(recurse bool) map[string]attr.Ty objectAttrs["name_in_system"] = types.StringType objectAttrs["type"] = types.StringType objectAttrs["short_name_in_system"] = types.StringType + objectAttrs["additional"] = types.ListType{ElemType: types.StringType} objectAttrs["owner_uuid"] = types.StringType return objectAttrs } @@ -883,6 +897,7 @@ func objectAttrsTypeRSProvisioningProvisionNumberSequence(recurse bool) map[stri } objectAttrs["links"] = types.ListType{ElemType: types.ObjectType{AttrTypes: objectAttrsTypeRSRestLink(recurse)}} objectAttrs["permissions"] = types.ListType{ElemType: types.ObjectType{AttrTypes: objectAttrsTypeRSAuthPermission(recurse)}} + objectAttrs["additional"] = types.ListType{ElemType: types.StringType} objectAttrs["account_count"] = types.Int64Type objectAttrs["name"] = types.StringType objectAttrs["next_uid"] = types.Int64Type @@ -908,6 +923,7 @@ func objectAttrsTypeRSProvisioningProvisionedAccount(recurse bool) map[string]at objectAttrs["audit"] = types.ObjectType{AttrTypes: objectAttrsTypeRSAuditInfo(false)} } objectAttrs["uuid"] = types.StringType + objectAttrs["additional"] = types.ListType{ElemType: types.StringType} objectAttrs["uid"] = types.Int64Type return objectAttrs } @@ -991,6 +1007,7 @@ func objectAttrsTypeRSProvisioningProvisionedSystem(recurse bool) map[string]att objectAttrs["organizational_unit_uuid"] = types.StringType objectAttrs["type"] = types.StringType objectAttrs["uuid"] = types.StringType + objectAttrs["additional"] = types.ListType{ElemType: types.StringType} objectAttrs["account_count"] = types.Int64Type objectAttrs["content_administrator_uuid"] = types.StringType objectAttrs["external_uuid"] = types.StringType @@ -1073,6 +1090,7 @@ func objectAttrsTypeRSServiceaccountServiceAccount(recurse bool) map[string]attr objectAttrs["system_uuid"] = types.StringType objectAttrs["username"] = types.StringType objectAttrs["uuid"] = types.StringType + objectAttrs["additional"] = types.ListType{ElemType: types.StringType} objectAttrs["description"] = types.StringType objectAttrs["password_uuid"] = types.StringType objectAttrs["password_rotation"] = types.StringType @@ -1091,6 +1109,7 @@ func objectAttrsTypeRSServiceaccountServiceAccountGroup(recurse bool) map[string objectAttrs["name_in_system"] = types.StringType objectAttrs["type"] = types.StringType objectAttrs["short_name_in_system"] = types.StringType + objectAttrs["additional"] = types.ListType{ElemType: types.StringType} return objectAttrs } @@ -1186,6 +1205,7 @@ func objectAttrsTypeRSVaultVaultRecord(recurse bool) map[string]attr.Type { objectAttrs["name"] = types.StringType objectAttrs["share_end_time"] = types.StringType objectAttrs["uuid"] = types.StringType + objectAttrs["additional"] = types.ListType{ElemType: types.StringType} objectAttrs["derived"] = types.BoolType objectAttrs["end_date"] = types.StringType objectAttrs["filename"] = types.StringType @@ -1258,6 +1278,7 @@ func objectAttrsTypeRSWebhookWebhook(recurse bool) map[string]attr.Type { } objectAttrs["links"] = types.ListType{ElemType: types.ObjectType{AttrTypes: objectAttrsTypeRSRestLink(recurse)}} objectAttrs["permissions"] = types.ListType{ElemType: types.ObjectType{AttrTypes: objectAttrsTypeRSAuthPermission(recurse)}} + objectAttrs["additional"] = types.ListType{ElemType: types.StringType} objectAttrs["account_uuid"] = types.StringType objectAttrs["active"] = types.BoolType objectAttrs["all_types"] = types.BoolType diff --git a/internal/provider/full-schema-rs.go b/internal/provider/full-schema-rs.go index 19af928..e17781e 100644 --- a/internal/provider/full-schema-rs.go +++ b/internal/provider/full-schema-rs.go @@ -258,6 +258,15 @@ func resourceSchemaAttrsClientApplicationVaultVaultRecord(recurse bool) map[stri Computed: true, PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, } + schemaAttrs["additional"] = rsschema.ListAttribute{ + ElementType: types.StringType, + Optional: true, + Validators: []validator.List{ + listvalidator.ValueStringsAre(stringvalidator.OneOf( + "audit", "parent", "passwordMetadata", "secret", "shareSummary", "shares", "tile", "vaultholder", + )), + }, + } schemaAttrs["derived"] = rsschema.BoolAttribute{ Computed: true, PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()}, @@ -341,6 +350,15 @@ func resourceSchemaAttrsClientClientApplication(recurse bool) map[string]rsschem Computed: true, PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, } + schemaAttrs["additional"] = rsschema.ListAttribute{ + ElementType: types.StringType, + Optional: true, + Validators: []validator.List{ + listvalidator.ValueStringsAre(stringvalidator.OneOf( + "audit", "groupclients", "groups", "secret", "tile", "vaultRecordCount", + )), + }, + } schemaAttrs["last_modified_at"] = rsschema.StringAttribute{ Computed: true, } @@ -576,6 +594,15 @@ func resourceSchemaAttrsClientOAuth2ClientPermission(recurse bool) map[string]rs Computed: true, PlanModifiers: []planmodifier.List{listplanmodifier.UseStateForUnknown()}, } + schemaAttrs["additional"] = rsschema.ListAttribute{ + ElementType: types.StringType, + Optional: true, + Validators: []validator.List{ + listvalidator.ValueStringsAre(stringvalidator.OneOf( + "audit", + )), + }, + } schemaAttrs["for_group_uuid"] = rsschema.StringAttribute{ Computed: true, Optional: true, @@ -619,6 +646,15 @@ func resourceSchemaAttrsClientOAuth2ClientPermissionWithClient(recurse bool) map Computed: true, PlanModifiers: []planmodifier.List{listplanmodifier.UseStateForUnknown()}, } + schemaAttrs["additional"] = rsschema.ListAttribute{ + ElementType: types.StringType, + Optional: true, + Validators: []validator.List{ + listvalidator.ValueStringsAre(stringvalidator.OneOf( + "audit", + )), + }, + } schemaAttrs["for_group_uuid"] = rsschema.StringAttribute{ Computed: true, Optional: true, @@ -737,6 +773,15 @@ func resourceSchemaAttrsDirectoryAccountDirectory(recurse bool) map[string]rssch Computed: true, PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, } + schemaAttrs["additional"] = rsschema.ListAttribute{ + ElementType: types.StringType, + Optional: true, + Validators: []validator.List{ + listvalidator.ValueStringsAre(stringvalidator.OneOf( + "audit", "markers", "status", + )), + }, + } schemaAttrs["base_organizational_unit_uuid"] = rsschema.StringAttribute{ Required: true, Validators: []validator.String{ @@ -1180,6 +1225,15 @@ func resourceSchemaAttrsGroupGroup(recurse bool) map[string]rsschema.Attribute { Computed: true, PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, } + schemaAttrs["additional"] = rsschema.ListAttribute{ + ElementType: types.StringType, + Optional: true, + Validators: []validator.List{ + listvalidator.ValueStringsAre(stringvalidator.OneOf( + "accounts", "administeredClients", "administeredSystems", "admins", "audit", "authorizedGroups", "clientPermissions", "clients", "contentAdministeredSystems", "groupauditinginfo", "groupinfo", "helpdesk", "markers", "myaccount", "mydelegatedaccount", "nestedGroups", "ownedClients", "ownedDirectories", "ownedGroupsOnSystem", "ownedOrganizationalUnits", "ownedSystems", "recentAudits", "requeststatus", "serviceAccounts", "systems", "vault", "webhooks", + )), + }, + } schemaAttrs["application_administration"] = rsschema.BoolAttribute{ Computed: true, Optional: true, @@ -1306,6 +1360,15 @@ func resourceSchemaAttrsGroupGroupAccount(recurse bool) map[string]rsschema.Attr stringvalidator.RegexMatches(regexp.MustCompile("[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"), "The value must be a valid UUID"), }, } + schemaAttrs["additional"] = rsschema.ListAttribute{ + ElementType: types.StringType, + Optional: true, + Validators: []validator.List{ + listvalidator.ValueStringsAre(stringvalidator.OneOf( + "audit", + )), + }, + } schemaAttrs["directory_uuid"] = rsschema.StringAttribute{ Computed: true, } @@ -1380,6 +1443,15 @@ func resourceSchemaAttrsGroupGroupAudit(recurse bool) map[string]rsschema.Attrib Computed: true, PlanModifiers: []planmodifier.List{listplanmodifier.UseStateForUnknown()}, } + schemaAttrs["additional"] = rsschema.ListAttribute{ + ElementType: types.StringType, + Optional: true, + Validators: []validator.List{ + listvalidator.ValueStringsAre(stringvalidator.OneOf( + "audit", + )), + }, + } schemaAttrs["accounts"] = rsschema.ListNestedAttribute{ NestedObject: rsschema.NestedAttributeObject{ Attributes: resourceSchemaAttrsGroupGroupAuditAccount(false), @@ -1620,6 +1692,15 @@ func resourceSchemaAttrsGroupGroupClient(recurse bool) map[string]rsschema.Attri Computed: true, PlanModifiers: []planmodifier.List{listplanmodifier.UseStateForUnknown()}, } + schemaAttrs["additional"] = rsschema.ListAttribute{ + ElementType: types.StringType, + Optional: true, + Validators: []validator.List{ + listvalidator.ValueStringsAre(stringvalidator.OneOf( + "audit", + )), + }, + } schemaAttrs["activation_required"] = rsschema.BoolAttribute{ Computed: true, Optional: true, @@ -1930,6 +2011,15 @@ func resourceSchemaAttrsGroupProvisioningGroup(recurse bool) map[string]rsschema Computed: true, PlanModifiers: []planmodifier.List{listplanmodifier.UseStateForUnknown()}, } + schemaAttrs["additional"] = rsschema.ListAttribute{ + ElementType: types.StringType, + Optional: true, + Validators: []validator.List{ + listvalidator.ValueStringsAre(stringvalidator.OneOf( + "audit", + )), + }, + } schemaAttrs["activation_required"] = rsschema.BoolAttribute{ Computed: true, Optional: true, @@ -2021,6 +2111,15 @@ func resourceSchemaAttrsGroupVaultVaultRecord(recurse bool) map[string]rsschema. Computed: true, PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, } + schemaAttrs["additional"] = rsschema.ListAttribute{ + ElementType: types.StringType, + Optional: true, + Validators: []validator.List{ + listvalidator.ValueStringsAre(stringvalidator.OneOf( + "audit", "parent", "passwordMetadata", "secret", "shareSummary", "shares", "tile", "vaultholder", + )), + }, + } schemaAttrs["derived"] = rsschema.BoolAttribute{ Computed: true, PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()}, @@ -2147,6 +2246,15 @@ func resourceSchemaAttrsNestedProvisioningGroupOnSystem(recurse bool) map[string schemaAttrs["short_name_in_system"] = rsschema.StringAttribute{ Computed: true, } + schemaAttrs["additional"] = rsschema.ListAttribute{ + ElementType: types.StringType, + Optional: true, + Validators: []validator.List{ + listvalidator.ValueStringsAre(stringvalidator.OneOf( + "audit", "provgroups", "serviceAccounts", + )), + }, + } schemaAttrs["owner_uuid"] = rsschema.StringAttribute{ Required: true, Validators: []validator.String{ @@ -2184,6 +2292,15 @@ func resourceSchemaAttrsOrganizationOrganizationalUnit(recurse bool) map[string] Computed: true, PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, } + schemaAttrs["additional"] = rsschema.ListAttribute{ + ElementType: types.StringType, + Optional: true, + Validators: []validator.List{ + listvalidator.ValueStringsAre(stringvalidator.OneOf( + "audit", + )), + }, + } schemaAttrs["depth"] = rsschema.Int64Attribute{ Computed: true, } @@ -2426,6 +2543,15 @@ func resourceSchemaAttrsProvisioningGroupOnSystem(recurse bool) map[string]rssch schemaAttrs["short_name_in_system"] = rsschema.StringAttribute{ Computed: true, } + schemaAttrs["additional"] = rsschema.ListAttribute{ + ElementType: types.StringType, + Optional: true, + Validators: []validator.List{ + listvalidator.ValueStringsAre(stringvalidator.OneOf( + "audit", "provgroups", "serviceAccounts", + )), + }, + } schemaAttrs["owner_uuid"] = rsschema.StringAttribute{ Required: true, Validators: []validator.String{ @@ -2552,6 +2678,15 @@ func resourceSchemaAttrsProvisioningProvisionNumberSequence(recurse bool) map[st Computed: true, PlanModifiers: []planmodifier.List{listplanmodifier.UseStateForUnknown()}, } + schemaAttrs["additional"] = rsschema.ListAttribute{ + ElementType: types.StringType, + Optional: true, + Validators: []validator.List{ + listvalidator.ValueStringsAre(stringvalidator.OneOf( + "audit", "systems", + )), + }, + } schemaAttrs["account_count"] = rsschema.Int64Attribute{ Computed: true, } @@ -2610,6 +2745,15 @@ func resourceSchemaAttrsProvisioningProvisionedAccount(recurse bool) map[string] stringvalidator.RegexMatches(regexp.MustCompile("[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"), "The value must be a valid UUID"), }, } + schemaAttrs["additional"] = rsschema.ListAttribute{ + ElementType: types.StringType, + Optional: true, + Validators: []validator.List{ + listvalidator.ValueStringsAre(stringvalidator.OneOf( + "audit", + )), + }, + } schemaAttrs["uid"] = rsschema.Int64Attribute{ Computed: true, PlanModifiers: []planmodifier.Int64{int64planmodifier.UseStateForUnknown()}, @@ -2800,6 +2944,15 @@ func resourceSchemaAttrsProvisioningProvisionedSystem(recurse bool) map[string]r Computed: true, PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, } + schemaAttrs["additional"] = rsschema.ListAttribute{ + ElementType: types.StringType, + Optional: true, + Validators: []validator.List{ + listvalidator.ValueStringsAre(stringvalidator.OneOf( + "account", "audit", "issuedPermissions", "loginName", "managementPermissions", "markers", "statistics", "supportedGroupTypes", + )), + }, + } schemaAttrs["account_count"] = rsschema.Int64Attribute{ Computed: true, } @@ -3100,6 +3253,15 @@ func resourceSchemaAttrsServiceaccountServiceAccount(recurse bool) map[string]rs Computed: true, PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, } + schemaAttrs["additional"] = rsschema.ListAttribute{ + ElementType: types.StringType, + Optional: true, + Validators: []validator.List{ + listvalidator.ValueStringsAre(stringvalidator.OneOf( + "audit", "groups", "secret", + )), + }, + } schemaAttrs["description"] = rsschema.StringAttribute{ Optional: true, } @@ -3161,6 +3323,15 @@ func resourceSchemaAttrsServiceaccountServiceAccountGroup(recurse bool) map[stri schemaAttrs["short_name_in_system"] = rsschema.StringAttribute{ Computed: true, } + schemaAttrs["additional"] = rsschema.ListAttribute{ + ElementType: types.StringType, + Optional: true, + Validators: []validator.List{ + listvalidator.ValueStringsAre(stringvalidator.OneOf( + "audit", + )), + }, + } return schemaAttrs } func resourceSchemaAttrsServiceaccountServiceAccountGroupLinkableWrapper(recurse bool) map[string]rsschema.Attribute { @@ -3399,6 +3570,15 @@ func resourceSchemaAttrsVaultVaultRecord(recurse bool) map[string]rsschema.Attri Computed: true, PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, } + schemaAttrs["additional"] = rsschema.ListAttribute{ + ElementType: types.StringType, + Optional: true, + Validators: []validator.List{ + listvalidator.ValueStringsAre(stringvalidator.OneOf( + "audit", "parent", "passwordMetadata", "secret", "shareSummary", "shares", "tile", "vaultholder", + )), + }, + } schemaAttrs["derived"] = rsschema.BoolAttribute{ Computed: true, PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()}, @@ -3616,6 +3796,15 @@ func resourceSchemaAttrsWebhookWebhook(recurse bool) map[string]rsschema.Attribu Computed: true, PlanModifiers: []planmodifier.List{listplanmodifier.UseStateForUnknown()}, } + schemaAttrs["additional"] = rsschema.ListAttribute{ + ElementType: types.StringType, + Optional: true, + Validators: []validator.List{ + listvalidator.ValueStringsAre(stringvalidator.OneOf( + "audit", + )), + }, + } schemaAttrs["account_uuid"] = rsschema.StringAttribute{ Optional: true, Validators: []validator.String{ diff --git a/internal/provider/full-tf-to-data-struct-rs.go b/internal/provider/full-tf-to-data-struct-rs.go index 642f673..90ab290 100644 --- a/internal/provider/full-tf-to-data-struct-rs.go +++ b/internal/provider/full-tf-to-data-struct-rs.go @@ -77,6 +77,7 @@ func fillDataStructFromTFObjectRSClientApplicationVaultVaultRecord(data *clientA data.Name = obj.Attributes()["name"].(basetypes.StringValue) data.ShareEndTime = obj.Attributes()["share_end_time"].(basetypes.StringValue) data.UUID = obj.Attributes()["uuid"].(basetypes.StringValue) + data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.Audit = obj.Attributes()["audit"].(basetypes.ObjectValue) data.DeleteTile = obj.Attributes()["delete_tile"].(basetypes.BoolValue) data.ParentUUID = obj.Attributes()["parent_uuid"].(basetypes.StringValue) @@ -104,6 +105,7 @@ func fillDataStructFromTFObjectRSClientClientApplication(data *clientClientAppli data.Scopes = obj.Attributes()["scopes"].(basetypes.ListValue) data.SsoApplication = obj.Attributes()["sso_application"].(basetypes.BoolValue) data.UUID = obj.Attributes()["uuid"].(basetypes.StringValue) + data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.Audit = obj.Attributes()["audit"].(basetypes.ObjectValue) data.DeleteTile = obj.Attributes()["delete_tile"].(basetypes.BoolValue) data.Groupclients = obj.Attributes()["groupclients"].(basetypes.ListValue) @@ -170,6 +172,7 @@ func fillDataStructFromTFObjectRSClientOAuth2Client(data *clientOAuth2ClientData func fillDataStructFromTFObjectRSClientOAuth2ClientPermission(data *clientOAuth2ClientPermissionDataRS, obj types.Object) { data.Links = obj.Attributes()["links"].(basetypes.ListValue) data.Permissions = obj.Attributes()["permissions"].(basetypes.ListValue) + data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.Audit = obj.Attributes()["audit"].(basetypes.ObjectValue) data.ForGroupUUID = obj.Attributes()["for_group_uuid"].(basetypes.StringValue) data.ForSystemUUID = obj.Attributes()["for_system_uuid"].(basetypes.StringValue) @@ -179,6 +182,7 @@ func fillDataStructFromTFObjectRSClientOAuth2ClientPermission(data *clientOAuth2 func fillDataStructFromTFObjectRSClientOAuth2ClientPermissionWithClient(data *clientOAuth2ClientPermissionWithClientDataRS, obj types.Object) { data.Links = obj.Attributes()["links"].(basetypes.ListValue) data.Permissions = obj.Attributes()["permissions"].(basetypes.ListValue) + data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.Audit = obj.Attributes()["audit"].(basetypes.ObjectValue) data.ForGroupUUID = obj.Attributes()["for_group_uuid"].(basetypes.StringValue) data.ForSystemUUID = obj.Attributes()["for_system_uuid"].(basetypes.StringValue) @@ -209,6 +213,7 @@ func fillDataStructFromTFObjectRSDirectoryAccountDirectory(data *directoryAccoun data.DirectoryAccountDirectoryPrimerType = obj.Attributes()["type"].(basetypes.StringValue) data.Name = obj.Attributes()["name"].(basetypes.StringValue) data.UUID = obj.Attributes()["uuid"].(basetypes.StringValue) + data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.Audit = obj.Attributes()["audit"].(basetypes.ObjectValue) data.Markers = obj.Attributes()["markers"].(basetypes.ObjectValue) data.Status = obj.Attributes()["status"].(basetypes.ObjectValue) @@ -315,6 +320,7 @@ func fillDataStructFromTFObjectRSGroupGroup(data *groupGroupDataRS, obj types.Ob data.Name = obj.Attributes()["name"].(basetypes.StringValue) data.OrganizationalUnitUUID = obj.Attributes()["organizational_unit_uuid"].(basetypes.StringValue) data.UUID = obj.Attributes()["uuid"].(basetypes.StringValue) + data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.Accounts = obj.Attributes()["accounts"].(basetypes.ListValue) data.AdministeredClients = obj.Attributes()["administered_clients"].(basetypes.ListValue) data.AdministeredSystems = obj.Attributes()["administered_systems"].(basetypes.ListValue) @@ -366,6 +372,7 @@ func fillDataStructFromTFObjectRSGroupGroup(data *groupGroupDataRS, obj types.Ob func fillDataStructFromTFObjectRSGroupGroupAccount(data *groupGroupAccountDataRS, obj types.Object) { data.UUID = obj.Attributes()["uuid"].(basetypes.StringValue) + data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.Audit = obj.Attributes()["audit"].(basetypes.ObjectValue) data.DirectoryUUID = obj.Attributes()["directory_uuid"].(basetypes.StringValue) data.DisconnectedNested = obj.Attributes()["disconnected_nested"].(basetypes.BoolValue) @@ -389,6 +396,7 @@ func fillDataStructFromTFObjectRSGroupGroupAccount_additionalObjects(data *group func fillDataStructFromTFObjectRSGroupGroupAudit(data *groupGroupAuditDataRS, obj types.Object) { data.Links = obj.Attributes()["links"].(basetypes.ListValue) data.Permissions = obj.Attributes()["permissions"].(basetypes.ListValue) + data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.Accounts = obj.Attributes()["accounts"].(basetypes.ListValue) data.Audit = obj.Attributes()["audit"].(basetypes.ObjectValue) data.Comment = obj.Attributes()["comment"].(basetypes.StringValue) @@ -455,6 +463,7 @@ func fillDataStructFromTFObjectRSGroupGroupClassificationPrimer(data *groupGroup func fillDataStructFromTFObjectRSGroupGroupClient(data *groupGroupClientDataRS, obj types.Object) { data.Links = obj.Attributes()["links"].(basetypes.ListValue) data.Permissions = obj.Attributes()["permissions"].(basetypes.ListValue) + data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.ActivationRequired = obj.Attributes()["activation_required"].(basetypes.BoolValue) data.Audit = obj.Attributes()["audit"].(basetypes.ObjectValue) data.ClientUUID = obj.Attributes()["client_uuid"].(basetypes.StringValue) @@ -530,6 +539,7 @@ func fillDataStructFromTFObjectRSGroupGroup_additionalObjects(data *groupGroup_a func fillDataStructFromTFObjectRSGroupProvisioningGroup(data *groupProvisioningGroupDataRS, obj types.Object) { data.Links = obj.Attributes()["links"].(basetypes.ListValue) data.Permissions = obj.Attributes()["permissions"].(basetypes.ListValue) + data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.ActivationRequired = obj.Attributes()["activation_required"].(basetypes.BoolValue) data.Audit = obj.Attributes()["audit"].(basetypes.ObjectValue) data.GroupUUID = obj.Attributes()["group_uuid"].(basetypes.StringValue) @@ -552,6 +562,7 @@ func fillDataStructFromTFObjectRSGroupVaultVaultRecord(data *groupVaultVaultReco data.Name = obj.Attributes()["name"].(basetypes.StringValue) data.ShareEndTime = obj.Attributes()["share_end_time"].(basetypes.StringValue) data.UUID = obj.Attributes()["uuid"].(basetypes.StringValue) + data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.Audit = obj.Attributes()["audit"].(basetypes.ObjectValue) data.DeleteTile = obj.Attributes()["delete_tile"].(basetypes.BoolValue) data.ParentUUID = obj.Attributes()["parent_uuid"].(basetypes.StringValue) @@ -595,6 +606,7 @@ func fillDataStructFromTFObjectRSNestedProvisioningGroupOnSystem(data *nestedPro data.NameInSystem = obj.Attributes()["name_in_system"].(basetypes.StringValue) data.ProvisioningGroupOnSystemPrimerType = obj.Attributes()["type"].(basetypes.StringValue) data.ShortNameInSystem = obj.Attributes()["short_name_in_system"].(basetypes.StringValue) + data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.Audit = obj.Attributes()["audit"].(basetypes.ObjectValue) data.Provgroups = obj.Attributes()["provgroups"].(basetypes.ListValue) data.ServiceAccounts = obj.Attributes()["service_accounts"].(basetypes.ListValue) @@ -606,6 +618,7 @@ func fillDataStructFromTFObjectRSOrganizationOrganizationalUnit(data *organizati data.Permissions = obj.Attributes()["permissions"].(basetypes.ListValue) data.Name = obj.Attributes()["name"].(basetypes.StringValue) data.UUID = obj.Attributes()["uuid"].(basetypes.StringValue) + data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.Audit = obj.Attributes()["audit"].(basetypes.ObjectValue) data.CreateAsParentOf = obj.Attributes()["create_as_parent_of"].(basetypes.ListValue) data.Depth = obj.Attributes()["depth"].(basetypes.Int64Value) @@ -667,6 +680,7 @@ func fillDataStructFromTFObjectRSProvisioningGroupOnSystem(data *provisioningGro data.NameInSystem = obj.Attributes()["name_in_system"].(basetypes.StringValue) data.ProvisioningGroupOnSystemPrimerType = obj.Attributes()["type"].(basetypes.StringValue) data.ShortNameInSystem = obj.Attributes()["short_name_in_system"].(basetypes.StringValue) + data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.Audit = obj.Attributes()["audit"].(basetypes.ObjectValue) data.Provgroups = obj.Attributes()["provgroups"].(basetypes.ListValue) data.ServiceAccounts = obj.Attributes()["service_accounts"].(basetypes.ListValue) @@ -704,6 +718,7 @@ func fillDataStructFromTFObjectRSProvisioningOwnedGroupOnSystemsWrapper(data *pr func fillDataStructFromTFObjectRSProvisioningProvisionNumberSequence(data *provisioningProvisionNumberSequenceDataRS, obj types.Object) { data.Links = obj.Attributes()["links"].(basetypes.ListValue) data.Permissions = obj.Attributes()["permissions"].(basetypes.ListValue) + data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.AccountCount = obj.Attributes()["account_count"].(basetypes.Int64Value) data.Audit = obj.Attributes()["audit"].(basetypes.ObjectValue) data.Systems = obj.Attributes()["systems"].(basetypes.ListValue) @@ -722,6 +737,7 @@ func fillDataStructFromTFObjectRSProvisioningProvisionedAD(data *provisioningPro func fillDataStructFromTFObjectRSProvisioningProvisionedAccount(data *provisioningProvisionedAccountDataRS, obj types.Object) { data.UUID = obj.Attributes()["uuid"].(basetypes.StringValue) + data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.Audit = obj.Attributes()["audit"].(basetypes.ObjectValue) data.UID = obj.Attributes()["uid"].(basetypes.Int64Value) } @@ -778,6 +794,7 @@ func fillDataStructFromTFObjectRSProvisioningProvisionedSystem(data *provisionin data.OrganizationalUnitUUID = obj.Attributes()["organizational_unit_uuid"].(basetypes.StringValue) data.ProvisioningProvisionedSystemPrimerType = obj.Attributes()["type"].(basetypes.StringValue) data.UUID = obj.Attributes()["uuid"].(basetypes.StringValue) + data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.AccountCount = obj.Attributes()["account_count"].(basetypes.Int64Value) data.Account = obj.Attributes()["account"].(basetypes.ObjectValue) data.Audit = obj.Attributes()["audit"].(basetypes.ObjectValue) @@ -851,6 +868,7 @@ func fillDataStructFromTFObjectRSServiceaccountServiceAccount(data *serviceaccou data.SystemUUID = obj.Attributes()["system_uuid"].(basetypes.StringValue) data.Username = obj.Attributes()["username"].(basetypes.StringValue) data.UUID = obj.Attributes()["uuid"].(basetypes.StringValue) + data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.Audit = obj.Attributes()["audit"].(basetypes.ObjectValue) data.Groups = obj.Attributes()["groups"].(basetypes.ListValue) data.Secret = obj.Attributes()["secret"].(basetypes.ObjectValue) @@ -867,6 +885,7 @@ func fillDataStructFromTFObjectRSServiceaccountServiceAccountGroup(data *service data.NameInSystem = obj.Attributes()["name_in_system"].(basetypes.StringValue) data.ProvisioningGroupOnSystemPrimerType = obj.Attributes()["type"].(basetypes.StringValue) data.ShortNameInSystem = obj.Attributes()["short_name_in_system"].(basetypes.StringValue) + data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.Audit = obj.Attributes()["audit"].(basetypes.ObjectValue) } @@ -932,6 +951,7 @@ func fillDataStructFromTFObjectRSVaultVaultRecord(data *vaultVaultRecordDataRS, data.Name = obj.Attributes()["name"].(basetypes.StringValue) data.ShareEndTime = obj.Attributes()["share_end_time"].(basetypes.StringValue) data.UUID = obj.Attributes()["uuid"].(basetypes.StringValue) + data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.Audit = obj.Attributes()["audit"].(basetypes.ObjectValue) data.DeleteTile = obj.Attributes()["delete_tile"].(basetypes.BoolValue) data.ParentUUID = obj.Attributes()["parent_uuid"].(basetypes.StringValue) @@ -996,6 +1016,7 @@ func fillDataStructFromTFObjectRSVaultVaultRecord_additionalObjects(data *vaultV func fillDataStructFromTFObjectRSWebhookWebhook(data *webhookWebhookDataRS, obj types.Object) { data.Links = obj.Attributes()["links"].(basetypes.ListValue) data.Permissions = obj.Attributes()["permissions"].(basetypes.ListValue) + data.Additional = obj.Attributes()["additional"].(basetypes.ListValue) data.AccountUUID = obj.Attributes()["account_uuid"].(basetypes.StringValue) data.Active = obj.Attributes()["active"].(basetypes.BoolValue) data.Audit = obj.Attributes()["audit"].(basetypes.ObjectValue) diff --git a/internal/provider/full-tkh-to-tf-rs.go b/internal/provider/full-tkh-to-tf-rs.go index b0d13c1..50d0e3c 100644 --- a/internal/provider/full-tkh-to-tf-rs.go +++ b/internal/provider/full-tkh-to-tf-rs.go @@ -321,6 +321,7 @@ func tkhToTFObjectRSClientApplicationVaultVaultRecord(recurse bool, tkh keyhubmo obj["name"] = types.StringPointerValue(tkh.GetName()) obj["share_end_time"] = timePointerToTF(tkh.GetShareEndTime()) obj["uuid"] = types.StringPointerValue(tkh.GetUuid()) + obj["additional"] = types.ListNull(types.StringType) obj["derived"] = types.BoolPointerValue(tkh.GetDerived()) obj["end_date"] = stringerToTF(tkh.GetEndDate()) obj["filename"] = types.StringPointerValue(tkh.GetFilename()) @@ -394,6 +395,7 @@ func tkhToTFObjectRSClientClientApplication(recurse bool, tkh keyhubmodel.Client } obj["sso_application"] = types.BoolPointerValue(tkh.GetSsoApplication()) obj["uuid"] = types.StringPointerValue(tkh.GetUuid()) + obj["additional"] = types.ListNull(types.StringType) obj["last_modified_at"] = timePointerToTF(tkh.GetLastModifiedAt()) obj["owner_uuid"] = withUuidToTF(tkh.GetOwner()) obj["technical_administrator_uuid"] = withUuidToTF(tkh.GetTechnicalAdministrator()) @@ -659,6 +661,7 @@ func tkhToTFObjectRSClientOAuth2ClientPermission(recurse bool, tkh keyhubmodel.C diags.Append(d...) obj["permissions"] = val } + obj["additional"] = types.ListNull(types.StringType) obj["for_group_uuid"] = withUuidToTF(tkh.GetForGroup()) obj["for_system_uuid"] = withUuidToTF(tkh.GetForSystem()) obj["value"] = stringerToTF(tkh.GetValue()) @@ -708,6 +711,7 @@ func tkhToTFObjectRSClientOAuth2ClientPermissionWithClient(recurse bool, tkh key diags.Append(d...) obj["permissions"] = val } + obj["additional"] = types.ListNull(types.StringType) obj["for_group_uuid"] = withUuidToTF(tkh.GetForGroup()) obj["for_system_uuid"] = withUuidToTF(tkh.GetForSystem()) obj["value"] = stringerToTF(tkh.GetValue()) @@ -846,6 +850,7 @@ func tkhToTFObjectRSDirectoryAccountDirectory(recurse bool, tkh keyhubmodel.Dire obj["type"] = stringerToTF(tkh.GetDirectoryAccountDirectoryPrimerType()) obj["name"] = types.StringPointerValue(tkh.GetName()) obj["uuid"] = types.StringPointerValue(tkh.GetUuid()) + obj["additional"] = types.ListNull(types.StringType) obj["base_organizational_unit_uuid"] = withUuidToTF(tkh.GetBaseOrganizationalUnit()) obj["default_directory"] = types.BoolPointerValue(tkh.GetDefaultDirectory()) obj["helpdesk_group_uuid"] = withUuidToTF(tkh.GetHelpdeskGroup()) @@ -1265,6 +1270,7 @@ func tkhToTFObjectRSGroupGroup(recurse bool, tkh keyhubmodel.GroupGroupable) (ty obj["name"] = types.StringPointerValue(tkh.GetName()) obj["organizational_unit_uuid"] = withUuidToTF(tkh.GetOrganizationalUnit()) obj["uuid"] = types.StringPointerValue(tkh.GetUuid()) + obj["additional"] = types.ListNull(types.StringType) obj["application_administration"] = types.BoolPointerValue(tkh.GetApplicationAdministration()) { val, d := tkhToTFObjectRSGroupGroupAuditConfig(false, tkh.GetAuditConfig()) @@ -1323,6 +1329,7 @@ func tkhToTFObjectRSGroupGroupAccount(recurse bool, tkh keyhubmodel.GroupGroupAc } } obj["uuid"] = withUuidToTF(tkh) + obj["additional"] = types.ListNull(types.StringType) obj["directory_uuid"] = withUuidToTF(tkh.GetDirectory()) obj["disconnected_nested"] = types.BoolPointerValue(tkh.GetDisconnectedNested()) obj["end_date"] = stringerToTF(tkh.GetEndDate()) @@ -1431,6 +1438,7 @@ func tkhToTFObjectRSGroupGroupAudit(recurse bool, tkh keyhubmodel.GroupGroupAudi diags.Append(d...) obj["permissions"] = val } + obj["additional"] = types.ListNull(types.StringType) { elemType := attrs["accounts"].(types.ListType).ElemType val, d := sliceToTF(elemType, tkh.GetAccounts(), func(tkh keyhubmodel.GroupGroupAuditAccountable, diags *diag.Diagnostics) attr.Value { @@ -1716,6 +1724,7 @@ func tkhToTFObjectRSGroupGroupClient(recurse bool, tkh keyhubmodel.GroupGroupCli diags.Append(d...) obj["permissions"] = val } + obj["additional"] = types.ListNull(types.StringType) obj["activation_required"] = types.BoolPointerValue(tkh.GetActivationRequired()) obj["client_uuid"] = withUuidToTF(tkh.GetClient()) obj["group_uuid"] = withUuidToTF(tkh.GetGroup()) @@ -2096,6 +2105,7 @@ func tkhToTFObjectRSGroupProvisioningGroup(recurse bool, tkh keyhubmodel.GroupPr diags.Append(d...) obj["permissions"] = val } + obj["additional"] = types.ListNull(types.StringType) obj["activation_required"] = types.BoolPointerValue(tkh.GetActivationRequired()) obj["group_uuid"] = withUuidToTF(tkh.GetGroup()) { @@ -2207,6 +2217,7 @@ func tkhToTFObjectRSGroupVaultVaultRecord(recurse bool, tkh keyhubmodel.VaultVau obj["name"] = types.StringPointerValue(tkh.GetName()) obj["share_end_time"] = timePointerToTF(tkh.GetShareEndTime()) obj["uuid"] = types.StringPointerValue(tkh.GetUuid()) + obj["additional"] = types.ListNull(types.StringType) obj["derived"] = types.BoolPointerValue(tkh.GetDerived()) obj["end_date"] = stringerToTF(tkh.GetEndDate()) obj["filename"] = types.StringPointerValue(tkh.GetFilename()) @@ -2369,6 +2380,7 @@ func tkhToTFObjectRSNestedProvisioningGroupOnSystem(recurse bool, tkh keyhubmode obj["name_in_system"] = types.StringPointerValue(tkh.GetNameInSystem()) obj["type"] = stringerToTF(tkh.GetProvisioningGroupOnSystemPrimerType()) obj["short_name_in_system"] = types.StringPointerValue(tkh.GetShortNameInSystem()) + obj["additional"] = types.ListNull(types.StringType) obj["owner_uuid"] = withUuidToTF(tkh.GetOwner()) objVal, d := types.ObjectValue(attrs, obj) @@ -2418,6 +2430,7 @@ func tkhToTFObjectRSOrganizationOrganizationalUnit(recurse bool, tkh keyhubmodel } obj["name"] = types.StringPointerValue(tkh.GetName()) obj["uuid"] = types.StringPointerValue(tkh.GetUuid()) + obj["additional"] = types.ListNull(types.StringType) obj["depth"] = types.Int64PointerValue(int32PToInt64P(tkh.GetDepth())) obj["description"] = types.StringPointerValue(tkh.GetDescription()) obj["owner_uuid"] = withUuidToTF(tkh.GetOwner()) @@ -2665,6 +2678,7 @@ func tkhToTFObjectRSProvisioningGroupOnSystem(recurse bool, tkh keyhubmodel.Prov obj["name_in_system"] = types.StringPointerValue(tkh.GetNameInSystem()) obj["type"] = stringerToTF(tkh.GetProvisioningGroupOnSystemPrimerType()) obj["short_name_in_system"] = types.StringPointerValue(tkh.GetShortNameInSystem()) + obj["additional"] = types.ListNull(types.StringType) obj["owner_uuid"] = withUuidToTF(tkh.GetOwner()) objVal, d := types.ObjectValue(attrs, obj) @@ -2875,6 +2889,7 @@ func tkhToTFObjectRSProvisioningProvisionNumberSequence(recurse bool, tkh keyhub diags.Append(d...) obj["permissions"] = val } + obj["additional"] = types.ListNull(types.StringType) obj["account_count"] = types.Int64PointerValue(int32PToInt64P(tkh.GetAccountCount())) obj["name"] = types.StringPointerValue(tkh.GetName()) obj["next_uid"] = types.Int64PointerValue(tkh.GetNextUID()) @@ -2954,6 +2969,7 @@ func tkhToTFObjectRSProvisioningProvisionedAccount(recurse bool, tkh keyhubmodel } } obj["uuid"] = withUuidToTF(tkh) + obj["additional"] = types.ListNull(types.StringType) obj["uid"] = types.Int64PointerValue(tkh.GetUid()) objVal, d := types.ObjectValue(attrs, obj) @@ -3186,6 +3202,7 @@ func tkhToTFObjectRSProvisioningProvisionedSystem(recurse bool, tkh keyhubmodel. obj["organizational_unit_uuid"] = withUuidToTF(tkh.GetOrganizationalUnit()) obj["type"] = stringerToTF(tkh.GetProvisioningProvisionedSystemPrimerType()) obj["uuid"] = types.StringPointerValue(tkh.GetUuid()) + obj["additional"] = types.ListNull(types.StringType) obj["account_count"] = types.Int64PointerValue(int32PToInt64P(tkh.GetAccountCount())) obj["content_administrator_uuid"] = withUuidToTF(tkh.GetContentAdministrator()) obj["external_uuid"] = stringerToTF(tkh.GetExternalUuid()) @@ -3481,6 +3498,7 @@ func tkhToTFObjectRSServiceaccountServiceAccount(recurse bool, tkh keyhubmodel.S obj["system_uuid"] = withUuidToTF(tkh.GetSystem()) obj["username"] = types.StringPointerValue(tkh.GetUsername()) obj["uuid"] = types.StringPointerValue(tkh.GetUuid()) + obj["additional"] = types.ListNull(types.StringType) obj["description"] = types.StringPointerValue(tkh.GetDescription()) obj["password_uuid"] = withUuidToTF(tkh.GetPassword()) obj["password_rotation"] = stringerToTF(tkh.GetPasswordRotation()) @@ -3535,6 +3553,7 @@ func tkhToTFObjectRSServiceaccountServiceAccountGroup(recurse bool, tkh keyhubmo obj["name_in_system"] = types.StringPointerValue(tkh.GetNameInSystem()) obj["type"] = stringerToTF(tkh.GetProvisioningGroupOnSystemPrimerType()) obj["short_name_in_system"] = types.StringPointerValue(tkh.GetShortNameInSystem()) + obj["additional"] = types.ListNull(types.StringType) objVal, d := types.ObjectValue(attrs, obj) diags.Append(d...) @@ -3870,6 +3889,7 @@ func tkhToTFObjectRSVaultVaultRecord(recurse bool, tkh keyhubmodel.VaultVaultRec obj["name"] = types.StringPointerValue(tkh.GetName()) obj["share_end_time"] = timePointerToTF(tkh.GetShareEndTime()) obj["uuid"] = types.StringPointerValue(tkh.GetUuid()) + obj["additional"] = types.ListNull(types.StringType) obj["derived"] = types.BoolPointerValue(tkh.GetDerived()) obj["end_date"] = stringerToTF(tkh.GetEndDate()) obj["filename"] = types.StringPointerValue(tkh.GetFilename()) @@ -4137,6 +4157,7 @@ func tkhToTFObjectRSWebhookWebhook(recurse bool, tkh keyhubmodel.WebhookWebhooka diags.Append(d...) obj["permissions"] = val } + obj["additional"] = types.ListNull(types.StringType) obj["account_uuid"] = withUuidToTF(tkh.GetAccount()) obj["active"] = types.BoolPointerValue(tkh.GetActive()) obj["all_types"] = types.BoolPointerValue(tkh.GetAllTypes()) diff --git a/internal/provider/resource-client_vaultrecord.go b/internal/provider/resource-client_vaultrecord.go index c5a57ce..9514614 100644 --- a/internal/provider/resource-client_vaultrecord.go +++ b/internal/provider/resource-client_vaultrecord.go @@ -83,6 +83,7 @@ func (r *clientVaultrecordResource) Create(ctx context.Context, req resource.Cre return } + additionalBackup := data.Additional r.providerData.Mutex.Lock() defer r.providerData.Mutex.Unlock() tflog.Info(ctx, "Creating Topicus KeyHub client_vaultrecord") @@ -97,7 +98,7 @@ func (r *clientVaultrecordResource) Create(ctx context.Context, req resource.Cre wrapper, err := r.providerData.Client.Client().ByClientidInt64(*tkhParent.GetLinks()[0].GetId()).Vault().Record().Post( ctx, newWrapper, &keyhubreq.ItemVaultRecordRequestBuilderPostRequestConfiguration{ QueryParameters: &keyhubreq.ItemVaultRecordRequestBuilderPostQueryParameters{ - Additional: collectAdditional(data), + Additional: collectAdditional(ctx, data, data.Additional), }, }) tkh, diags := findFirst[keyhubmodels.VaultVaultRecordable](ctx, wrapper, "client_vaultrecord", nil, false, err) @@ -113,6 +114,7 @@ func (r *clientVaultrecordResource) Create(ctx context.Context, req resource.Cre } tf = setAttributeValue(ctx, tf, "client_application_uuid", types.StringValue(data.ClientApplicationUUID.ValueString())) fillDataStructFromTFObjectRSClientApplicationVaultVaultRecord(&data, tf) + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) @@ -127,6 +129,7 @@ func (r *clientVaultrecordResource) Read(ctx context.Context, req resource.ReadR return } + additionalBackup := data.Additional r.providerData.Mutex.RLock() defer r.providerData.Mutex.RUnlock() ctx = context.WithValue(ctx, keyHubClientKey, r.providerData.Client) @@ -146,7 +149,7 @@ func (r *clientVaultrecordResource) Read(ctx context.Context, req resource.ReadR tkh, err := r.providerData.Client.Client().ByClientidInt64(*tkhParent.GetLinks()[0].GetId()).Vault().Record().ByRecordidInt64(getSelfLink(data.Links).ID.ValueInt64()).Get( ctx, &keyhubreq.ItemVaultRecordWithRecordItemRequestBuilderGetRequestConfiguration{ QueryParameters: &keyhubreq.ItemVaultRecordWithRecordItemRequestBuilderGetQueryParameters{ - Additional: collectAdditional(data), + Additional: collectAdditional(ctx, data, data.Additional), }, }) @@ -167,6 +170,7 @@ func (r *clientVaultrecordResource) Read(ctx context.Context, req resource.ReadR } tf = setAttributeValue(ctx, tf, "client_application_uuid", types.StringValue(data.ClientApplicationUUID.ValueString())) fillDataStructFromTFObjectRSClientApplicationVaultVaultRecord(&data, tf) + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } @@ -191,6 +195,7 @@ func (r *clientVaultrecordResource) Update(ctx context.Context, req resource.Upd return } + additionalBackup := data.Additional r.providerData.Mutex.Lock() defer r.providerData.Mutex.Unlock() tflog.Info(ctx, "Updating Topicus KeyHub client_vaultrecord") @@ -203,7 +208,7 @@ func (r *clientVaultrecordResource) Update(ctx context.Context, req resource.Upd tkh, err := r.providerData.Client.Client().ByClientidInt64(*tkhParent.GetLinks()[0].GetId()).Vault().Record().ByRecordidInt64(getSelfLink(data.Links).ID.ValueInt64()).Put( ctx, newTkh, &keyhubreq.ItemVaultRecordWithRecordItemRequestBuilderPutRequestConfiguration{ QueryParameters: &keyhubreq.ItemVaultRecordWithRecordItemRequestBuilderPutQueryParameters{ - Additional: collectAdditional(data), + Additional: collectAdditional(ctx, data, data.Additional), }, }) @@ -218,6 +223,7 @@ func (r *clientVaultrecordResource) Update(ctx context.Context, req resource.Upd } tf = setAttributeValue(ctx, tf, "client_application_uuid", types.StringValue(data.ClientApplicationUUID.ValueString())) fillDataStructFromTFObjectRSClientApplicationVaultVaultRecord(&data, tf) + data.Additional = additionalBackup tflog.Info(ctx, "Updated a Topicus KeyHub client_vaultrecord") resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) diff --git a/internal/provider/resource-clientapplication.go b/internal/provider/resource-clientapplication.go index b581b15..d6e2753 100644 --- a/internal/provider/resource-clientapplication.go +++ b/internal/provider/resource-clientapplication.go @@ -83,6 +83,7 @@ func (r *clientapplicationResource) Create(ctx context.Context, req resource.Cre return } + additionalBackup := data.Additional r.providerData.Mutex.Lock() defer r.providerData.Mutex.Unlock() tflog.Info(ctx, "Creating Topicus KeyHub clientapplication") @@ -91,7 +92,7 @@ func (r *clientapplicationResource) Create(ctx context.Context, req resource.Cre wrapper, err := r.providerData.Client.Client().Post( ctx, newWrapper, &keyhubreq.ClientRequestBuilderPostRequestConfiguration{ QueryParameters: &keyhubreq.ClientRequestBuilderPostQueryParameters{ - Additional: collectAdditional(data), + Additional: collectAdditional(ctx, data, data.Additional), }, }) tkh, diags := findFirst[keyhubmodels.ClientClientApplicationable](ctx, wrapper, "clientapplication", nil, false, err) @@ -106,6 +107,7 @@ func (r *clientapplicationResource) Create(ctx context.Context, req resource.Cre return } fillDataStructFromTFObjectRSClientClientApplication(&data, tf) + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) @@ -120,6 +122,7 @@ func (r *clientapplicationResource) Read(ctx context.Context, req resource.ReadR return } + additionalBackup := data.Additional r.providerData.Mutex.RLock() defer r.providerData.Mutex.RUnlock() ctx = context.WithValue(ctx, keyHubClientKey, r.providerData.Client) @@ -127,7 +130,7 @@ func (r *clientapplicationResource) Read(ctx context.Context, req resource.ReadR tkh, err := r.providerData.Client.Client().ByClientidInt64(getSelfLink(data.Links).ID.ValueInt64()).Get( ctx, &keyhubreq.WithClientItemRequestBuilderGetRequestConfiguration{ QueryParameters: &keyhubreq.WithClientItemRequestBuilderGetQueryParameters{ - Additional: collectAdditional(data), + Additional: collectAdditional(ctx, data, data.Additional), }, }) @@ -147,6 +150,7 @@ func (r *clientapplicationResource) Read(ctx context.Context, req resource.ReadR return } fillDataStructFromTFObjectRSClientClientApplication(&data, tf) + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } diff --git a/internal/provider/resource-group.go b/internal/provider/resource-group.go index 14560c8..fa8b17f 100644 --- a/internal/provider/resource-group.go +++ b/internal/provider/resource-group.go @@ -83,6 +83,7 @@ func (r *groupResource) Create(ctx context.Context, req resource.CreateRequest, return } + additionalBackup := data.Additional r.providerData.Mutex.Lock() defer r.providerData.Mutex.Unlock() tflog.Info(ctx, "Creating Topicus KeyHub group") @@ -91,7 +92,7 @@ func (r *groupResource) Create(ctx context.Context, req resource.CreateRequest, wrapper, err := r.providerData.Client.Group().Post( ctx, newWrapper, &keyhubreq.GroupRequestBuilderPostRequestConfiguration{ QueryParameters: &keyhubreq.GroupRequestBuilderPostQueryParameters{ - Additional: collectAdditional(data), + Additional: collectAdditional(ctx, data, data.Additional), }, }) tkh, diags := findFirst[keyhubmodels.GroupGroupable](ctx, wrapper, "group", nil, false, err) @@ -106,6 +107,7 @@ func (r *groupResource) Create(ctx context.Context, req resource.CreateRequest, return } fillDataStructFromTFObjectRSGroupGroup(&data, tf) + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) @@ -120,6 +122,7 @@ func (r *groupResource) Read(ctx context.Context, req resource.ReadRequest, resp return } + additionalBackup := data.Additional r.providerData.Mutex.RLock() defer r.providerData.Mutex.RUnlock() ctx = context.WithValue(ctx, keyHubClientKey, r.providerData.Client) @@ -127,7 +130,7 @@ func (r *groupResource) Read(ctx context.Context, req resource.ReadRequest, resp tkh, err := r.providerData.Client.Group().ByGroupidInt64(getSelfLink(data.Links).ID.ValueInt64()).Get( ctx, &keyhubreq.WithGroupItemRequestBuilderGetRequestConfiguration{ QueryParameters: &keyhubreq.WithGroupItemRequestBuilderGetQueryParameters{ - Additional: collectAdditional(data), + Additional: collectAdditional(ctx, data, data.Additional), }, }) @@ -147,6 +150,7 @@ func (r *groupResource) Read(ctx context.Context, req resource.ReadRequest, resp return } fillDataStructFromTFObjectRSGroupGroup(&data, tf) + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } diff --git a/internal/provider/resource-group_vaultrecord.go b/internal/provider/resource-group_vaultrecord.go index cc7cec5..766d96d 100644 --- a/internal/provider/resource-group_vaultrecord.go +++ b/internal/provider/resource-group_vaultrecord.go @@ -83,6 +83,7 @@ func (r *groupVaultrecordResource) Create(ctx context.Context, req resource.Crea return } + additionalBackup := data.Additional r.providerData.Mutex.Lock() defer r.providerData.Mutex.Unlock() tflog.Info(ctx, "Creating Topicus KeyHub group_vaultrecord") @@ -97,7 +98,7 @@ func (r *groupVaultrecordResource) Create(ctx context.Context, req resource.Crea wrapper, err := r.providerData.Client.Group().ByGroupidInt64(*tkhParent.GetLinks()[0].GetId()).Vault().Record().Post( ctx, newWrapper, &keyhubreq.ItemVaultRecordRequestBuilderPostRequestConfiguration{ QueryParameters: &keyhubreq.ItemVaultRecordRequestBuilderPostQueryParameters{ - Additional: collectAdditional(data), + Additional: collectAdditional(ctx, data, data.Additional), }, }) tkh, diags := findFirst[keyhubmodels.VaultVaultRecordable](ctx, wrapper, "group_vaultrecord", nil, false, err) @@ -113,6 +114,7 @@ func (r *groupVaultrecordResource) Create(ctx context.Context, req resource.Crea } tf = setAttributeValue(ctx, tf, "group_uuid", types.StringValue(data.GroupUUID.ValueString())) fillDataStructFromTFObjectRSGroupVaultVaultRecord(&data, tf) + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) @@ -127,6 +129,7 @@ func (r *groupVaultrecordResource) Read(ctx context.Context, req resource.ReadRe return } + additionalBackup := data.Additional r.providerData.Mutex.RLock() defer r.providerData.Mutex.RUnlock() ctx = context.WithValue(ctx, keyHubClientKey, r.providerData.Client) @@ -146,7 +149,7 @@ func (r *groupVaultrecordResource) Read(ctx context.Context, req resource.ReadRe tkh, err := r.providerData.Client.Group().ByGroupidInt64(*tkhParent.GetLinks()[0].GetId()).Vault().Record().ByRecordidInt64(getSelfLink(data.Links).ID.ValueInt64()).Get( ctx, &keyhubreq.ItemVaultRecordWithRecordItemRequestBuilderGetRequestConfiguration{ QueryParameters: &keyhubreq.ItemVaultRecordWithRecordItemRequestBuilderGetQueryParameters{ - Additional: collectAdditional(data), + Additional: collectAdditional(ctx, data, data.Additional), }, }) @@ -167,6 +170,7 @@ func (r *groupVaultrecordResource) Read(ctx context.Context, req resource.ReadRe } tf = setAttributeValue(ctx, tf, "group_uuid", types.StringValue(data.GroupUUID.ValueString())) fillDataStructFromTFObjectRSGroupVaultVaultRecord(&data, tf) + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } @@ -191,6 +195,7 @@ func (r *groupVaultrecordResource) Update(ctx context.Context, req resource.Upda return } + additionalBackup := data.Additional r.providerData.Mutex.Lock() defer r.providerData.Mutex.Unlock() tflog.Info(ctx, "Updating Topicus KeyHub group_vaultrecord") @@ -203,7 +208,7 @@ func (r *groupVaultrecordResource) Update(ctx context.Context, req resource.Upda tkh, err := r.providerData.Client.Group().ByGroupidInt64(*tkhParent.GetLinks()[0].GetId()).Vault().Record().ByRecordidInt64(getSelfLink(data.Links).ID.ValueInt64()).Put( ctx, newTkh, &keyhubreq.ItemVaultRecordWithRecordItemRequestBuilderPutRequestConfiguration{ QueryParameters: &keyhubreq.ItemVaultRecordWithRecordItemRequestBuilderPutQueryParameters{ - Additional: collectAdditional(data), + Additional: collectAdditional(ctx, data, data.Additional), }, }) @@ -218,6 +223,7 @@ func (r *groupVaultrecordResource) Update(ctx context.Context, req resource.Upda } tf = setAttributeValue(ctx, tf, "group_uuid", types.StringValue(data.GroupUUID.ValueString())) fillDataStructFromTFObjectRSGroupVaultVaultRecord(&data, tf) + data.Additional = additionalBackup tflog.Info(ctx, "Updated a Topicus KeyHub group_vaultrecord") resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) diff --git a/internal/provider/resource-grouponsystem.go b/internal/provider/resource-grouponsystem.go index 687d6b5..0c5fa81 100644 --- a/internal/provider/resource-grouponsystem.go +++ b/internal/provider/resource-grouponsystem.go @@ -83,6 +83,7 @@ func (r *grouponsystemResource) Create(ctx context.Context, req resource.CreateR return } + additionalBackup := data.Additional r.providerData.Mutex.Lock() defer r.providerData.Mutex.Unlock() tflog.Info(ctx, "Creating Topicus KeyHub grouponsystem") @@ -97,7 +98,7 @@ func (r *grouponsystemResource) Create(ctx context.Context, req resource.CreateR wrapper, err := r.providerData.Client.System().BySystemidInt64(*tkhParent.GetLinks()[0].GetId()).Group().Post( ctx, newWrapper, &keyhubreq.ItemGroupRequestBuilderPostRequestConfiguration{ QueryParameters: &keyhubreq.ItemGroupRequestBuilderPostQueryParameters{ - Additional: collectAdditional(data), + Additional: collectAdditional(ctx, data, data.Additional), }, }) tkh, diags := findFirst[keyhubmodels.ProvisioningGroupOnSystemable](ctx, wrapper, "grouponsystem", nil, false, err) @@ -113,6 +114,7 @@ func (r *grouponsystemResource) Create(ctx context.Context, req resource.CreateR } tf = setAttributeValue(ctx, tf, "provisioned_system_uuid", types.StringValue(data.ProvisionedSystemUUID.ValueString())) fillDataStructFromTFObjectRSNestedProvisioningGroupOnSystem(&data, tf) + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) @@ -127,6 +129,7 @@ func (r *grouponsystemResource) Read(ctx context.Context, req resource.ReadReque return } + additionalBackup := data.Additional r.providerData.Mutex.RLock() defer r.providerData.Mutex.RUnlock() ctx = context.WithValue(ctx, keyHubClientKey, r.providerData.Client) @@ -146,7 +149,7 @@ func (r *grouponsystemResource) Read(ctx context.Context, req resource.ReadReque tkh, err := r.providerData.Client.System().BySystemidInt64(*tkhParent.GetLinks()[0].GetId()).Group().ByGroupidInt64(getSelfLink(data.Links).ID.ValueInt64()).Get( ctx, &keyhubreq.ItemGroupWithGroupItemRequestBuilderGetRequestConfiguration{ QueryParameters: &keyhubreq.ItemGroupWithGroupItemRequestBuilderGetQueryParameters{ - Additional: collectAdditional(data), + Additional: collectAdditional(ctx, data, data.Additional), }, }) @@ -167,6 +170,7 @@ func (r *grouponsystemResource) Read(ctx context.Context, req resource.ReadReque } tf = setAttributeValue(ctx, tf, "provisioned_system_uuid", types.StringValue(data.ProvisionedSystemUUID.ValueString())) fillDataStructFromTFObjectRSNestedProvisioningGroupOnSystem(&data, tf) + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } diff --git a/internal/provider/resource-serviceaccount.go b/internal/provider/resource-serviceaccount.go index a8847b6..647916b 100644 --- a/internal/provider/resource-serviceaccount.go +++ b/internal/provider/resource-serviceaccount.go @@ -83,6 +83,7 @@ func (r *serviceaccountResource) Create(ctx context.Context, req resource.Create return } + additionalBackup := data.Additional r.providerData.Mutex.Lock() defer r.providerData.Mutex.Unlock() tflog.Info(ctx, "Creating Topicus KeyHub serviceaccount") @@ -91,7 +92,7 @@ func (r *serviceaccountResource) Create(ctx context.Context, req resource.Create wrapper, err := r.providerData.Client.Serviceaccount().Post( ctx, newWrapper, &keyhubreq.ServiceaccountRequestBuilderPostRequestConfiguration{ QueryParameters: &keyhubreq.ServiceaccountRequestBuilderPostQueryParameters{ - Additional: collectAdditional(data), + Additional: collectAdditional(ctx, data, data.Additional), }, }) tkh, diags := findFirst[keyhubmodels.ServiceaccountServiceAccountable](ctx, wrapper, "serviceaccount", nil, false, err) @@ -106,6 +107,7 @@ func (r *serviceaccountResource) Create(ctx context.Context, req resource.Create return } fillDataStructFromTFObjectRSServiceaccountServiceAccount(&data, tf) + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) @@ -120,6 +122,7 @@ func (r *serviceaccountResource) Read(ctx context.Context, req resource.ReadRequ return } + additionalBackup := data.Additional r.providerData.Mutex.RLock() defer r.providerData.Mutex.RUnlock() ctx = context.WithValue(ctx, keyHubClientKey, r.providerData.Client) @@ -127,7 +130,7 @@ func (r *serviceaccountResource) Read(ctx context.Context, req resource.ReadRequ tkh, err := r.providerData.Client.Serviceaccount().ByServiceaccountidInt64(getSelfLink(data.Links).ID.ValueInt64()).Get( ctx, &keyhubreq.WithServiceaccountItemRequestBuilderGetRequestConfiguration{ QueryParameters: &keyhubreq.WithServiceaccountItemRequestBuilderGetQueryParameters{ - Additional: collectAdditional(data), + Additional: collectAdditional(ctx, data, data.Additional), }, }) @@ -147,6 +150,7 @@ func (r *serviceaccountResource) Read(ctx context.Context, req resource.ReadRequ return } fillDataStructFromTFObjectRSServiceaccountServiceAccount(&data, tf) + data.Additional = additionalBackup resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } @@ -171,13 +175,14 @@ func (r *serviceaccountResource) Update(ctx context.Context, req resource.Update return } + additionalBackup := data.Additional r.providerData.Mutex.Lock() defer r.providerData.Mutex.Unlock() tflog.Info(ctx, "Updating Topicus KeyHub serviceaccount") tkh, err := r.providerData.Client.Serviceaccount().ByServiceaccountidInt64(getSelfLink(data.Links).ID.ValueInt64()).Put( ctx, newTkh, &keyhubreq.WithServiceaccountItemRequestBuilderPutRequestConfiguration{ QueryParameters: &keyhubreq.WithServiceaccountItemRequestBuilderPutQueryParameters{ - Additional: collectAdditional(data), + Additional: collectAdditional(ctx, data, data.Additional), }, }) @@ -191,6 +196,7 @@ func (r *serviceaccountResource) Update(ctx context.Context, req resource.Update return } fillDataStructFromTFObjectRSServiceaccountServiceAccount(&data, tf) + data.Additional = additionalBackup tflog.Info(ctx, "Updated a Topicus KeyHub serviceaccount") resp.Diagnostics.Append(resp.State.Set(ctx, &data)...)