Skip to content

Commit

Permalink
Docs again
Browse files Browse the repository at this point in the history
  • Loading branch information
N-lson committed Oct 10, 2024
1 parent 816749a commit 5879227
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 20 deletions.
5 changes: 1 addition & 4 deletions docs/resources/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,10 @@ Optional:

Required:

- `is_identifying_claim` (Boolean) Specifies whether or not the claim is an identifying claim.
- `name` (String) The name of this resource.
- `value` (String) The value of this resource.

Read-Only:

- `is_identifying_claim` (Boolean) Specifies whether or not the claim is an identifying claim.

## Import

Import is supported using the following syntax:
Expand Down
13 changes: 10 additions & 3 deletions octopusdeploy_framework/schemas/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,16 +350,23 @@ func GetValueResourceSchema(isRequired bool) resourceSchema.Attribute {
return s
}

func GetBooleanResourceAttribute(description string, defaultValue bool, isOptional bool) resourceSchema.Attribute {
func GetOptionalBooleanResourceAttribute(description string, defaultValue bool) resourceSchema.Attribute {
return resourceSchema.BoolAttribute{
Default: booldefault.StaticBool(defaultValue),
Description: description,
Optional: isOptional,
Optional: true,
Computed: true,
}
}

func GetComputedBooleanResourceAttribute(description string) resourceSchema.Attribute {
func GetRequiredBooleanResourceAttribute(description string) resourceSchema.Attribute {
return resourceSchema.BoolAttribute{
Description: description,
Required: true,
}
}

func GetReadonlyBooleanResourceAttribute(description string) resourceSchema.Attribute {
return resourceSchema.BoolAttribute{
Description: description,
Computed: true,
Expand Down
10 changes: 5 additions & 5 deletions octopusdeploy_framework/schemas/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@ func (u UserSchema) GetResourceSchema() resourceSchema.Schema {
"username": GetUsernameResourceSchema(true),
"password": GetPasswordResourceSchema(false),
"display_name": GetDisplayNameResourceSchema(),
"can_password_be_edited": GetComputedBooleanResourceAttribute("Specifies whether or not the password can be edited."),
"can_password_be_edited": GetReadonlyBooleanResourceAttribute("Specifies whether or not the password can be edited."),
"email_address": GetEmailAddressResourceSchema(),
"is_active": GetBooleanResourceAttribute("Specifies whether or not the user is active.", true, true),
"is_requestor": GetComputedBooleanResourceAttribute("Specifies whether or not the user is the requestor."),
"is_service": GetBooleanResourceAttribute("Specifies whether or not the user is a service account.", false, true),
"is_active": GetOptionalBooleanResourceAttribute("Specifies whether or not the user is active.", true),
"is_requestor": GetReadonlyBooleanResourceAttribute("Specifies whether or not the user is the requestor."),
"is_service": GetOptionalBooleanResourceAttribute("Specifies whether or not the user is a service account.", false),
},
Blocks: map[string]resourceSchema.Block{
"identity": resourceSchema.SetNestedBlock{
Expand All @@ -182,7 +182,7 @@ func (u UserSchema) GetResourceSchema() resourceSchema.Schema {
NestedObject: resourceSchema.NestedBlockObject{
Attributes: map[string]resourceSchema.Attribute{
"name": GetNameResourceSchema(true),
"is_identifying_claim": GetBooleanResourceAttribute("Specifies whether or not the claim is an identifying claim.", false, false),
"is_identifying_claim": GetRequiredBooleanResourceAttribute("Specifies whether or not the claim is an identifying claim."),
"value": GetValueResourceSchema(true),
},
},
Expand Down
10 changes: 2 additions & 8 deletions octopusdeploy_framework/schemas/variable.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,8 @@ func (v VariableSchema) GetResourceSchema() resourceSchema.Schema {
stringvalidator.ConflictsWith(path.MatchRelative().AtParent().AtName(VariableSchemaAttributeNames.OwnerID)),
},
},
VariableSchemaAttributeNames.IsEditable: GetBooleanResourceAttribute(
"Indicates whether or not this variable is considered editable.",
true,
true),
VariableSchemaAttributeNames.IsSensitive: GetBooleanResourceAttribute(
"Indicates whether or not this resource is considered sensitive and should be kept secret.",
false,
true),
VariableSchemaAttributeNames.IsEditable: GetOptionalBooleanResourceAttribute("Indicates whether or not this variable is considered editable.", true),
VariableSchemaAttributeNames.IsSensitive: GetOptionalBooleanResourceAttribute("Indicates whether or not this resource is considered sensitive and should be kept secret.", false),
VariableSchemaAttributeNames.SensitiveValue: resourceSchema.StringAttribute{
Optional: true,
Sensitive: true,
Expand Down

0 comments on commit 5879227

Please sign in to comment.