Skip to content

Commit

Permalink
chore: move description for provider, data- and rsources to json schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
d-strobel committed Oct 18, 2024
1 parent 4d815c9 commit dc48da7
Show file tree
Hide file tree
Showing 21 changed files with 36 additions and 19 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions internal/generate/provider_windows/windows_provider_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions internal/provider/local/local_group_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ func (d *localGroupDataSource) Metadata(ctx context.Context, req datasource.Meta

func (d *localGroupDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) {
resp.Schema = datasource_local_group.LocalGroupDataSourceSchema(ctx)
resp.Schema.Description = `Retrieve information about a local security group.
You can get a group by the name or the security ID of the group.
`
}

func (d *localGroupDataSource) ConfigValidators(ctx context.Context) []datasource.ConfigValidator {
Expand Down
1 change: 0 additions & 1 deletion internal/provider/local/local_group_member_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ func (r *localGroupMemberResource) Metadata(ctx context.Context, req resource.Me

func (r *localGroupMemberResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = resource_local_group_member.LocalGroupMemberResourceSchema(ctx)
resp.Schema.Description = `Manage group member for local security groups.`
}

func (r *localGroupMemberResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) {
Expand Down
1 change: 0 additions & 1 deletion internal/provider/local/local_group_members_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ func (d *localGroupMembersDataSource) Metadata(ctx context.Context, req datasour

func (d *localGroupMembersDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) {
resp.Schema = datasource_local_group_members.LocalGroupMembersDataSourceSchema(ctx)
resp.Schema.Description = `Retrieve a list of members for a specific local security group.`
}

func (d *localGroupMembersDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) {
Expand Down
4 changes: 0 additions & 4 deletions internal/provider/local/local_group_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ func (r *localGroupResource) Metadata(ctx context.Context, req resource.Metadata

func (r *localGroupResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = resource_local_group.LocalGroupResourceSchema(ctx)
resp.Schema.Description = `Manage local security groups.
-> The description default is a string with a space. This is necessary because the powershell function Set-LocalGroup does not allow an empty string.
`
}

func (r *localGroupResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) {
Expand Down
1 change: 0 additions & 1 deletion internal/provider/local/local_groups_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ func (d *localGroupsDataSource) Metadata(ctx context.Context, req datasource.Met

func (d *localGroupsDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) {
resp.Schema = datasource_local_groups.LocalGroupsDataSourceSchema(ctx)
resp.Schema.Description = `Retrieve a list of all local security groups.`
}

func (d *localGroupsDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) {
Expand Down
1 change: 0 additions & 1 deletion internal/provider/local/local_user_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func (d *localUserDataSource) Metadata(ctx context.Context, req datasource.Metad

func (d *localUserDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) {
resp.Schema = datasource_local_user.LocalUserDataSourceSchema(ctx)
resp.Schema.Description = `Retrieve information about a local user. You can get a user by the name or the security ID.`
}

func (d *localUserDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) {
Expand Down
1 change: 0 additions & 1 deletion internal/provider/local/local_user_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func (r *localUserResource) Metadata(ctx context.Context, req resource.MetadataR

func (r *localUserResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = resource_local_user.LocalUserResourceSchema(ctx)
resp.Schema.Description = `Manage local users.`
}

func (r *localUserResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) {
Expand Down
1 change: 0 additions & 1 deletion internal/provider/local/local_users_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ func (d *localUsersDataSource) Metadata(ctx context.Context, req datasource.Meta

func (d *localUsersDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) {
resp.Schema = datasource_local_users.LocalUsersDataSourceSchema(ctx)
resp.Schema.Description = `Retrieve a list of all local users.`
}

func (d *localUsersDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) {
Expand Down
6 changes: 0 additions & 6 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ func (p *WindowsProvider) Metadata(ctx context.Context, req provider.MetadataReq
// and a given description which is used in the provider documentation.
func (p *WindowsProvider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse) {
resp.Schema = provider_windows.WindowsProviderSchema(ctx)
resp.Schema.Description = `The windows provider is used to interact remotely via winrm or ssh with a windows system.
**Important**:
Due to the limitations of the terraform-plugin-framework some attributes are listed as optionals even though a combination of certain parameters are required.
Check examples below for reference.
`
}

// Resources returns the provider resources.
Expand Down
10 changes: 10 additions & 0 deletions internal/schema/local_datasources.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
{
"name": "local_group",
"schema": {
"description": "Retrieve information about a local security group.\nYou can get a group by the name or the security ID of the group.",
"markdown_description": "Retrieve information about a local security group.\nYou can get a group by the name or the security ID of the group.",
"attributes": [
{
"name": "description",
Expand Down Expand Up @@ -42,6 +44,8 @@
{
"name": "local_groups",
"schema": {
"description": "Retrieve a list of all local security groups.",
"markdown_description": "Retrieve a list of all local security groups.",
"attributes": [
{
"name": "groups",
Expand Down Expand Up @@ -87,6 +91,8 @@
{
"name": "local_user",
"schema": {
"description": "Retrieve information about a local user. You can get a user by the name or the security ID.",
"markdown_description": "Retrieve information about a local user. You can get a user by the name or the security ID.",
"attributes": [
{
"name": "account_expires",
Expand Down Expand Up @@ -220,6 +226,8 @@
{
"name": "local_users",
"schema": {
"description": "Retrieve a list of all local users.",
"markdown_description": "Retrieve a list of all local users.",
"attributes": [
{
"name": "users",
Expand Down Expand Up @@ -363,6 +371,8 @@
{
"name": "local_group_members",
"schema": {
"description": "Retrieve a list of members for a specific local security group.",
"markdown_description": "Retrieve a list of members for a specific local security group.",
"attributes": [
{
"name": "name",
Expand Down
6 changes: 6 additions & 0 deletions internal/schema/local_resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
{
"name": "local_group",
"schema": {
"description": "Manage local security groups.\n\n-> The description default is a string with a space. This is necessary because the powershell function Set-LocalGroup does not allow an empty string.",
"markdown_description": "Manage local security groups.\n\n-> The description default is a string with a space. This is necessary because the powershell function Set-LocalGroup does not allow an empty string.",
"attributes": [
{
"name": "description",
Expand Down Expand Up @@ -105,6 +107,8 @@
{
"name": "local_user",
"schema": {
"description": "Manage local users.",
"markdown_description": "Manage local users.",
"attributes": [
{
"name": "account_expires",
Expand Down Expand Up @@ -356,6 +360,8 @@
{
"name": "local_group_member",
"schema": {
"description": "Manage group member for local security groups.",
"markdown_description": "Manage group member for local security groups.",
"attributes": [
{
"name": "group_id",
Expand Down
2 changes: 2 additions & 0 deletions internal/schema/provider_windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"provider": {
"name": "windows",
"schema": {
"description": "The windows provider is used to interact remotely via winrm or ssh with a windows system.\n\n**Important**:\nDue to the limitations of the terraform-plugin-framework some attributes are listed as optionals even though a combination of certain parameters are required\nCheck examples below for reference.",
"markdown_description": "The windows provider is used to interact remotely via winrm or ssh with a windows system.\n\n**Important**:\nDue to the limitations of the terraform-plugin-framework some attributes are listed as optionals even though a combination of certain parameters are required.\nCheck examples below for reference.",
"attributes": [
{
"name": "endpoint",
Expand Down

0 comments on commit dc48da7

Please sign in to comment.