Skip to content

Commit

Permalink
Add kopicloud_user_password_reset element
Browse files Browse the repository at this point in the history
  • Loading branch information
oforero committed Mar 18, 2023
1 parent 174b13f commit 467d609
Show file tree
Hide file tree
Showing 6 changed files with 450 additions and 263 deletions.
74 changes: 74 additions & 0 deletions docs/resources/kopicloud_user_password_reset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "kopicloud_user_password_reset Resource - kopicloud-ad-tf-provider"
subcategory: ""
description: |-
Element to create, update, delete Users from Active Directory
---

# kopicloud_user_password_reset (Resource)

Element to create, update, delete Users from Active Directory



<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `new_password` (String)
- `username` (String)

### Optional

- `change_password_net_logon` (Boolean)
- `show_fields` (String)

### Read-Only

- `id` (String) The ID of this resource.
- `result` (List of Object) Single Element List of User (see [below for nested schema](#nestedatt--result))

<a id="nestedatt--result"></a>
### Nested Schema for `result`

Read-Only:

- `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)
- `middle_name` (String)
- `mobile_phone` (String)
- `office` (String)
- `office_phone` (String)
- `ou_path` (String)
- `postal_code` (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)
- `sam_username` (String)
- `state` (String)
- `street_address` (String)
- `street_po_box` (String)
- `username` (String)


108 changes: 108 additions & 0 deletions generator-inputs/user_password_reset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"api_alias": "kcapi",
"api_package": "github.com/KopiCloud-AD-API/terraform-provider-ad/api",
"package": "provider",
"data_sources" : [],
"resources" : [
{
"name": "UserPasswordReset",
"description" : "Element to create, update, delete Users from Active Directory",
"terraform": {
"name": "kopicloud_user_password_reset",
"arguments": [
{
"name": "username",
"type": "schema.TypeString",
"required": true
},
{
"name": "new_password",
"type": "schema.TypeString",
"required": true
},
{
"name": "change_password_net_logon",
"type": "schema.TypeBool",
"optional": true
},
{
"name": "show_fields",
"type": "schema.TypeString",
"optional": true
}
]
},
"result_schemas": {
"result": {
"schema_function": "schemaOfUser",
"schema_function_arguments": "(``)"
}
},

"element_name": "UserPasswordReset",
"create": {
"api_function": {
"name": "PostApiADUserUsernameResetPasswordWithResponse",
"isPointer": true,
"arguments": [
{
"name": "username",
"type": "string"
}
],
"params": {
"name": "PostApiADUserUsernameResetPasswordParams",
"fields": [
{
"api_name": "NewPassword",
"name": "new_password",
"type": "*string"
},
{
"api_name": "ChangePassword",
"name": "change_password_net_logon",
"type": "*bool"
},
{
"api_name": "ShowFields",
"name": "show_fields",
"type": "*string"
}
]
}
},
"result": {
"msg_field": "Output",
"result_field": "Result",
"api_to_terraform": "UserToTerraform",
"result_wrapper": "wrapInArray",
"terraform_field": "result",
"api_to_terraform_id": "getId_for_User"
}
},
"read": {
"api_function": {
"name": "GetApiADUserUsernameWithResponse",
"arguments": [
{
"name": "username",
"type": "string"
}
],
"params": {
"name": "GetApiADUserUsernameParams",
"fields": []
}
},
"result": {
"msg_field": "Output",
"result_field": "Result",
"api_to_terraform": "UserToTerraform",
"result_wrapper": "wrapInArray",
"terraform_field": "result",
"api_to_terraform_id": "getId_for_User"
}
}
}
]
}
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ import (
//go:generate openapi-terraform-provider-generator resource-update --api github.com/KopiCloud-AD-API/terraform-provider-ad/api -p provider -o provider/kopicloud.user-update.gen.go -i generator-inputs/user.json
//go:generate openapi-terraform-provider-generator datasource-read --api github.com/KopiCloud-AD-API/terraform-provider-ad/api -p provider -o provider/kopicloud.user-data.gen.go -i generator-inputs/user.json

// Generate the Code for User Password Reset
//go:generate openapi-terraform-provider-generator resource-crud --api github.com/KopiCloud-AD-API/terraform-provider-ad/api -p provider -o provider/kopicloud.user-password-reset-crud.gen.go -i generator-inputs/user_password_reset.json

// Generate the Code for the DNS A Records
//go:generate openapi-terraform-provider-generator resource-crud --api github.com/KopiCloud-AD-API/terraform-provider-ad/api -p provider -o provider/kopicloud.dns_a_record-crud.gen.go -i generator-inputs/dns_a_record.json
//go:generate openapi-terraform-provider-generator datasource-read --api github.com/KopiCloud-AD-API/terraform-provider-ad/api -p provider -o provider/kopicloud.dns_a_record-data.gen.go -i generator-inputs/dns_a_record.json
Expand All @@ -75,7 +78,7 @@ import (
//go:generate openapi-terraform-provider-generator datasource-read --api github.com/KopiCloud-AD-API/terraform-provider-ad/api -p provider -o provider/kopicloud.dns_reverse_lookup_zone-data.gen.go -i generator-inputs/dns_reverse_lookup_zone.json

// Generate the schemas for the resources (should list all the JSON files for which resources were generated)
//go:generate openapi-terraform-provider-generator resource-schemas --api github.com/KopiCloud-AD-API/terraform-provider-ad/api -p provider -o provider/kopicloud.resources-schemas.gen.go -i generator-inputs/computer.json -i generator-inputs/computer_cleanup.json -i generator-inputs/organizational_unit.json -i generator-inputs/dns_a_record.json -i generator-inputs/dns_aaaa_record.json -i generator-inputs/dns_cname_record.json -i generator-inputs/dns_lookup_zone.json -i generator-inputs/dns_reverse_lookup_zone.json -i generator-inputs/security_group.json -i generator-inputs/distribution_group.json -i generator-inputs/group_membership.json -i generator-inputs/user.json
//go:generate openapi-terraform-provider-generator resource-schemas --api github.com/KopiCloud-AD-API/terraform-provider-ad/api -p provider -o provider/kopicloud.resources-schemas.gen.go -i generator-inputs/computer.json -i generator-inputs/computer_cleanup.json -i generator-inputs/organizational_unit.json -i generator-inputs/dns_a_record.json -i generator-inputs/dns_aaaa_record.json -i generator-inputs/dns_cname_record.json -i generator-inputs/dns_lookup_zone.json -i generator-inputs/dns_reverse_lookup_zone.json -i generator-inputs/security_group.json -i generator-inputs/distribution_group.json -i generator-inputs/group_membership.json -i generator-inputs/user.json -i generator-inputs/user_password_reset.json

// Generate the code for the datasources (Schemas)
//go:generate openapi-terraform-provider-generator datasource-schemas --api github.com/KopiCloud-AD-API/terraform-provider-ad/api -p provider -o provider/kopicloud.datasources-schemas.gen.go -i generator-inputs/computer.json -i generator-inputs/organizational_unit.json -i generator-inputs/dns_a_record.json -i generator-inputs/dns_aaaa_record.json -i generator-inputs/dns_cname_record.json -i generator-inputs/dns_lookup_zone.json -i generator-inputs/dns_reverse_lookup_zone.json -i generator-inputs/security_group.json -i generator-inputs/distribution_group.json -i generator-inputs/group_membership.json -i generator-inputs/user.json
Expand Down
Loading

0 comments on commit 467d609

Please sign in to comment.