From 10c8756177374e3b397b8eec0030c1e1cfac02b6 Mon Sep 17 00:00:00 2001 From: Oscar Forero Date: Wed, 22 Mar 2023 20:49:19 +0100 Subject: [PATCH] Use the READ with the username instead of the GUID in the User CRUD --- docs/resources/kopicloud_user.md | 19 -- example/main.tf | 5 +- generator-inputs/user.json | 15 +- .../kopicloud.computer-cleanup-crud.gen.go | 4 +- provider/kopicloud.computer-crud.gen.go | 4 +- provider/kopicloud.converters.gen.go | 266 ++++++++--------- .../kopicloud.distribution-group-crud.gen.go | 4 +- provider/kopicloud.dns_a_record-crud.gen.go | 4 +- .../kopicloud.dns_aaaa_record-crud.gen.go | 4 +- .../kopicloud.dns_cname_record-crud.gen.go | 4 +- .../kopicloud.dns_lookup_zone-crud.gen.go | 4 +- ...icloud.dns_reverse_lookup_zone-crud.gen.go | 4 +- .../kopicloud.group-memberships-crud.gen.go | 4 +- provider/kopicloud.ou-crud.gen.go | 4 +- provider/kopicloud.schemas.gen.go | 278 +++++++++--------- provider/kopicloud.security-group-crud.gen.go | 4 +- provider/kopicloud.user-crud.gen.go | 275 +---------------- provider/kopicloud.user-disable-crud.gen.go | 4 +- provider/kopicloud.user-enable-crud.gen.go | 4 +- .../kopicloud.user-password-reset-crud.gen.go | 4 +- provider/kopicloud.user-rename.gen.go | 4 +- provider/kopicloud.user-unlock-crud.gen.go | 4 +- provider/kopicloud.user-update.gen.go | 84 ------ 23 files changed, 323 insertions(+), 683 deletions(-) diff --git a/docs/resources/kopicloud_user.md b/docs/resources/kopicloud_user.md index 2cfd050..72e6a5a 100644 --- a/docs/resources/kopicloud_user.md +++ b/docs/resources/kopicloud_user.md @@ -23,39 +23,20 @@ Element to create, update, delete Users from Active Directory ### Optional - `change_password_next_logon` (Boolean) -- `city` (String) - `company` (String) -- `country` (String) - `department` (String) - `description` (String) - `display_name` (String) - `email_address` (String) - `first_name` (String) -- `home_folder_directory` (String) -- `home_folder_drive` (String) -- `home_folder_path` (String) -- `home_phone` (String) - `initials` (String) - `job_title` (String) - `last_name` (String) - `manager` (String) -- `mobile_phone` (String) - `office` (String) -- `office_phone` (String) - `ou_path` (String) - `password_never_expires` (Boolean) -- `po_box` (String) -- `profile_logon_script` (String) -- `profile_path` (String) -- `rds_allow_logon` (Boolean) -- `rds_connect_drive` (Boolean) -- `rds_home_folder_drive` (String) -- `rds_home_folder_path` (String) -- `rds_profile_path` (String) - `show_fields` (String) -- `state` (String) -- `street` (String) -- `zip_code` (String) ### Read-Only diff --git a/example/main.tf b/example/main.tf index a3efaf7..92a2216 100644 --- a/example/main.tf +++ b/example/main.tf @@ -321,11 +321,12 @@ provider "kopicloud" { # } resource "kopicloud_user" "test" { - username = "oforero13" + username = "oforero14" password = var.oforero11_password first_name = "Oscar" last_name = "Forero" - show_fields = "Username,FirstName,LastName" + initials = "OMFC" + company = "Kopicloud Inc." } output "user" { diff --git a/generator-inputs/user.json b/generator-inputs/user.json index ca7f54a..a87e073 100644 --- a/generator-inputs/user.json +++ b/generator-inputs/user.json @@ -487,15 +487,16 @@ }, "read": { "api_function": { - "name": "GetApiADUserGuidDetailsWithResponse", - "arguments": [], + "name": "GetApiADUserUsernameDetailsWithResponse", + "arguments": [ + { + "name": "username", + "type": "string" + } + ], "params": { - "name": "GetApiADUserGuidDetailsParams", + "name": "GetApiADUserUsernameDetailsParams", "fields": [ - { - "api_name": "UserGuid", - "type": "string" - }, { "api_name": "ShowFields", "name": "show_fields", diff --git a/provider/kopicloud.computer-cleanup-crud.gen.go b/provider/kopicloud.computer-cleanup-crud.gen.go index 7791bf9..7a74acd 100644 --- a/provider/kopicloud.computer-cleanup-crud.gen.go +++ b/provider/kopicloud.computer-cleanup-crud.gen.go @@ -67,7 +67,7 @@ func resourceComputerCleanUp() *schema.Resource { func resourceComputerCleanUpCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceComputerCleanUpRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceComputerCleanUpCreate")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ @@ -267,7 +267,7 @@ func resourceComputerCleanUpRead(ctx context.Context, d *schema.ResourceData, m func resourceComputerCleanUpDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceComputerCleanUpRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceComputerCleanUpDelete")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ diff --git a/provider/kopicloud.computer-crud.gen.go b/provider/kopicloud.computer-crud.gen.go index ec9d056..a78dba0 100644 --- a/provider/kopicloud.computer-crud.gen.go +++ b/provider/kopicloud.computer-crud.gen.go @@ -62,7 +62,7 @@ func resourceComputer() *schema.Resource { func resourceComputerCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceComputerRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceComputerCreate")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ @@ -242,7 +242,7 @@ func resourceComputerRead(ctx context.Context, d *schema.ResourceData, m interfa func resourceComputerDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceComputerRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceComputerDelete")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ diff --git a/provider/kopicloud.converters.gen.go b/provider/kopicloud.converters.gen.go index b33f93b..7fca644 100644 --- a/provider/kopicloud.converters.gen.go +++ b/provider/kopicloud.converters.gen.go @@ -37,33 +37,33 @@ func isNotEmpty(f interface{}) bool { func DnsRecordToTerraform(obj *api.DnsRecord) map[string]interface{} { result := make(map[string]interface{}) - if obj.Name != nil && isNotEmpty(obj.Name) { + if obj.Data != nil && isNotEmpty(obj.Data) { - result["name"] = obj.Name + result["data"] = obj.Data } - if obj.Type != nil && isNotEmpty(obj.Type) { + if obj.Zone != nil && isNotEmpty(obj.Zone) { - result["type"] = obj.Type + result["zone"] = obj.Zone } - if obj.Data != nil && isNotEmpty(obj.Data) { + if obj.Timestamp != nil && isNotEmpty(obj.Timestamp) { - result["data"] = obj.Data + result["timestamp"] = obj.Timestamp } - if obj.Zone != nil && isNotEmpty(obj.Zone) { + if obj.Name != nil && isNotEmpty(obj.Name) { - result["zone"] = obj.Zone + result["name"] = obj.Name } - if obj.Timestamp != nil && isNotEmpty(obj.Timestamp) { + if obj.Type != nil && isNotEmpty(obj.Type) { - result["timestamp"] = obj.Timestamp + result["type"] = obj.Type } @@ -125,45 +125,45 @@ func DnsZoneListToTerraform(list *[]api.DnsZone) []interface{} { func GroupToTerraform(obj *api.Group) map[string]interface{} { result := make(map[string]interface{}) - if obj.Type != nil && isNotEmpty(obj.Type) { + if obj.Description != nil && isNotEmpty(obj.Description) { - result["type"] = obj.Type + result["description"] = obj.Description } - if obj.Guid != nil && isNotEmpty(obj.Guid) { + if obj.Email != nil && isNotEmpty(obj.Email) { - result["guid"] = UuidToTerraform(obj.Guid) + result["email"] = obj.Email } - if obj.Name != nil && isNotEmpty(obj.Name) { + if obj.OuPath != nil && isNotEmpty(obj.OuPath) { - result["name"] = obj.Name + result["ou_path"] = obj.OuPath } - if obj.Scope != nil && isNotEmpty(obj.Scope) { + if obj.Type != nil && isNotEmpty(obj.Type) { - result["scope"] = obj.Scope + result["type"] = obj.Type } - if obj.Description != nil && isNotEmpty(obj.Description) { + if obj.Guid != nil && isNotEmpty(obj.Guid) { - result["description"] = obj.Description + result["guid"] = UuidToTerraform(obj.Guid) } - if obj.Email != nil && isNotEmpty(obj.Email) { + if obj.Name != nil && isNotEmpty(obj.Name) { - result["email"] = obj.Email + result["name"] = obj.Name } - if obj.OuPath != nil && isNotEmpty(obj.OuPath) { + if obj.Scope != nil && isNotEmpty(obj.Scope) { - result["ou_path"] = obj.OuPath + result["scope"] = obj.Scope } @@ -181,83 +181,72 @@ func GroupListToTerraform(list *[]api.Group) []interface{} { return make([]interface{}, 0) } -func ComputerToTerraform(obj *api.Computer) map[string]interface{} { +func UserToTerraform(obj *api.User) map[string]interface{} { result := make(map[string]interface{}) - if obj.Sid != nil && isNotEmpty(obj.Sid) { + if obj.Manager != nil && isNotEmpty(obj.Manager) { - result["sid"] = obj.Sid + result["manager"] = obj.Manager } - if obj.ComputerName != nil && isNotEmpty(obj.ComputerName) { + if obj.City != nil && isNotEmpty(obj.City) { - result["computer_name"] = obj.ComputerName + result["city"] = obj.City } - if obj.OperatingSystem != nil && isNotEmpty(obj.OperatingSystem) { + if obj.Country != nil && isNotEmpty(obj.Country) { - result["operating_system"] = obj.OperatingSystem + result["country"] = obj.Country } - if obj.Description != nil && isNotEmpty(obj.Description) { + if obj.HomePhone != nil && isNotEmpty(obj.HomePhone) { - result["description"] = obj.Description + result["home_phone"] = obj.HomePhone } - if obj.DnsName != nil && isNotEmpty(obj.DnsName) { + if obj.HomeFolderDirectory != nil && isNotEmpty(obj.HomeFolderDirectory) { - result["dns_name"] = obj.DnsName + result["home_folder_directory"] = obj.HomeFolderDirectory } - if obj.Path != nil && isNotEmpty(obj.Path) { + if obj.Username != nil && isNotEmpty(obj.Username) { - result["path"] = obj.Path + result["username"] = obj.Username } - if obj.Created != nil && isNotEmpty(obj.Created) { + if obj.OuPath != nil && isNotEmpty(obj.OuPath) { - result["created"] = obj.Created + result["ou_path"] = obj.OuPath } - return result -} + if obj.PasswordNeverExpired != nil && isNotEmpty(obj.PasswordNeverExpired) { -func ComputerListToTerraform(list *[]api.Computer) []interface{} { - if list != nil { - results := make([]interface{}, len(*list)) - for i, Computer := range *list { - results[i] = ComputerToTerraform(&Computer) - } - return results - } - return make([]interface{}, 0) -} + result["password_never_expired"] = obj.PasswordNeverExpired -func UserToTerraform(obj *api.User) map[string]interface{} { - result := make(map[string]interface{}) + } - if obj.Manager != nil && isNotEmpty(obj.Manager) { + if obj.ProfilePath != nil && isNotEmpty(obj.ProfilePath) { - result["manager"] = obj.Manager + result["profile_path"] = obj.ProfilePath } - if obj.ProfileLogonScript != nil && isNotEmpty(obj.ProfileLogonScript) { + if obj.Guid != nil && isNotEmpty(obj.Guid) { - result["profile_logon_script"] = obj.ProfileLogonScript + result["guid"] = UuidToTerraform(obj.Guid) } - if obj.Company != nil && isNotEmpty(obj.Company) { + if obj.LastName != nil && isNotEmpty(obj.LastName) { - result["company"] = obj.Company + result["last_name"] = obj.LastName } @@ -267,206 +256,217 @@ func UserToTerraform(obj *api.User) map[string]interface{} { } - if obj.State != nil && isNotEmpty(obj.State) { + if obj.Company != nil && isNotEmpty(obj.Company) { - result["state"] = obj.State + result["company"] = obj.Company } - if obj.Country != nil && isNotEmpty(obj.Country) { + if obj.MobilePhone != nil && isNotEmpty(obj.MobilePhone) { - result["country"] = obj.Country + result["mobile_phone"] = obj.MobilePhone } - if obj.HomePhone != nil && isNotEmpty(obj.HomePhone) { + if obj.ProfileLogonScript != nil && isNotEmpty(obj.ProfileLogonScript) { - result["home_phone"] = obj.HomePhone + result["profile_logon_script"] = obj.ProfileLogonScript } - if obj.HomeFolderPath != nil && isNotEmpty(obj.HomeFolderPath) { + if obj.RdsHomeFolderDrive != nil && isNotEmpty(obj.RdsHomeFolderDrive) { - result["home_folder_path"] = obj.HomeFolderPath + result["rds_home_folder_drive"] = obj.RdsHomeFolderDrive } - if obj.Description != nil && isNotEmpty(obj.Description) { + if obj.ChangePasswordNextLogon != nil && isNotEmpty(obj.ChangePasswordNextLogon) { - result["description"] = obj.Description + result["change_password_next_logon"] = obj.ChangePasswordNextLogon } - if obj.StreetAddress != nil && isNotEmpty(obj.StreetAddress) { + if obj.State != nil && isNotEmpty(obj.State) { - result["street_address"] = obj.StreetAddress + result["state"] = obj.State } - if obj.RdsAllowLogon != nil && isNotEmpty(obj.RdsAllowLogon) { + if obj.PostalCode != nil && isNotEmpty(obj.PostalCode) { - result["rds_allow_logon"] = obj.RdsAllowLogon + result["postal_code"] = obj.PostalCode } - if obj.LastName != nil && isNotEmpty(obj.LastName) { + if obj.RdsHomeFolderPath != nil && isNotEmpty(obj.RdsHomeFolderPath) { - result["last_name"] = obj.LastName + result["rds_home_folder_path"] = obj.RdsHomeFolderPath } - if obj.SamUsername != nil && isNotEmpty(obj.SamUsername) { + if obj.OfficePhone != nil && isNotEmpty(obj.OfficePhone) { - result["sam_username"] = obj.SamUsername + result["office_phone"] = obj.OfficePhone } - if obj.Initials != nil && isNotEmpty(obj.Initials) { + if obj.RdsConnectDrive != nil && isNotEmpty(obj.RdsConnectDrive) { - result["initials"] = obj.Initials + result["rds_connect_drive"] = obj.RdsConnectDrive } - if obj.JobTitle != nil && isNotEmpty(obj.JobTitle) { + if obj.RdsAllowLogon != nil && isNotEmpty(obj.RdsAllowLogon) { - result["job_title"] = obj.JobTitle + result["rds_allow_logon"] = obj.RdsAllowLogon } - if obj.StreetPoBox != nil && isNotEmpty(obj.StreetPoBox) { + if obj.DisplayName != nil && isNotEmpty(obj.DisplayName) { - result["street_po_box"] = obj.StreetPoBox + result["display_name"] = obj.DisplayName } - if obj.ProfilePath != nil && isNotEmpty(obj.ProfilePath) { + if obj.EmailAddress != nil && isNotEmpty(obj.EmailAddress) { - result["profile_path"] = obj.ProfilePath + result["email_address"] = obj.EmailAddress } - if obj.RdsProfilePath != nil && isNotEmpty(obj.RdsProfilePath) { + if obj.SamUsername != nil && isNotEmpty(obj.SamUsername) { - result["rds_profile_path"] = obj.RdsProfilePath + result["sam_username"] = obj.SamUsername } - if obj.RdsHomeFolderDrive != nil && isNotEmpty(obj.RdsHomeFolderDrive) { + if obj.JobTitle != nil && isNotEmpty(obj.JobTitle) { - result["rds_home_folder_drive"] = obj.RdsHomeFolderDrive + result["job_title"] = obj.JobTitle } - if obj.EmailAddress != nil && isNotEmpty(obj.EmailAddress) { + if obj.StreetAddress != nil && isNotEmpty(obj.StreetAddress) { - result["email_address"] = obj.EmailAddress + result["street_address"] = obj.StreetAddress } - if obj.FirstName != nil && isNotEmpty(obj.FirstName) { + if obj.HomeFolderPath != nil && isNotEmpty(obj.HomeFolderPath) { - result["first_name"] = obj.FirstName + result["home_folder_path"] = obj.HomeFolderPath } - if obj.Department != nil && isNotEmpty(obj.Department) { + if obj.RdsProfilePath != nil && isNotEmpty(obj.RdsProfilePath) { - result["department"] = obj.Department + result["rds_profile_path"] = obj.RdsProfilePath } - if obj.ChangePasswordNextLogon != nil && isNotEmpty(obj.ChangePasswordNextLogon) { + if obj.FirstName != nil && isNotEmpty(obj.FirstName) { - result["change_password_next_logon"] = obj.ChangePasswordNextLogon + result["first_name"] = obj.FirstName } - if obj.RdsConnectDrive != nil && isNotEmpty(obj.RdsConnectDrive) { + if obj.Description != nil && isNotEmpty(obj.Description) { - result["rds_connect_drive"] = obj.RdsConnectDrive + result["description"] = obj.Description } - if obj.Guid != nil && isNotEmpty(obj.Guid) { + if obj.Department != nil && isNotEmpty(obj.Department) { - result["guid"] = UuidToTerraform(obj.Guid) + result["department"] = obj.Department } - if obj.DisplayName != nil && isNotEmpty(obj.DisplayName) { + if obj.Initials != nil && isNotEmpty(obj.Initials) { - result["display_name"] = obj.DisplayName + result["initials"] = obj.Initials } - if obj.PostalCode != nil && isNotEmpty(obj.PostalCode) { + if obj.StreetPoBox != nil && isNotEmpty(obj.StreetPoBox) { - result["postal_code"] = obj.PostalCode + result["street_po_box"] = obj.StreetPoBox } - if obj.HomeFolderDirectory != nil && isNotEmpty(obj.HomeFolderDirectory) { + if obj.HomeFolderDrive != nil && isNotEmpty(obj.HomeFolderDrive) { - result["home_folder_directory"] = obj.HomeFolderDirectory + result["home_folder_drive"] = obj.HomeFolderDrive } - if obj.RdsHomeFolderPath != nil && isNotEmpty(obj.RdsHomeFolderPath) { - - result["rds_home_folder_path"] = obj.RdsHomeFolderPath + return result +} +func UserListToTerraform(list *[]api.User) []interface{} { + if list != nil { + results := make([]interface{}, len(*list)) + for i, User := range *list { + results[i] = UserToTerraform(&User) + } + return results } + return make([]interface{}, 0) +} - if obj.Username != nil && isNotEmpty(obj.Username) { +func ComputerToTerraform(obj *api.Computer) map[string]interface{} { + result := make(map[string]interface{}) - result["username"] = obj.Username + if obj.Description != nil && isNotEmpty(obj.Description) { + + result["description"] = obj.Description } - if obj.OfficePhone != nil && isNotEmpty(obj.OfficePhone) { + if obj.DnsName != nil && isNotEmpty(obj.DnsName) { - result["office_phone"] = obj.OfficePhone + result["dns_name"] = obj.DnsName } - if obj.MobilePhone != nil && isNotEmpty(obj.MobilePhone) { + if obj.Path != nil && isNotEmpty(obj.Path) { - result["mobile_phone"] = obj.MobilePhone + result["path"] = obj.Path } - if obj.OuPath != nil && isNotEmpty(obj.OuPath) { + if obj.Created != nil && isNotEmpty(obj.Created) { - result["ou_path"] = obj.OuPath + result["created"] = obj.Created } - if obj.City != nil && isNotEmpty(obj.City) { + if obj.Sid != nil && isNotEmpty(obj.Sid) { - result["city"] = obj.City + result["sid"] = obj.Sid } - if obj.HomeFolderDrive != nil && isNotEmpty(obj.HomeFolderDrive) { + if obj.ComputerName != nil && isNotEmpty(obj.ComputerName) { - result["home_folder_drive"] = obj.HomeFolderDrive + result["computer_name"] = obj.ComputerName } - if obj.PasswordNeverExpired != nil && isNotEmpty(obj.PasswordNeverExpired) { + if obj.OperatingSystem != nil && isNotEmpty(obj.OperatingSystem) { - result["password_never_expired"] = obj.PasswordNeverExpired + result["operating_system"] = obj.OperatingSystem } return result } -func UserListToTerraform(list *[]api.User) []interface{} { +func ComputerListToTerraform(list *[]api.Computer) []interface{} { if list != nil { results := make([]interface{}, len(*list)) - for i, User := range *list { - results[i] = UserToTerraform(&User) + for i, Computer := range *list { + results[i] = ComputerToTerraform(&Computer) } return results } @@ -476,12 +476,6 @@ func UserListToTerraform(list *[]api.User) []interface{} { func OUToTerraform(obj *api.OU) map[string]interface{} { result := make(map[string]interface{}) - if obj.Name != nil && isNotEmpty(obj.Name) { - - result["name"] = obj.Name - - } - if obj.Description != nil && isNotEmpty(obj.Description) { result["description"] = obj.Description @@ -506,6 +500,12 @@ func OUToTerraform(obj *api.OU) map[string]interface{} { } + if obj.Name != nil && isNotEmpty(obj.Name) { + + result["name"] = obj.Name + + } + return result } diff --git a/provider/kopicloud.distribution-group-crud.gen.go b/provider/kopicloud.distribution-group-crud.gen.go index eb20f85..8031a45 100644 --- a/provider/kopicloud.distribution-group-crud.gen.go +++ b/provider/kopicloud.distribution-group-crud.gen.go @@ -80,7 +80,7 @@ func resourceDistributionGroup() *schema.Resource { func resourceDistributionGroupCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDistributionGroupRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDistributionGroupCreate")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ @@ -268,7 +268,7 @@ func resourceDistributionGroupRead(ctx context.Context, d *schema.ResourceData, func resourceDistributionGroupDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDistributionGroupRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDistributionGroupDelete")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ diff --git a/provider/kopicloud.dns_a_record-crud.gen.go b/provider/kopicloud.dns_a_record-crud.gen.go index 3f34918..4486805 100644 --- a/provider/kopicloud.dns_a_record-crud.gen.go +++ b/provider/kopicloud.dns_a_record-crud.gen.go @@ -66,7 +66,7 @@ func resourceDnsARecord() *schema.Resource { func resourceDnsARecordCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDnsARecordRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDnsARecordCreate")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ @@ -254,7 +254,7 @@ func resourceDnsARecordRead(ctx context.Context, d *schema.ResourceData, m inter func resourceDnsARecordDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDnsARecordRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDnsARecordDelete")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ diff --git a/provider/kopicloud.dns_aaaa_record-crud.gen.go b/provider/kopicloud.dns_aaaa_record-crud.gen.go index 37c925c..38327d4 100644 --- a/provider/kopicloud.dns_aaaa_record-crud.gen.go +++ b/provider/kopicloud.dns_aaaa_record-crud.gen.go @@ -66,7 +66,7 @@ func resourceDnsAAAARecord() *schema.Resource { func resourceDnsAAAARecordCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDnsAAAARecordRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDnsAAAARecordCreate")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ @@ -254,7 +254,7 @@ func resourceDnsAAAARecordRead(ctx context.Context, d *schema.ResourceData, m in func resourceDnsAAAARecordDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDnsAAAARecordRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDnsAAAARecordDelete")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ diff --git a/provider/kopicloud.dns_cname_record-crud.gen.go b/provider/kopicloud.dns_cname_record-crud.gen.go index f534f9e..44db575 100644 --- a/provider/kopicloud.dns_cname_record-crud.gen.go +++ b/provider/kopicloud.dns_cname_record-crud.gen.go @@ -66,7 +66,7 @@ func resourceDnsCNameRecord() *schema.Resource { func resourceDnsCNameRecordCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDnsCNameRecordRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDnsCNameRecordCreate")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ @@ -254,7 +254,7 @@ func resourceDnsCNameRecordRead(ctx context.Context, d *schema.ResourceData, m i func resourceDnsCNameRecordDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDnsCNameRecordRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDnsCNameRecordDelete")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ diff --git a/provider/kopicloud.dns_lookup_zone-crud.gen.go b/provider/kopicloud.dns_lookup_zone-crud.gen.go index 4144acf..854efef 100644 --- a/provider/kopicloud.dns_lookup_zone-crud.gen.go +++ b/provider/kopicloud.dns_lookup_zone-crud.gen.go @@ -44,7 +44,7 @@ func resourceDnsLookupZone() *schema.Resource { func resourceDnsLookupZoneCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDnsLookupZoneRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDnsLookupZoneCreate")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ @@ -216,7 +216,7 @@ func resourceDnsLookupZoneRead(ctx context.Context, d *schema.ResourceData, m in func resourceDnsLookupZoneDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDnsLookupZoneRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDnsLookupZoneDelete")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ diff --git a/provider/kopicloud.dns_reverse_lookup_zone-crud.gen.go b/provider/kopicloud.dns_reverse_lookup_zone-crud.gen.go index e309d74..cad0ad1 100644 --- a/provider/kopicloud.dns_reverse_lookup_zone-crud.gen.go +++ b/provider/kopicloud.dns_reverse_lookup_zone-crud.gen.go @@ -44,7 +44,7 @@ func resourceDnsReverseLookupZone() *schema.Resource { func resourceDnsReverseLookupZoneCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDnsReverseLookupZoneRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDnsReverseLookupZoneCreate")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ @@ -216,7 +216,7 @@ func resourceDnsReverseLookupZoneRead(ctx context.Context, d *schema.ResourceDat func resourceDnsReverseLookupZoneDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDnsReverseLookupZoneRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceDnsReverseLookupZoneDelete")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ diff --git a/provider/kopicloud.group-memberships-crud.gen.go b/provider/kopicloud.group-memberships-crud.gen.go index be0f60b..32f7438 100644 --- a/provider/kopicloud.group-memberships-crud.gen.go +++ b/provider/kopicloud.group-memberships-crud.gen.go @@ -55,7 +55,7 @@ func resourceGroupMembership() *schema.Resource { func resourceGroupMembershipCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceGroupMembershipRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceGroupMembershipCreate")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ @@ -235,7 +235,7 @@ func resourceGroupMembershipRead(ctx context.Context, d *schema.ResourceData, m func resourceGroupMembershipDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceGroupMembershipRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceGroupMembershipDelete")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ diff --git a/provider/kopicloud.ou-crud.gen.go b/provider/kopicloud.ou-crud.gen.go index 36d598f..dea079a 100644 --- a/provider/kopicloud.ou-crud.gen.go +++ b/provider/kopicloud.ou-crud.gen.go @@ -72,7 +72,7 @@ func resourceOU() *schema.Resource { func resourceOUCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceOURead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceOUCreate")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ @@ -259,7 +259,7 @@ func resourceOURead(ctx context.Context, d *schema.ResourceData, m interface{}) func resourceOUDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceOURead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceOUDelete")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ diff --git a/provider/kopicloud.schemas.gen.go b/provider/kopicloud.schemas.gen.go index 7224b95..4a8af7e 100644 --- a/provider/kopicloud.schemas.gen.go +++ b/provider/kopicloud.schemas.gen.go @@ -37,44 +37,50 @@ func schemaMapOfScalarElement(t schema.ValueType, field_name string) map[string] } } -func schemaOfDnsZoneList(scalar_field_name string) *schema.Schema { +func schemaOfGroupList(scalar_field_name string) *schema.Schema { return &schema.Schema{ Type: schema.TypeList, Computed: true, - Description: fmt.Sprintf("List of %s", "DnsZone"), + Description: fmt.Sprintf("List of %s", "Group"), Elem: &schema.Resource{ - Schema: schemaMapOfDnsZone(scalar_field_name), + Schema: schemaMapOfGroup(scalar_field_name), }, } } -func schemaOfDnsZone(scalar_field_name string) *schema.Schema { +func schemaOfGroup(scalar_field_name string) *schema.Schema { return &schema.Schema{ Type: schema.TypeList, Computed: true, - Description: fmt.Sprintf("Single Element List of %s", "DnsZone"), + Description: fmt.Sprintf("Single Element List of %s", "Group"), Elem: &schema.Resource{ - Schema: schemaMapOfDnsZone(scalar_field_name), + Schema: schemaMapOfGroup(scalar_field_name), }, } } -func schemaMapOfDnsZone(scalar_field_name string) map[string]*schema.Schema { +func schemaMapOfGroup(scalar_field_name string) map[string]*schema.Schema { return map[string]*schema.Schema{ - "distinguished_name": { + "scope": { Type: schema.TypeString, Computed: true, Description: "", }, - "zone_name": { + "description": { Type: schema.TypeString, Computed: true, Description: "", }, - "zone_type": { + "email": { + Type: schema.TypeString, + Computed: true, + Description: "", + }, + + "ou_path": { Type: schema.TypeString, Computed: true, Description: "", @@ -85,59 +91,65 @@ func schemaMapOfDnsZone(scalar_field_name string) map[string]*schema.Schema { Computed: true, Description: "", }, + + "guid": { + Type: schema.TypeString, + Computed: true, + Description: "", + }, + + "name": { + Type: schema.TypeString, + Computed: true, + Description: "", + }, } } -func schemaOfOUList(scalar_field_name string) *schema.Schema { +func schemaOfDnsZoneList(scalar_field_name string) *schema.Schema { return &schema.Schema{ Type: schema.TypeList, Computed: true, - Description: fmt.Sprintf("List of %s", "OU"), + Description: fmt.Sprintf("List of %s", "DnsZone"), Elem: &schema.Resource{ - Schema: schemaMapOfOU(scalar_field_name), + Schema: schemaMapOfDnsZone(scalar_field_name), }, } } -func schemaOfOU(scalar_field_name string) *schema.Schema { +func schemaOfDnsZone(scalar_field_name string) *schema.Schema { return &schema.Schema{ Type: schema.TypeList, Computed: true, - Description: fmt.Sprintf("Single Element List of %s", "OU"), + Description: fmt.Sprintf("Single Element List of %s", "DnsZone"), Elem: &schema.Resource{ - Schema: schemaMapOfOU(scalar_field_name), + Schema: schemaMapOfDnsZone(scalar_field_name), }, } } -func schemaMapOfOU(scalar_field_name string) map[string]*schema.Schema { +func schemaMapOfDnsZone(scalar_field_name string) map[string]*schema.Schema { return map[string]*schema.Schema{ - "protected": { - Type: schema.TypeBool, - Computed: true, - Description: "", - }, - - "guid": { + "distinguished_name": { Type: schema.TypeString, Computed: true, Description: "", }, - "name": { + "zone_name": { Type: schema.TypeString, Computed: true, Description: "", }, - "description": { + "zone_type": { Type: schema.TypeString, Computed: true, Description: "", }, - "path": { + "type": { Type: schema.TypeString, Computed: true, Description: "", @@ -145,32 +157,32 @@ func schemaMapOfOU(scalar_field_name string) map[string]*schema.Schema { } } -func schemaOfDnsRecordList(scalar_field_name string) *schema.Schema { +func schemaOfOUList(scalar_field_name string) *schema.Schema { return &schema.Schema{ Type: schema.TypeList, Computed: true, - Description: fmt.Sprintf("List of %s", "DnsRecord"), + Description: fmt.Sprintf("List of %s", "OU"), Elem: &schema.Resource{ - Schema: schemaMapOfDnsRecord(scalar_field_name), + Schema: schemaMapOfOU(scalar_field_name), }, } } -func schemaOfDnsRecord(scalar_field_name string) *schema.Schema { +func schemaOfOU(scalar_field_name string) *schema.Schema { return &schema.Schema{ Type: schema.TypeList, Computed: true, - Description: fmt.Sprintf("Single Element List of %s", "DnsRecord"), + Description: fmt.Sprintf("Single Element List of %s", "OU"), Elem: &schema.Resource{ - Schema: schemaMapOfDnsRecord(scalar_field_name), + Schema: schemaMapOfOU(scalar_field_name), }, } } -func schemaMapOfDnsRecord(scalar_field_name string) map[string]*schema.Schema { +func schemaMapOfOU(scalar_field_name string) map[string]*schema.Schema { return map[string]*schema.Schema{ - "timestamp": { + "guid": { Type: schema.TypeString, Computed: true, Description: "", @@ -182,49 +194,49 @@ func schemaMapOfDnsRecord(scalar_field_name string) map[string]*schema.Schema { Description: "", }, - "type": { + "description": { Type: schema.TypeString, Computed: true, Description: "", }, - "data": { + "path": { Type: schema.TypeString, Computed: true, Description: "", }, - "zone": { - Type: schema.TypeString, + "protected": { + Type: schema.TypeBool, Computed: true, Description: "", }, } } -func schemaOfGroupList(scalar_field_name string) *schema.Schema { +func schemaOfComputerList(scalar_field_name string) *schema.Schema { return &schema.Schema{ Type: schema.TypeList, Computed: true, - Description: fmt.Sprintf("List of %s", "Group"), + Description: fmt.Sprintf("List of %s", "Computer"), Elem: &schema.Resource{ - Schema: schemaMapOfGroup(scalar_field_name), + Schema: schemaMapOfComputer(scalar_field_name), }, } } -func schemaOfGroup(scalar_field_name string) *schema.Schema { +func schemaOfComputer(scalar_field_name string) *schema.Schema { return &schema.Schema{ Type: schema.TypeList, Computed: true, - Description: fmt.Sprintf("Single Element List of %s", "Group"), + Description: fmt.Sprintf("Single Element List of %s", "Computer"), Elem: &schema.Resource{ - Schema: schemaMapOfGroup(scalar_field_name), + Schema: schemaMapOfComputer(scalar_field_name), }, } } -func schemaMapOfGroup(scalar_field_name string) map[string]*schema.Schema { +func schemaMapOfComputer(scalar_field_name string) map[string]*schema.Schema { return map[string]*schema.Schema{ "description": { @@ -233,37 +245,37 @@ func schemaMapOfGroup(scalar_field_name string) map[string]*schema.Schema { Description: "", }, - "email": { + "dns_name": { Type: schema.TypeString, Computed: true, Description: "", }, - "ou_path": { + "path": { Type: schema.TypeString, Computed: true, Description: "", }, - "type": { + "created": { Type: schema.TypeString, Computed: true, Description: "", }, - "guid": { + "sid": { Type: schema.TypeString, Computed: true, Description: "", }, - "name": { + "computer_name": { Type: schema.TypeString, Computed: true, Description: "", }, - "scope": { + "operating_system": { Type: schema.TypeString, Computed: true, Description: "", @@ -271,104 +283,113 @@ func schemaMapOfGroup(scalar_field_name string) map[string]*schema.Schema { } } -func schemaOfUserList(scalar_field_name string) *schema.Schema { +func schemaOfDnsRecordList(scalar_field_name string) *schema.Schema { return &schema.Schema{ Type: schema.TypeList, Computed: true, - Description: fmt.Sprintf("List of %s", "User"), + Description: fmt.Sprintf("List of %s", "DnsRecord"), Elem: &schema.Resource{ - Schema: schemaMapOfUser(scalar_field_name), + Schema: schemaMapOfDnsRecord(scalar_field_name), }, } } -func schemaOfUser(scalar_field_name string) *schema.Schema { +func schemaOfDnsRecord(scalar_field_name string) *schema.Schema { return &schema.Schema{ Type: schema.TypeList, Computed: true, - Description: fmt.Sprintf("Single Element List of %s", "User"), + Description: fmt.Sprintf("Single Element List of %s", "DnsRecord"), Elem: &schema.Resource{ - Schema: schemaMapOfUser(scalar_field_name), + Schema: schemaMapOfDnsRecord(scalar_field_name), }, } } -func schemaMapOfUser(scalar_field_name string) map[string]*schema.Schema { +func schemaMapOfDnsRecord(scalar_field_name string) map[string]*schema.Schema { return map[string]*schema.Schema{ - "home_phone": { + "type": { Type: schema.TypeString, Computed: true, Description: "", }, - "company": { + "data": { Type: schema.TypeString, Computed: true, Description: "", }, - "ou_path": { + "zone": { Type: schema.TypeString, Computed: true, Description: "", }, - "street_po_box": { + "timestamp": { Type: schema.TypeString, Computed: true, Description: "", }, - "postal_code": { + "name": { Type: schema.TypeString, Computed: true, Description: "", }, + } +} - "office_phone": { - Type: schema.TypeString, - Computed: true, - Description: "", +func schemaOfUserList(scalar_field_name string) *schema.Schema { + return &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: fmt.Sprintf("List of %s", "User"), + Elem: &schema.Resource{ + Schema: schemaMapOfUser(scalar_field_name), }, + } +} - "home_folder_path": { - Type: schema.TypeString, - Computed: true, - Description: "", +func schemaOfUser(scalar_field_name string) *schema.Schema { + return &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: fmt.Sprintf("Single Element List of %s", "User"), + Elem: &schema.Resource{ + Schema: schemaMapOfUser(scalar_field_name), }, + } +} - "email_address": { - Type: schema.TypeString, - Computed: true, - Description: "", - }, +func schemaMapOfUser(scalar_field_name string) map[string]*schema.Schema { + return map[string]*schema.Schema{ - "city": { + "email_address": { Type: schema.TypeString, Computed: true, Description: "", }, - "job_title": { + "initials": { Type: schema.TypeString, Computed: true, Description: "", }, - "profile_path": { + "office_phone": { Type: schema.TypeString, Computed: true, Description: "", }, - "profile_logon_script": { + "sam_username": { Type: schema.TypeString, Computed: true, Description: "", }, - "home_folder_directory": { + "mobile_phone": { Type: schema.TypeString, Computed: true, Description: "", @@ -380,110 +401,110 @@ func schemaMapOfUser(scalar_field_name string) map[string]*schema.Schema { Description: "", }, - "first_name": { + "rds_home_folder_drive": { Type: schema.TypeString, Computed: true, Description: "", }, - "display_name": { - Type: schema.TypeString, + "rds_connect_drive": { + Type: schema.TypeBool, Computed: true, Description: "", }, - "sam_username": { + "username": { Type: schema.TypeString, Computed: true, Description: "", }, - "rds_home_folder_drive": { + "last_name": { Type: schema.TypeString, Computed: true, Description: "", }, - "manager": { + "display_name": { Type: schema.TypeString, Computed: true, Description: "", }, - "mobile_phone": { + "first_name": { Type: schema.TypeString, Computed: true, Description: "", }, - "home_folder_drive": { + "job_title": { Type: schema.TypeString, Computed: true, Description: "", }, - "office": { + "street_address": { Type: schema.TypeString, Computed: true, Description: "", }, - "password_never_expired": { - Type: schema.TypeBool, + "description": { + Type: schema.TypeString, Computed: true, Description: "", }, - "street_address": { + "company": { Type: schema.TypeString, Computed: true, Description: "", }, - "rds_home_folder_path": { + "ou_path": { Type: schema.TypeString, Computed: true, Description: "", }, - "username": { + "department": { Type: schema.TypeString, Computed: true, Description: "", }, - "description": { + "postal_code": { Type: schema.TypeString, Computed: true, Description: "", }, - "department": { + "profile_logon_script": { Type: schema.TypeString, Computed: true, Description: "", }, - "guid": { + "state": { Type: schema.TypeString, Computed: true, Description: "", }, - "state": { + "profile_path": { Type: schema.TypeString, Computed: true, Description: "", }, - "country": { + "home_folder_path": { Type: schema.TypeString, Computed: true, Description: "", }, - "rds_connect_drive": { - Type: schema.TypeBool, + "rds_home_folder_path": { + Type: schema.TypeString, Computed: true, Description: "", }, @@ -494,88 +515,67 @@ func schemaMapOfUser(scalar_field_name string) map[string]*schema.Schema { Description: "", }, - "last_name": { + "office": { Type: schema.TypeString, Computed: true, Description: "", }, - "initials": { - Type: schema.TypeString, + "change_password_next_logon": { + Type: schema.TypeBool, Computed: true, Description: "", }, - "change_password_next_logon": { + "password_never_expired": { Type: schema.TypeBool, Computed: true, Description: "", }, - } -} -func schemaOfComputerList(scalar_field_name string) *schema.Schema { - return &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Description: fmt.Sprintf("List of %s", "Computer"), - Elem: &schema.Resource{ - Schema: schemaMapOfComputer(scalar_field_name), - }, - } -} - -func schemaOfComputer(scalar_field_name string) *schema.Schema { - return &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Description: fmt.Sprintf("Single Element List of %s", "Computer"), - Elem: &schema.Resource{ - Schema: schemaMapOfComputer(scalar_field_name), + "city": { + Type: schema.TypeString, + Computed: true, + Description: "", }, - } -} -func schemaMapOfComputer(scalar_field_name string) map[string]*schema.Schema { - return map[string]*schema.Schema{ - - "description": { + "country": { Type: schema.TypeString, Computed: true, Description: "", }, - "dns_name": { + "home_phone": { Type: schema.TypeString, Computed: true, Description: "", }, - "path": { + "home_folder_drive": { Type: schema.TypeString, Computed: true, Description: "", }, - "created": { + "home_folder_directory": { Type: schema.TypeString, Computed: true, Description: "", }, - "sid": { + "guid": { Type: schema.TypeString, Computed: true, Description: "", }, - "computer_name": { + "manager": { Type: schema.TypeString, Computed: true, Description: "", }, - "operating_system": { + "street_po_box": { Type: schema.TypeString, Computed: true, Description: "", diff --git a/provider/kopicloud.security-group-crud.gen.go b/provider/kopicloud.security-group-crud.gen.go index 43a4a27..96f2e24 100644 --- a/provider/kopicloud.security-group-crud.gen.go +++ b/provider/kopicloud.security-group-crud.gen.go @@ -80,7 +80,7 @@ func resourceGroup() *schema.Resource { func resourceGroupCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceGroupRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceGroupCreate")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ @@ -268,7 +268,7 @@ func resourceGroupRead(ctx context.Context, d *schema.ResourceData, m interface{ func resourceGroupDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceGroupRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceGroupDelete")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ diff --git a/provider/kopicloud.user-crud.gen.go b/provider/kopicloud.user-crud.gen.go index c0c7308..7ff717e 100644 --- a/provider/kopicloud.user-crud.gen.go +++ b/provider/kopicloud.user-crud.gen.go @@ -8,7 +8,6 @@ import ( kcapi "github.com/KopiCloud-AD-API/terraform-provider-ad/api" - "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -163,177 +162,6 @@ func resourceUser() *schema.Resource { Description: "", } - terraformSchema["street"] = &schema.Schema{ - Type: schema.TypeString, - Computed: false, - Optional: true, - Required: false, - - Description: "", - } - - terraformSchema["po_box"] = &schema.Schema{ - Type: schema.TypeString, - Computed: false, - Optional: true, - Required: false, - - Description: "", - } - - terraformSchema["city"] = &schema.Schema{ - Type: schema.TypeString, - Computed: false, - Optional: true, - Required: false, - - Description: "", - } - - terraformSchema["state"] = &schema.Schema{ - Type: schema.TypeString, - Computed: false, - Optional: true, - Required: false, - - Description: "", - } - - terraformSchema["zip_code"] = &schema.Schema{ - Type: schema.TypeString, - Computed: false, - Optional: true, - Required: false, - - Description: "", - } - - terraformSchema["country"] = &schema.Schema{ - Type: schema.TypeString, - Computed: false, - Optional: true, - Required: false, - - Description: "", - } - - terraformSchema["office_phone"] = &schema.Schema{ - Type: schema.TypeString, - Computed: false, - Optional: true, - Required: false, - - Description: "", - } - - terraformSchema["home_phone"] = &schema.Schema{ - Type: schema.TypeString, - Computed: false, - Optional: true, - Required: false, - - Description: "", - } - - terraformSchema["mobile_phone"] = &schema.Schema{ - Type: schema.TypeString, - Computed: false, - Optional: true, - Required: false, - - Description: "", - } - - terraformSchema["profile_path"] = &schema.Schema{ - Type: schema.TypeString, - Computed: false, - Optional: true, - Required: false, - - Description: "", - } - - terraformSchema["profile_logon_script"] = &schema.Schema{ - Type: schema.TypeString, - Computed: false, - Optional: true, - Required: false, - - Description: "", - } - - terraformSchema["home_folder_path"] = &schema.Schema{ - Type: schema.TypeString, - Computed: false, - Optional: true, - Required: false, - - Description: "", - } - - terraformSchema["home_folder_drive"] = &schema.Schema{ - Type: schema.TypeString, - Computed: false, - Optional: true, - Required: false, - - Description: "", - } - - terraformSchema["home_folder_directory"] = &schema.Schema{ - Type: schema.TypeString, - Computed: false, - Optional: true, - Required: false, - - Description: "", - } - - terraformSchema["rds_profile_path"] = &schema.Schema{ - Type: schema.TypeString, - Computed: false, - Optional: true, - Required: false, - - Description: "", - } - - terraformSchema["rds_home_folder_path"] = &schema.Schema{ - Type: schema.TypeString, - Computed: false, - Optional: true, - Required: false, - - Description: "", - } - - terraformSchema["rds_home_folder_drive"] = &schema.Schema{ - Type: schema.TypeString, - Computed: false, - Optional: true, - Required: false, - - Description: "", - } - - terraformSchema["rds_connect_drive"] = &schema.Schema{ - Type: schema.TypeBool, - Computed: false, - Optional: true, - Required: false, - - Description: "", - } - - terraformSchema["rds_allow_logon"] = &schema.Schema{ - Type: schema.TypeBool, - Computed: false, - Optional: true, - Required: false, - - Description: "", - } - terraformSchema["show_fields"] = &schema.Schema{ Type: schema.TypeString, Computed: false, @@ -360,7 +188,7 @@ func resourceUser() *schema.Resource { func resourceUserCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserCreate")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ @@ -395,48 +223,6 @@ func resourceUserCreate(ctx context.Context, d *schema.ResourceData, m interface manager := d.Get("manager").(string) - street := d.Get("street").(string) - - po_box := d.Get("po_box").(string) - - city := d.Get("city").(string) - - state := d.Get("state").(string) - - zip_code := d.Get("zip_code").(string) - - country := d.Get("country").(string) - - office_phone := d.Get("office_phone").(string) - - home_phone := d.Get("home_phone").(string) - - mobile_phone := d.Get("mobile_phone").(string) - - profile_path := d.Get("profile_path").(string) - - profile_logon_script := d.Get("profile_logon_script").(string) - - home_folder_path := d.Get("home_folder_path").(string) - - home_folder_drive := d.Get("home_folder_drive").(string) - - home_folder_directory := d.Get("home_folder_directory").(string) - - rds_profile_path := d.Get("rds_profile_path").(string) - - rds_home_folder_path := d.Get("rds_home_folder_path").(string) - - rds_home_folder_drive := d.Get("rds_home_folder_drive").(string) - - rds_connect_drive := d.Get("rds_connect_drive").(bool) - - rds_allow_logon := d.Get("rds_allow_logon").(bool) - - change_password_next_logon := d.Get("change_password_next_logon").(bool) - - password_never_expires := d.Get("password_never_expires").(bool) - show_fields := d.Get("show_fields").(string) params := kcapi.APIUserParams{ @@ -468,48 +254,6 @@ func resourceUserCreate(ctx context.Context, d *schema.ResourceData, m interface Manager: &manager, - Street: &street, - - POBox: &po_box, - - City: &city, - - State: &state, - - ZipCode: &zip_code, - - Country: &country, - - OfficePhone: &office_phone, - - HomePhone: &home_phone, - - MobilePhone: &mobile_phone, - - ProfilePath: &profile_path, - - ProfileLogonScript: &profile_logon_script, - - HomeFolderPath: &home_folder_path, - - HomeFolderDrive: &home_folder_drive, - - HomeFolderDirectory: &home_folder_directory, - - RdsProfilePath: &rds_profile_path, - - RdsHomeFolderPath: &rds_home_folder_path, - - RdsHomeFolderDrive: &rds_home_folder_drive, - - RdsConnectDrive: &rds_connect_drive, - - RdsAllowLogon: &rds_allow_logon, - - ChangePasswordNextLogon: &change_password_next_logon, - - PasswordNeverExpired: &password_never_expires, - ShowFields: &show_fields, } @@ -595,24 +339,21 @@ func resourceUserRead(ctx context.Context, d *schema.ResourceData, m interface{} "schema_data": d, }) - guid, err := uuid.Parse(d.Id()) - if err != nil { - return diag.FromErr(err) - } - show_fields := d.Get("show_fields").(string) - params := kcapi.GetApiADUserGuidDetailsParams{ + params := kcapi.GetApiADUserUsernameDetailsParams{ AuthToken: c.data.Get("token").(string), - UserGuid: guid, - ShowFields: &show_fields, } - res, err := c.client.GetApiADUserGuidDetailsWithResponse( + username := d.Get("username").(string) + + res, err := c.client.GetApiADUserUsernameDetailsWithResponse( ctx, + username, + ¶ms) if err != nil { return diag.FromErr(err) @@ -679,7 +420,7 @@ func resourceUserRead(ctx context.Context, d *schema.ResourceData, m interface{} func resourceUserDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserDelete")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ diff --git a/provider/kopicloud.user-disable-crud.gen.go b/provider/kopicloud.user-disable-crud.gen.go index b9e1fc8..53cbccd 100644 --- a/provider/kopicloud.user-disable-crud.gen.go +++ b/provider/kopicloud.user-disable-crud.gen.go @@ -56,7 +56,7 @@ func resourceUserDisableAccount() *schema.Resource { func resourceUserDisableAccountCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserDisableAccountRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserDisableAccountCreate")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ @@ -239,7 +239,7 @@ func resourceUserDisableAccountRead(ctx context.Context, d *schema.ResourceData, func resourceUserDisableAccountDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserDisableAccountRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserDisableAccountDelete")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ diff --git a/provider/kopicloud.user-enable-crud.gen.go b/provider/kopicloud.user-enable-crud.gen.go index 0c983af..c98bb28 100644 --- a/provider/kopicloud.user-enable-crud.gen.go +++ b/provider/kopicloud.user-enable-crud.gen.go @@ -56,7 +56,7 @@ func resourceUserEnableAccount() *schema.Resource { func resourceUserEnableAccountCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserEnableAccountRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserEnableAccountCreate")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ @@ -239,7 +239,7 @@ func resourceUserEnableAccountRead(ctx context.Context, d *schema.ResourceData, func resourceUserEnableAccountDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserEnableAccountRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserEnableAccountDelete")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ diff --git a/provider/kopicloud.user-password-reset-crud.gen.go b/provider/kopicloud.user-password-reset-crud.gen.go index 1425001..3136dfe 100644 --- a/provider/kopicloud.user-password-reset-crud.gen.go +++ b/provider/kopicloud.user-password-reset-crud.gen.go @@ -78,7 +78,7 @@ func resourceUserPasswordReset() *schema.Resource { func resourceUserPasswordResetCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserPasswordResetRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserPasswordResetCreate")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ @@ -269,7 +269,7 @@ func resourceUserPasswordResetRead(ctx context.Context, d *schema.ResourceData, func resourceUserPasswordResetDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserPasswordResetRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserPasswordResetDelete")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ diff --git a/provider/kopicloud.user-rename.gen.go b/provider/kopicloud.user-rename.gen.go index af9d00c..9359667 100644 --- a/provider/kopicloud.user-rename.gen.go +++ b/provider/kopicloud.user-rename.gen.go @@ -78,7 +78,7 @@ func resourceUserRename() *schema.Resource { func resourceUserRenameCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserRenameRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserRenameCreate")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ @@ -265,7 +265,7 @@ func resourceUserRenameRead(ctx context.Context, d *schema.ResourceData, m inter func resourceUserRenameDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserRenameRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserRenameDelete")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ diff --git a/provider/kopicloud.user-unlock-crud.gen.go b/provider/kopicloud.user-unlock-crud.gen.go index 63f2fcc..6a79d1b 100644 --- a/provider/kopicloud.user-unlock-crud.gen.go +++ b/provider/kopicloud.user-unlock-crud.gen.go @@ -56,7 +56,7 @@ func resourceUserUnlockAccount() *schema.Resource { func resourceUserUnlockAccountCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserUnlockAccountRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserUnlockAccountCreate")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ @@ -239,7 +239,7 @@ func resourceUserUnlockAccountRead(ctx context.Context, d *schema.ResourceData, func resourceUserUnlockAccountDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { // Warning or errors can be collected in a slice type - tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserUnlockAccountRead")) + tflog.Debug(ctx, fmt.Sprintf("Beginning resourceUserUnlockAccountDelete")) var diags diag.Diagnostics c := m.(*ApiClient) tflog.Debug(ctx, "Terraform data", map[string]interface{}{ diff --git a/provider/kopicloud.user-update.gen.go b/provider/kopicloud.user-update.gen.go index ab7b324..bb10475 100644 --- a/provider/kopicloud.user-update.gen.go +++ b/provider/kopicloud.user-update.gen.go @@ -66,48 +66,6 @@ func resourceUser_Update_0(ctx context.Context, d *schema.ResourceData, m interf manager := getFieldValue("manager", false, d).(string) - street := getFieldValue("street", false, d).(string) - - po_box := getFieldValue("po_box", false, d).(string) - - city := getFieldValue("city", false, d).(string) - - state := getFieldValue("state", false, d).(string) - - zip_code := getFieldValue("zip_code", false, d).(string) - - country := getFieldValue("country", false, d).(string) - - office_phone := getFieldValue("office_phone", false, d).(string) - - home_phone := getFieldValue("home_phone", false, d).(string) - - mobile_phone := getFieldValue("mobile_phone", false, d).(string) - - profile_path := getFieldValue("profile_path", false, d).(string) - - profile_logon_script := getFieldValue("profile_logon_script", false, d).(string) - - home_folder_path := getFieldValue("home_folder_path", false, d).(string) - - home_folder_drive := getFieldValue("home_folder_drive", false, d).(string) - - home_folder_directory := getFieldValue("home_folder_directory", false, d).(string) - - rds_profile_path := getFieldValue("rds_profile_path", false, d).(string) - - rds_home_folder_path := getFieldValue("rds_home_folder_path", false, d).(string) - - rds_home_folder_drive := getFieldValue("rds_home_folder_drive", false, d).(string) - - rds_connect_drive := getFieldValue("rds_connect_drive", false, d).(bool) - - rds_allow_logon := getFieldValue("rds_allow_logon", false, d).(bool) - - change_password_next_logon := getFieldValue("change_password_next_logon", false, d).(bool) - - password_never_expires := getFieldValue("password_never_expires", false, d).(bool) - show_fields := getFieldValue("show_fields", false, d).(string) params := kcapi.PutApiADUserGuidParams{ @@ -139,48 +97,6 @@ func resourceUser_Update_0(ctx context.Context, d *schema.ResourceData, m interf Manager: &manager, - Street: &street, - - POBox: &po_box, - - City: &city, - - State: &state, - - ZipCode: &zip_code, - - Country: &country, - - OfficePhone: &office_phone, - - HomePhone: &home_phone, - - MobilePhone: &mobile_phone, - - ProfilePath: &profile_path, - - ProfileLogonScript: &profile_logon_script, - - HomeFolderPath: &home_folder_path, - - HomeFolderDrive: &home_folder_drive, - - HomeFolderDirectory: &home_folder_directory, - - RdsProfilePath: &rds_profile_path, - - RdsHomeFolderPath: &rds_home_folder_path, - - RdsHomeFolderDrive: &rds_home_folder_drive, - - RdsConnectDrive: &rds_connect_drive, - - RdsAllowLogon: &rds_allow_logon, - - ChangePasswordNextLogon: &change_password_next_logon, - - PasswordNeverExpired: &password_never_expires, - ShowFields: &show_fields, }