diff --git a/docs/index.md b/docs/index.md index 4a4e45e..1e2fb54 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,33 +1,21 @@ --- -page_title: "KopiCloud AD Provider" +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "kopicloud-ad-tf-provider Provider" subcategory: "" -description: "Setup the KopiCloud AD Terraform Provider" +description: |- --- -# Set Up the KopiCloud AD Terraform Provider -To configure the KopiCloud AD API Terraform provider, log in to your **KopiCloud AD API Management Website** and generate an Authentication Token. +# kopicloud-ad-tf-provider Provider -KopiCloud AD uses Authentication Tokens to authenticate to AD instead of usernames and passwords. -Then configure the KopiCloud AD Terraform Provider with the hostname of your API server and the authentication token. -``` -terraform { - required_providers { - kopicloud = { - source = "kopicloud-ad-api/ad" - } - } -} -provider "kopicloud" { - host = "https://api.kopicloud.local" - token = "Basic b3NjYWI8UzFsdkyQMVsuD70" -} -``` + ## Schema -- `host` (String) KopiCloud AD API Server URL +### Optional + +- `host` (String) Kopiclcoud Server URL - `token` (String) Bearer (JWT) or Basic Authentication Token diff --git a/provider/kopicloud.converters.gen.go b/provider/kopicloud.converters.gen.go index 2e8011f..0969129 100644 --- a/provider/kopicloud.converters.gen.go +++ b/provider/kopicloud.converters.gen.go @@ -34,480 +34,480 @@ func isNotEmpty(f interface{}) bool { } } -func OUToTerraform(obj *api.OU) map[string]interface{} { +func UserToTerraform(obj *api.User) map[string]interface{} { result := make(map[string]interface{}) - if obj.Guid != nil && isNotEmpty(obj.Guid) { + if obj.MiddleName != nil && isNotEmpty(obj.MiddleName) { - result["guid"] = UuidToTerraform(obj.Guid) + result["middle_name"] = obj.MiddleName } - if obj.Name != nil && isNotEmpty(obj.Name) { + if obj.Manager != nil && isNotEmpty(obj.Manager) { - result["name"] = obj.Name + result["manager"] = obj.Manager } - if obj.Description != nil && isNotEmpty(obj.Description) { + if obj.StreetAddress != nil && isNotEmpty(obj.StreetAddress) { - result["description"] = obj.Description + result["street_address"] = obj.StreetAddress } - if obj.Path != nil && isNotEmpty(obj.Path) { + if obj.HomeFolderPath != nil && isNotEmpty(obj.HomeFolderPath) { - result["path"] = obj.Path + result["home_folder_path"] = obj.HomeFolderPath } - if obj.Protected != nil && isNotEmpty(obj.Protected) { + if obj.ChangePasswordNextLogon != nil && isNotEmpty(obj.ChangePasswordNextLogon) { - result["protected"] = obj.Protected + result["change_password_next_logon"] = obj.ChangePasswordNextLogon } - return result -} + if obj.DisplayName != nil && isNotEmpty(obj.DisplayName) { -func OUListToTerraform(list *[]api.OU) []interface{} { - if list != nil { - results := make([]interface{}, len(*list)) - for i, OU := range *list { - results[i] = OUToTerraform(&OU) - } - return results - } - return make([]interface{}, 0) -} + result["display_name"] = obj.DisplayName -func ComputerToTerraform(obj *api.Computer) map[string]interface{} { - result := make(map[string]interface{}) + } - if obj.OperatingSystem != nil && isNotEmpty(obj.OperatingSystem) { + if obj.MobilePhone != nil && isNotEmpty(obj.MobilePhone) { - result["operating_system"] = obj.OperatingSystem + result["mobile_phone"] = obj.MobilePhone } - if obj.Description != nil && isNotEmpty(obj.Description) { + if obj.HomeFolderDrive != nil && isNotEmpty(obj.HomeFolderDrive) { - result["description"] = obj.Description + result["home_folder_drive"] = obj.HomeFolderDrive } - if obj.DnsName != nil && isNotEmpty(obj.DnsName) { + if obj.RdsConnectDrive != nil && isNotEmpty(obj.RdsConnectDrive) { - result["dns_name"] = obj.DnsName + result["rds_connect_drive"] = obj.RdsConnectDrive } - if obj.Path != nil && isNotEmpty(obj.Path) { + if obj.HomePhone != nil && isNotEmpty(obj.HomePhone) { - result["path"] = obj.Path + result["home_phone"] = obj.HomePhone } - if obj.Created != nil && isNotEmpty(obj.Created) { + if obj.RdsProfilePath != nil && isNotEmpty(obj.RdsProfilePath) { - result["created"] = obj.Created + result["rds_profile_path"] = obj.RdsProfilePath } - if obj.Sid != nil && isNotEmpty(obj.Sid) { + if obj.SamUsername != nil && isNotEmpty(obj.SamUsername) { - result["sid"] = obj.Sid + result["sam_username"] = obj.SamUsername } - if obj.ComputerName != nil && isNotEmpty(obj.ComputerName) { + if obj.Initials != nil && isNotEmpty(obj.Initials) { - result["computer_name"] = obj.ComputerName + result["initials"] = obj.Initials } - return result -} + if obj.StreetPoBox != nil && isNotEmpty(obj.StreetPoBox) { + + result["street_po_box"] = obj.StreetPoBox -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) -} -func DnsRecordToTerraform(obj *api.DnsRecord) map[string]interface{} { - result := make(map[string]interface{}) + if obj.PostalCode != nil && isNotEmpty(obj.PostalCode) { - if obj.Timestamp != nil && isNotEmpty(obj.Timestamp) { + result["postal_code"] = obj.PostalCode - result["timestamp"] = obj.Timestamp + } + + if obj.Country != nil && isNotEmpty(obj.Country) { + + result["country"] = obj.Country } - if obj.Name != nil && isNotEmpty(obj.Name) { + if obj.Username != nil && isNotEmpty(obj.Username) { - result["name"] = obj.Name + result["username"] = obj.Username } - if obj.Type != nil && isNotEmpty(obj.Type) { + if obj.EmailAddress != nil && isNotEmpty(obj.EmailAddress) { - result["type"] = obj.Type + result["email_address"] = obj.EmailAddress } - if obj.Data != nil && isNotEmpty(obj.Data) { + if obj.RdsHomeFolderPath != nil && isNotEmpty(obj.RdsHomeFolderPath) { - result["data"] = obj.Data + result["rds_home_folder_path"] = obj.RdsHomeFolderPath } - if obj.Zone != nil && isNotEmpty(obj.Zone) { + if obj.RdsHomeFolderDrive != nil && isNotEmpty(obj.RdsHomeFolderDrive) { - result["zone"] = obj.Zone + result["rds_home_folder_drive"] = obj.RdsHomeFolderDrive } - return result -} + if obj.Description != nil && isNotEmpty(obj.Description) { + + result["description"] = obj.Description -func DnsRecordListToTerraform(list *[]api.DnsRecord) []interface{} { - if list != nil { - results := make([]interface{}, len(*list)) - for i, DnsRecord := range *list { - results[i] = DnsRecordToTerraform(&DnsRecord) - } - return results } - return make([]interface{}, 0) -} -func DnsZoneToTerraform(obj *api.DnsZone) map[string]interface{} { - result := make(map[string]interface{}) + if obj.Office != nil && isNotEmpty(obj.Office) { - if obj.DistinguishedName != nil && isNotEmpty(obj.DistinguishedName) { + result["office"] = obj.Office - result["distinguished_name"] = obj.DistinguishedName + } + + if obj.OuPath != nil && isNotEmpty(obj.OuPath) { + + result["ou_path"] = obj.OuPath } - if obj.ZoneName != nil && isNotEmpty(obj.ZoneName) { + if obj.City != nil && isNotEmpty(obj.City) { - result["zone_name"] = obj.ZoneName + result["city"] = obj.City } - if obj.ZoneType != nil && isNotEmpty(obj.ZoneType) { + if obj.State != nil && isNotEmpty(obj.State) { - result["zone_type"] = obj.ZoneType + result["state"] = obj.State } - if obj.Type != nil && isNotEmpty(obj.Type) { + if obj.LastName != nil && isNotEmpty(obj.LastName) { - result["type"] = obj.Type + result["last_name"] = obj.LastName } - return result -} + if obj.JobTitle != nil && isNotEmpty(obj.JobTitle) { + + result["job_title"] = obj.JobTitle -func DnsZoneListToTerraform(list *[]api.DnsZone) []interface{} { - if list != nil { - results := make([]interface{}, len(*list)) - for i, DnsZone := range *list { - results[i] = DnsZoneToTerraform(&DnsZone) - } - return results } - return make([]interface{}, 0) -} -func GroupToTerraform(obj *api.Group) map[string]interface{} { - result := make(map[string]interface{}) + if obj.ProfilePath != nil && isNotEmpty(obj.ProfilePath) { - if obj.Type != nil && isNotEmpty(obj.Type) { + result["profile_path"] = obj.ProfilePath - result["type"] = obj.Type + } + + if obj.HomeFolderDirectory != nil && isNotEmpty(obj.HomeFolderDirectory) { + + result["home_folder_directory"] = obj.HomeFolderDirectory } - if obj.Guid != nil && isNotEmpty(obj.Guid) { + if obj.RdsAllowLogon != nil && isNotEmpty(obj.RdsAllowLogon) { - result["guid"] = UuidToTerraform(obj.Guid) + result["rds_allow_logon"] = obj.RdsAllowLogon } - if obj.Name != nil && isNotEmpty(obj.Name) { + if obj.FirstName != nil && isNotEmpty(obj.FirstName) { - result["name"] = obj.Name + result["first_name"] = obj.FirstName } - if obj.Scope != nil && isNotEmpty(obj.Scope) { + if obj.Department != nil && isNotEmpty(obj.Department) { - result["scope"] = obj.Scope + result["department"] = obj.Department } - if obj.Description != nil && isNotEmpty(obj.Description) { + if obj.Company != nil && isNotEmpty(obj.Company) { - result["description"] = obj.Description + result["company"] = obj.Company } - if obj.Email != nil && isNotEmpty(obj.Email) { + if obj.OfficePhone != nil && isNotEmpty(obj.OfficePhone) { - result["email"] = obj.Email + result["office_phone"] = obj.OfficePhone } - if obj.OuPath != nil && isNotEmpty(obj.OuPath) { + if obj.ProfileLogonScript != nil && isNotEmpty(obj.ProfileLogonScript) { - result["ou_path"] = obj.OuPath + result["profile_logon_script"] = obj.ProfileLogonScript } return result } -func GroupListToTerraform(list *[]api.Group) []interface{} { +func UserListToTerraform(list *[]api.User) []interface{} { if list != nil { results := make([]interface{}, len(*list)) - for i, Group := range *list { - results[i] = GroupToTerraform(&Group) + for i, User := range *list { + results[i] = UserToTerraform(&User) } return results } return make([]interface{}, 0) } -func UserToTerraform(obj *api.User) map[string]interface{} { +func ComputerToTerraform(obj *api.Computer) map[string]interface{} { result := make(map[string]interface{}) - if obj.Company != nil && isNotEmpty(obj.Company) { + if obj.OperatingSystem != nil && isNotEmpty(obj.OperatingSystem) { - result["company"] = obj.Company + result["operating_system"] = obj.OperatingSystem } - if obj.JobTitle != nil && isNotEmpty(obj.JobTitle) { + if obj.Description != nil && isNotEmpty(obj.Description) { - result["job_title"] = obj.JobTitle + result["description"] = obj.Description } - if obj.Manager != nil && isNotEmpty(obj.Manager) { + if obj.DnsName != nil && isNotEmpty(obj.DnsName) { - result["manager"] = obj.Manager + result["dns_name"] = obj.DnsName } - if obj.StreetAddress != nil && isNotEmpty(obj.StreetAddress) { + if obj.Path != nil && isNotEmpty(obj.Path) { - result["street_address"] = obj.StreetAddress + result["path"] = obj.Path } - if obj.OfficePhone != nil && isNotEmpty(obj.OfficePhone) { + if obj.Created != nil && isNotEmpty(obj.Created) { - result["office_phone"] = obj.OfficePhone + result["created"] = obj.Created } - if obj.Description != nil && isNotEmpty(obj.Description) { + if obj.Sid != nil && isNotEmpty(obj.Sid) { - result["description"] = obj.Description + result["sid"] = obj.Sid } - if obj.Department != nil && isNotEmpty(obj.Department) { + if obj.ComputerName != nil && isNotEmpty(obj.ComputerName) { - result["department"] = obj.Department + result["computer_name"] = obj.ComputerName } - if obj.Country != nil && isNotEmpty(obj.Country) { - - result["country"] = obj.Country + return result +} +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) +} - if obj.HomePhone != nil && isNotEmpty(obj.HomePhone) { - - result["home_phone"] = obj.HomePhone - - } +func DnsRecordToTerraform(obj *api.DnsRecord) map[string]interface{} { + result := make(map[string]interface{}) - if obj.MobilePhone != nil && isNotEmpty(obj.MobilePhone) { + if obj.Name != nil && isNotEmpty(obj.Name) { - result["mobile_phone"] = obj.MobilePhone + result["name"] = obj.Name } - if obj.RdsProfilePath != nil && isNotEmpty(obj.RdsProfilePath) { + if obj.Type != nil && isNotEmpty(obj.Type) { - result["rds_profile_path"] = obj.RdsProfilePath + result["type"] = obj.Type } - if obj.FirstName != nil && isNotEmpty(obj.FirstName) { + if obj.Data != nil && isNotEmpty(obj.Data) { - result["first_name"] = obj.FirstName + result["data"] = obj.Data } - if obj.ChangePasswordNextLogon != nil && isNotEmpty(obj.ChangePasswordNextLogon) { + if obj.Zone != nil && isNotEmpty(obj.Zone) { - result["change_password_next_logon"] = obj.ChangePasswordNextLogon + result["zone"] = obj.Zone } - if obj.HomeFolderDirectory != nil && isNotEmpty(obj.HomeFolderDirectory) { + if obj.Timestamp != nil && isNotEmpty(obj.Timestamp) { - result["home_folder_directory"] = obj.HomeFolderDirectory + result["timestamp"] = obj.Timestamp } - if obj.Office != nil && isNotEmpty(obj.Office) { - - result["office"] = obj.Office + return result +} +func DnsRecordListToTerraform(list *[]api.DnsRecord) []interface{} { + if list != nil { + results := make([]interface{}, len(*list)) + for i, DnsRecord := range *list { + results[i] = DnsRecordToTerraform(&DnsRecord) + } + return results } + return make([]interface{}, 0) +} - if obj.City != nil && isNotEmpty(obj.City) { - - result["city"] = obj.City - - } +func GroupToTerraform(obj *api.Group) map[string]interface{} { + result := make(map[string]interface{}) - if obj.EmailAddress != nil && isNotEmpty(obj.EmailAddress) { + if obj.Name != nil && isNotEmpty(obj.Name) { - result["email_address"] = obj.EmailAddress + result["name"] = obj.Name } - if obj.Username != nil && isNotEmpty(obj.Username) { + if obj.Scope != nil && isNotEmpty(obj.Scope) { - result["username"] = obj.Username + result["scope"] = obj.Scope } - if obj.LastName != nil && isNotEmpty(obj.LastName) { + if obj.Description != nil && isNotEmpty(obj.Description) { - result["last_name"] = obj.LastName + result["description"] = obj.Description } - if obj.RdsAllowLogon != nil && isNotEmpty(obj.RdsAllowLogon) { + if obj.Email != nil && isNotEmpty(obj.Email) { - result["rds_allow_logon"] = obj.RdsAllowLogon + result["email"] = obj.Email } - if obj.Initials != nil && isNotEmpty(obj.Initials) { + if obj.OuPath != nil && isNotEmpty(obj.OuPath) { - result["initials"] = obj.Initials + result["ou_path"] = obj.OuPath } - if obj.RdsConnectDrive != nil && isNotEmpty(obj.RdsConnectDrive) { + if obj.Type != nil && isNotEmpty(obj.Type) { - result["rds_connect_drive"] = obj.RdsConnectDrive + result["type"] = obj.Type } - if obj.State != nil && isNotEmpty(obj.State) { + if obj.Guid != nil && isNotEmpty(obj.Guid) { - result["state"] = obj.State + result["guid"] = UuidToTerraform(obj.Guid) } - if obj.ProfilePath != nil && isNotEmpty(obj.ProfilePath) { - - result["profile_path"] = obj.ProfilePath + return result +} +func GroupListToTerraform(list *[]api.Group) []interface{} { + if list != nil { + results := make([]interface{}, len(*list)) + for i, Group := range *list { + results[i] = GroupToTerraform(&Group) + } + return results } + return make([]interface{}, 0) +} - if obj.MiddleName != nil && isNotEmpty(obj.MiddleName) { - - result["middle_name"] = obj.MiddleName - - } +func OUToTerraform(obj *api.OU) map[string]interface{} { + result := make(map[string]interface{}) - if obj.OuPath != nil && isNotEmpty(obj.OuPath) { + if obj.Guid != nil && isNotEmpty(obj.Guid) { - result["ou_path"] = obj.OuPath + result["guid"] = UuidToTerraform(obj.Guid) } - if obj.ProfileLogonScript != nil && isNotEmpty(obj.ProfileLogonScript) { + if obj.Name != nil && isNotEmpty(obj.Name) { - result["profile_logon_script"] = obj.ProfileLogonScript + result["name"] = obj.Name } - if obj.HomeFolderDrive != nil && isNotEmpty(obj.HomeFolderDrive) { + if obj.Description != nil && isNotEmpty(obj.Description) { - result["home_folder_drive"] = obj.HomeFolderDrive + result["description"] = obj.Description } - if obj.DisplayName != nil && isNotEmpty(obj.DisplayName) { + if obj.Path != nil && isNotEmpty(obj.Path) { - result["display_name"] = obj.DisplayName + result["path"] = obj.Path } - if obj.PostalCode != nil && isNotEmpty(obj.PostalCode) { + if obj.Protected != nil && isNotEmpty(obj.Protected) { - result["postal_code"] = obj.PostalCode + result["protected"] = obj.Protected } - if obj.HomeFolderPath != nil && isNotEmpty(obj.HomeFolderPath) { - - result["home_folder_path"] = obj.HomeFolderPath + return result +} +func OUListToTerraform(list *[]api.OU) []interface{} { + if list != nil { + results := make([]interface{}, len(*list)) + for i, OU := range *list { + results[i] = OUToTerraform(&OU) + } + return results } + return make([]interface{}, 0) +} - if obj.RdsHomeFolderPath != nil && isNotEmpty(obj.RdsHomeFolderPath) { +func DnsZoneToTerraform(obj *api.DnsZone) map[string]interface{} { + result := make(map[string]interface{}) - result["rds_home_folder_path"] = obj.RdsHomeFolderPath + if obj.DistinguishedName != nil && isNotEmpty(obj.DistinguishedName) { + + result["distinguished_name"] = obj.DistinguishedName } - if obj.RdsHomeFolderDrive != nil && isNotEmpty(obj.RdsHomeFolderDrive) { + if obj.ZoneName != nil && isNotEmpty(obj.ZoneName) { - result["rds_home_folder_drive"] = obj.RdsHomeFolderDrive + result["zone_name"] = obj.ZoneName } - if obj.SamUsername != nil && isNotEmpty(obj.SamUsername) { + if obj.ZoneType != nil && isNotEmpty(obj.ZoneType) { - result["sam_username"] = obj.SamUsername + result["zone_type"] = obj.ZoneType } - if obj.StreetPoBox != nil && isNotEmpty(obj.StreetPoBox) { + if obj.Type != nil && isNotEmpty(obj.Type) { - result["street_po_box"] = obj.StreetPoBox + result["type"] = obj.Type } return result } -func UserListToTerraform(list *[]api.User) []interface{} { +func DnsZoneListToTerraform(list *[]api.DnsZone) []interface{} { if list != nil { results := make([]interface{}, len(*list)) - for i, User := range *list { - results[i] = UserToTerraform(&User) + for i, DnsZone := range *list { + results[i] = DnsZoneToTerraform(&DnsZone) } return results } diff --git a/provider/kopicloud.schemas.gen.go b/provider/kopicloud.schemas.gen.go index d647338..5977644 100644 --- a/provider/kopicloud.schemas.gen.go +++ b/provider/kopicloud.schemas.gen.go @@ -37,56 +37,68 @@ func schemaMapOfScalarElement(t schema.ValueType, field_name string) map[string] } } -func schemaOfOUList(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", "OU"), + Description: fmt.Sprintf("List of %s", "Computer"), Elem: &schema.Resource{ - Schema: schemaMapOfOU(scalar_field_name), + Schema: schemaMapOfComputer(scalar_field_name), }, } } -func schemaOfOU(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", "OU"), + Description: fmt.Sprintf("Single Element List of %s", "Computer"), Elem: &schema.Resource{ - Schema: schemaMapOfOU(scalar_field_name), + Schema: schemaMapOfComputer(scalar_field_name), }, } } -func schemaMapOfOU(scalar_field_name string) map[string]*schema.Schema { +func schemaMapOfComputer(scalar_field_name string) map[string]*schema.Schema { return map[string]*schema.Schema{ - "path": { + "operating_system": { Type: schema.TypeString, Computed: true, Description: "", }, - "protected": { - Type: schema.TypeBool, + "description": { + Type: schema.TypeString, Computed: true, Description: "", }, - "guid": { + "dns_name": { Type: schema.TypeString, Computed: true, Description: "", }, - "name": { + "path": { Type: schema.TypeString, Computed: true, Description: "", }, - "description": { + "created": { + Type: schema.TypeString, + Computed: true, + Description: "", + }, + + "sid": { + Type: schema.TypeString, + Computed: true, + Description: "", + }, + + "computer_name": { Type: schema.TypeString, Computed: true, Description: "", @@ -94,200 +106,284 @@ func schemaMapOfOU(scalar_field_name string) map[string]*schema.Schema { } } -func schemaOfUserList(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", "User"), + Description: fmt.Sprintf("List of %s", "DnsZone"), Elem: &schema.Resource{ - Schema: schemaMapOfUser(scalar_field_name), + Schema: schemaMapOfDnsZone(scalar_field_name), }, } } -func schemaOfUser(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", "User"), + Description: fmt.Sprintf("Single Element List of %s", "DnsZone"), Elem: &schema.Resource{ - Schema: schemaMapOfUser(scalar_field_name), + Schema: schemaMapOfDnsZone(scalar_field_name), }, } } -func schemaMapOfUser(scalar_field_name string) map[string]*schema.Schema { +func schemaMapOfDnsZone(scalar_field_name string) map[string]*schema.Schema { return map[string]*schema.Schema{ - "street_po_box": { + "distinguished_name": { Type: schema.TypeString, Computed: true, Description: "", }, - "postal_code": { + "zone_name": { Type: schema.TypeString, Computed: true, Description: "", }, - "country": { + "zone_type": { Type: schema.TypeString, Computed: true, Description: "", }, - "office_phone": { + "type": { Type: schema.TypeString, Computed: true, Description: "", }, + } +} - "home_phone": { - Type: schema.TypeString, - Computed: true, - Description: "", +func schemaOfGroupList(scalar_field_name string) *schema.Schema { + return &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: fmt.Sprintf("List of %s", "Group"), + Elem: &schema.Resource{ + Schema: schemaMapOfGroup(scalar_field_name), }, + } +} - "middle_name": { - Type: schema.TypeString, - Computed: true, - Description: "", +func schemaOfGroup(scalar_field_name string) *schema.Schema { + return &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: fmt.Sprintf("Single Element List of %s", "Group"), + Elem: &schema.Resource{ + Schema: schemaMapOfGroup(scalar_field_name), }, + } +} - "display_name": { +func schemaMapOfGroup(scalar_field_name string) map[string]*schema.Schema { + return map[string]*schema.Schema{ + + "email": { Type: schema.TypeString, Computed: true, Description: "", }, - "description": { + "ou_path": { Type: schema.TypeString, Computed: true, Description: "", }, - "home_folder_path": { + "type": { Type: schema.TypeString, Computed: true, Description: "", }, - "rds_allow_logon": { - Type: schema.TypeBool, + "guid": { + Type: schema.TypeString, Computed: true, Description: "", }, - "initials": { + "name": { Type: schema.TypeString, Computed: true, Description: "", }, - "ou_path": { + "scope": { Type: schema.TypeString, Computed: true, Description: "", }, - "rds_home_folder_path": { + "description": { Type: schema.TypeString, Computed: true, Description: "", }, + } +} - "first_name": { - Type: schema.TypeString, - Computed: true, - Description: "", +func schemaOfOUList(scalar_field_name string) *schema.Schema { + return &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: fmt.Sprintf("List of %s", "OU"), + Elem: &schema.Resource{ + Schema: schemaMapOfOU(scalar_field_name), }, + } +} - "last_name": { +func schemaOfOU(scalar_field_name string) *schema.Schema { + return &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: fmt.Sprintf("Single Element List of %s", "OU"), + Elem: &schema.Resource{ + Schema: schemaMapOfOU(scalar_field_name), + }, + } +} + +func schemaMapOfOU(scalar_field_name string) map[string]*schema.Schema { + return map[string]*schema.Schema{ + + "name": { Type: schema.TypeString, Computed: true, Description: "", }, - "office": { + "description": { Type: schema.TypeString, Computed: true, Description: "", }, - "department": { + "path": { Type: schema.TypeString, Computed: true, Description: "", }, - "city": { - Type: schema.TypeString, + "protected": { + Type: schema.TypeBool, Computed: true, Description: "", }, - "home_folder_directory": { + "guid": { Type: schema.TypeString, Computed: true, Description: "", }, + } +} - "rds_home_folder_drive": { +func schemaOfDnsRecordList(scalar_field_name string) *schema.Schema { + return &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: fmt.Sprintf("List of %s", "DnsRecord"), + Elem: &schema.Resource{ + Schema: schemaMapOfDnsRecord(scalar_field_name), + }, + } +} + +func schemaOfDnsRecord(scalar_field_name string) *schema.Schema { + return &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Description: fmt.Sprintf("Single Element List of %s", "DnsRecord"), + Elem: &schema.Resource{ + Schema: schemaMapOfDnsRecord(scalar_field_name), + }, + } +} + +func schemaMapOfDnsRecord(scalar_field_name string) map[string]*schema.Schema { + return map[string]*schema.Schema{ + + "data": { Type: schema.TypeString, Computed: true, Description: "", }, - "username": { + "zone": { Type: schema.TypeString, Computed: true, Description: "", }, - "company": { + "timestamp": { Type: schema.TypeString, Computed: true, Description: "", }, - "mobile_phone": { + "name": { Type: schema.TypeString, Computed: true, Description: "", }, - "rds_profile_path": { + "type": { Type: schema.TypeString, Computed: true, Description: "", }, + } +} - "change_password_next_logon": { - Type: schema.TypeBool, - 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), }, + } +} - "manager": { +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), + }, + } +} + +func schemaMapOfUser(scalar_field_name string) map[string]*schema.Schema { + return map[string]*schema.Schema{ + + "state": { Type: schema.TypeString, Computed: true, Description: "", }, - "profile_logon_script": { + "country": { Type: schema.TypeString, Computed: true, Description: "", }, - "email_address": { + "home_folder_path": { Type: schema.TypeString, Computed: true, Description: "", }, - "street_address": { + "home_folder_directory": { Type: schema.TypeString, Computed: true, Description: "", @@ -299,265 +395,169 @@ func schemaMapOfUser(scalar_field_name string) map[string]*schema.Schema { Description: "", }, - "rds_connect_drive": { - Type: schema.TypeBool, + "street_po_box": { + Type: schema.TypeString, Computed: true, Description: "", }, - "home_folder_drive": { + "initials": { Type: schema.TypeString, Computed: true, Description: "", }, - "job_title": { + "office_phone": { Type: schema.TypeString, Computed: true, Description: "", }, - "state": { - Type: schema.TypeString, + "rds_allow_logon": { + Type: schema.TypeBool, Computed: true, Description: "", }, - "profile_path": { + "username": { Type: schema.TypeString, 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), - }, - } -} - -func schemaMapOfComputer(scalar_field_name string) map[string]*schema.Schema { - return map[string]*schema.Schema{ - - "operating_system": { + "first_name": { Type: schema.TypeString, Computed: true, Description: "", }, - "description": { + "mobile_phone": { Type: schema.TypeString, Computed: true, Description: "", }, - "dns_name": { + "company": { Type: schema.TypeString, Computed: true, Description: "", }, - "path": { + "last_name": { Type: schema.TypeString, Computed: true, Description: "", }, - "created": { + "office": { Type: schema.TypeString, Computed: true, Description: "", }, - "sid": { + "job_title": { Type: schema.TypeString, Computed: true, Description: "", }, - "computer_name": { + "postal_code": { Type: schema.TypeString, Computed: true, Description: "", }, - } -} - -func schemaOfDnsRecordList(scalar_field_name string) *schema.Schema { - return &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Description: fmt.Sprintf("List of %s", "DnsRecord"), - Elem: &schema.Resource{ - Schema: schemaMapOfDnsRecord(scalar_field_name), - }, - } -} -func schemaOfDnsRecord(scalar_field_name string) *schema.Schema { - return &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Description: fmt.Sprintf("Single Element List of %s", "DnsRecord"), - Elem: &schema.Resource{ - Schema: schemaMapOfDnsRecord(scalar_field_name), - }, - } -} - -func schemaMapOfDnsRecord(scalar_field_name string) map[string]*schema.Schema { - return map[string]*schema.Schema{ - - "name": { + "home_phone": { Type: schema.TypeString, Computed: true, Description: "", }, - "type": { + "home_folder_drive": { Type: schema.TypeString, Computed: true, Description: "", }, - "data": { + "display_name": { Type: schema.TypeString, Computed: true, Description: "", }, - "zone": { + "department": { Type: schema.TypeString, Computed: true, Description: "", }, - "timestamp": { + "email_address": { Type: schema.TypeString, Computed: true, Description: "", }, - } -} -func schemaOfDnsZoneList(scalar_field_name string) *schema.Schema { - return &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Description: fmt.Sprintf("List of %s", "DnsZone"), - Elem: &schema.Resource{ - Schema: schemaMapOfDnsZone(scalar_field_name), - }, - } -} - -func schemaOfDnsZone(scalar_field_name string) *schema.Schema { - return &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Description: fmt.Sprintf("Single Element List of %s", "DnsZone"), - Elem: &schema.Resource{ - Schema: schemaMapOfDnsZone(scalar_field_name), + "change_password_next_logon": { + Type: schema.TypeBool, + Computed: true, + Description: "", }, - } -} - -func schemaMapOfDnsZone(scalar_field_name string) map[string]*schema.Schema { - return map[string]*schema.Schema{ - "distinguished_name": { + "rds_home_folder_drive": { Type: schema.TypeString, Computed: true, Description: "", }, - "zone_name": { + "middle_name": { Type: schema.TypeString, Computed: true, Description: "", }, - "zone_type": { + "description": { Type: schema.TypeString, Computed: true, Description: "", }, - "type": { + "profile_path": { Type: schema.TypeString, Computed: true, Description: "", }, - } -} -func schemaOfGroupList(scalar_field_name string) *schema.Schema { - return &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Description: fmt.Sprintf("List of %s", "Group"), - Elem: &schema.Resource{ - Schema: schemaMapOfGroup(scalar_field_name), - }, - } -} - -func schemaOfGroup(scalar_field_name string) *schema.Schema { - return &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Description: fmt.Sprintf("Single Element List of %s", "Group"), - Elem: &schema.Resource{ - Schema: schemaMapOfGroup(scalar_field_name), + "rds_profile_path": { + Type: schema.TypeString, + Computed: true, + Description: "", }, - } -} - -func schemaMapOfGroup(scalar_field_name string) map[string]*schema.Schema { - return map[string]*schema.Schema{ - "guid": { - Type: schema.TypeString, + "rds_connect_drive": { + Type: schema.TypeBool, Computed: true, Description: "", }, - "name": { + "manager": { Type: schema.TypeString, Computed: true, Description: "", }, - "scope": { + "city": { Type: schema.TypeString, Computed: true, Description: "", }, - "description": { + "profile_logon_script": { Type: schema.TypeString, Computed: true, Description: "", }, - "email": { + "rds_home_folder_path": { Type: schema.TypeString, Computed: true, Description: "", @@ -569,7 +569,7 @@ func schemaMapOfGroup(scalar_field_name string) map[string]*schema.Schema { Description: "", }, - "type": { + "street_address": { Type: schema.TypeString, Computed: true, Description: "",