Skip to content

Commit

Permalink
Docs updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieSinn committed Mar 9, 2022
1 parent 411a432 commit ee3ff71
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "devcycle_evaluated_variable_boolean" "test" {
id = "acceptance-testing-boolean"
user = {
id = "acceptancetesting"
}
default_value = false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "devcycle_evaluated_variable_json" "test" {
id = "acceptance-testing-json"
user = {
id = "acceptancetesting"
}
default_value = "{}"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "devcycle_evaluated_variable_number" "test" {
id = "acceptance-testing-number"
user = {
id = "acceptancetesting"
}
default_value = 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "devcycle_evaluated_variable_string" "test" {
id = "acceptance-testing-string"
user = {
id = "acceptancetesting"
}
default_value = "string"
}
2 changes: 1 addition & 1 deletion internal/provider/environment_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type environmentDataSourceType struct{}
func (t environmentDataSourceType) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) {
return tfsdk.Schema{
// This description is used by the documentation generator and the language server.
MarkdownDescription: `DevCycle Environment Data Source.`,
MarkdownDescription: `DevCycle Environment Data Source. Read data from a given DevCycle Environment. R`,

Attributes: map[string]tfsdk.Attribute{
"project_id": {
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/environment_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type environmentResourceType struct{}
func (t environmentResourceType) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) {
return tfsdk.Schema{
// This description is used by the documentation generator and the language server.
MarkdownDescription: "DevCycle Environment resource",
MarkdownDescription: "DevCycle Environment resource. This resource is used to create and manage DevCycle environments.",

Attributes: map[string]tfsdk.Attribute{
"project_id": {
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/evaluated_boolean_variable_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type evaluatedBoolVariableDataSourceType struct{}
func (t evaluatedBoolVariableDataSourceType) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) {
return tfsdk.Schema{
// This description is used by the documentation generator and the language server.
MarkdownDescription: "Evaluated Variable data source.",
MarkdownDescription: "Evaluated Variable data source. Each instance of this data source represents a single evaluated variable, under a single userdata context.",

Attributes: map[string]tfsdk.Attribute{
"user": userDataSchema(),
Expand All @@ -24,7 +24,7 @@ func (t evaluatedBoolVariableDataSourceType) GetSchema(ctx context.Context) (tfs
Type: types.BoolType,
},
"default_value": {
MarkdownDescription: "Default value of the Variable. Either true or false.",
MarkdownDescription: "Default value of the Variable. Used as a fallback in case there is no variation value set.",
Required: true,
Type: types.BoolType,
},
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/evaluated_json_variable_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type evaluatedJSONVariableDataSourceType struct{}
func (t evaluatedJSONVariableDataSourceType) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) {
return tfsdk.Schema{
// This description is used by the documentation generator and the language server.
MarkdownDescription: "Evaluated Variable data source.",
MarkdownDescription: "Evaluated Variable data source. Each instance of this data source represents a single evaluated variable, under a single userdata context.",

Attributes: map[string]tfsdk.Attribute{
"user": userDataSchema(),
Expand All @@ -25,7 +25,7 @@ func (t evaluatedJSONVariableDataSourceType) GetSchema(ctx context.Context) (tfs
Type: types.StringType,
},
"default_value": {
MarkdownDescription: "Default value of the Variable",
MarkdownDescription: "Default value of the Variable. Used as a fallback in case there is no variation value set.",
Required: true,
Type: types.StringType,
},
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/evaluated_number_variable_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type evaluatedNumberVariableDataSourceType struct{}
func (t evaluatedNumberVariableDataSourceType) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) {
return tfsdk.Schema{
// This description is used by the documentation generator and the language server.
MarkdownDescription: "Evaluated Variable data source.",
MarkdownDescription: "Evaluated Variable data source. Each instance of this data source represents a single evaluated variable, under a single userdata context.",

Attributes: map[string]tfsdk.Attribute{
"user": userDataSchema(),
Expand All @@ -25,7 +25,7 @@ func (t evaluatedNumberVariableDataSourceType) GetSchema(ctx context.Context) (t
Type: types.NumberType,
},
"default_value": {
MarkdownDescription: "Default value of the Variable",
MarkdownDescription: "Default value of the Variable. Used as a fallback in case there is no variation value set.",
Required: true,
Type: types.NumberType,
},
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/evaluated_string_variable_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type evaluatedStringVariableDataSourceType struct{}
func (t evaluatedStringVariableDataSourceType) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) {
return tfsdk.Schema{
// This description is used by the documentation generator and the language server.
MarkdownDescription: "Evaluated Variable data source.",
MarkdownDescription: "Evaluated Variable data source. Each instance of this data source represents a single evaluated variable, under a single userdata context.",

Attributes: map[string]tfsdk.Attribute{
"user": userDataSchema(),
Expand All @@ -24,7 +24,7 @@ func (t evaluatedStringVariableDataSourceType) GetSchema(ctx context.Context) (t
Type: types.StringType,
},
"default_value": {
MarkdownDescription: "Default value of the Variable",
MarkdownDescription: "Default value of the Variable. Used as a fallback in case there is no variation value set.",
Required: true,
Type: types.StringType,
},
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/feature_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type featureDataSourceType struct{}
func (t featureDataSourceType) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) {
return tfsdk.Schema{
// This description is used by the documentation generator and the language server.
MarkdownDescription: "DevCycle Feature data source",
MarkdownDescription: "DevCycle Feature data source.",

Attributes: map[string]tfsdk.Attribute{
"name": {
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/feature_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type featureResourceType struct{}
func (t featureResourceType) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) {
return tfsdk.Schema{
// This description is used by the documentation generator and the language server.
MarkdownDescription: "DevCycle Feature resource",
MarkdownDescription: "DevCycle Feature resource. It's recommended to use the variable resource instead of this resource to manage variables. Variations currently have to be managed in this resource.",

Attributes: map[string]tfsdk.Attribute{
"name": {
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/project_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type projectDataSourceType struct{}
func (t projectDataSourceType) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) {
return tfsdk.Schema{
// This description is used by the documentation generator and the language server.
MarkdownDescription: "DevCycle Project data source",
MarkdownDescription: "DevCycle Project data source.",

Attributes: map[string]tfsdk.Attribute{
"key": {
Expand Down
8 changes: 5 additions & 3 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,22 +112,24 @@ func (p *provider) GetDataSources(ctx context.Context) (map[string]tfsdk.DataSou

func (p *provider) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) {
return tfsdk.Schema{
MarkdownDescription: "This provider allows you to manage DevCycle projects, environments, features, and variables. It uses the DevCycle API to manage these resources. You can find more information about the DevCycle API [here](https://docs.devcycle.com/management-api/)." +
"\n\n" + "This provider is compatible with Terraform v1.0 and newer. Because of the way that authentication for the management api works - this provider will have access to manage all projects within a DevCycle org. Be careful!",
Attributes: map[string]tfsdk.Attribute{
"client_id": {
MarkdownDescription: "API Authentication Client ID",
MarkdownDescription: "API Authentication Client ID. Found in your DevCycle account settings.",
Optional: true,
Sensitive: true,
Type: types.StringType,
},
"client_secret": {
MarkdownDescription: "API Authentication Client Secret",
MarkdownDescription: "API Authentication Client Secret. Found in your DevCycle account settings.",
Optional: true,
Sensitive: true,
Type: types.StringType,
},
"server_sdk_token": {
Type: types.StringType,
MarkdownDescription: "Server SDK Token",
MarkdownDescription: "Server SDK Token. This is specific to a given project, and an environment. Used to identify and authenticate server sdk requests to evaluate feature flags.",
Sensitive: true,
Optional: true,
},
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func randSeq(n int) string {

func userDataSchema() tfsdk.Attribute {
return tfsdk.Attribute{
MarkdownDescription: "User data to drive bucketing into variations",
MarkdownDescription: "User data to drive bucketing into variations for feature flag evaluations.",
Required: true,
Attributes: tfsdk.SingleNestedAttributes(map[string]tfsdk.Attribute{
"id": {
Expand Down

0 comments on commit ee3ff71

Please sign in to comment.