Skip to content

Commit

Permalink
Closing Reasons CRUD V2
Browse files Browse the repository at this point in the history
  • Loading branch information
anttiviljami committed Dec 17, 2024
1 parent 83e9278 commit 55be6c4
Show file tree
Hide file tree
Showing 44 changed files with 5,302 additions and 825 deletions.
906 changes: 741 additions & 165 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

54 changes: 13 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ TF_REATTACH_PROVIDERS=... terraform apply

<!-- End SDK <no value> -->

<!-- Start Installation [installation] -->
## Installation
<!-- Start SDK Installation [installation] -->
## SDK Installation

To install this provider, copy and paste this code into your Terraform configuration. Then, run `terraform init`.

Expand All @@ -61,7 +61,7 @@ terraform {
required_providers {
epilot-workflow = {
source = "epilot-dev/epilot-workflow"
version = "0.15.2"
version = "0.16.0"
}
}
}
Expand All @@ -70,17 +70,19 @@ provider "epilot-workflow" {
# Configuration options
}
```
<!-- End Installation [installation] -->
<!-- End SDK Installation [installation] -->

<!-- Start Testing the provider locally [usage] -->
## Testing the provider locally
<!-- Start SDK Example Usage [usage] -->
## SDK Example Usage

#### Local Provider
### Testing the provider locally

Should you want to validate a change locally, the `--debug` flag allows you to execute the provider against a terraform instance locally.

This also allows for debuggers (e.g. delve) to be attached to the provider.

### Example

```sh
go run main.go --debug
# Copy the TF_REATTACH_PROVIDERS env var
Expand All @@ -89,43 +91,13 @@ cd examples/your-example
TF_REATTACH_PROVIDERS=... terraform init
TF_REATTACH_PROVIDERS=... terraform apply
```
<!-- End SDK Example Usage [usage] -->

#### Compiled Provider

Terraform allows you to use local provider builds by setting a `dev_overrides` block in a configuration file called `.terraformrc`. This block overrides all other configured installation methods.

1. Execute `go build` to construct a binary called `terraform-provider-epilot-workflow`
2. Ensure that the `.terraformrc` file is configured with a `dev_overrides` section such that your local copy of terraform can see the provider binary

Terraform searches for the `.terraformrc` file in your home directory and applies any configuration settings you set.

```
provider_installation {
dev_overrides {
"registry.terraform.io/epilot-dev/epilot-workflow" = "<PATH>"
}
# For all other providers, install them directly from their origin provider
# registries as normal. If you omit this, Terraform will _only_ use
# the dev_overrides block, and so no other providers will be available.
direct {}
}
```
<!-- End Testing the provider locally [usage] -->

<!-- Start Available Resources and Data Sources [operations] -->
## Available Resources and Data Sources

### Resources
<!-- Start Available Resources and Operations [operations] -->
## Available Resources and Operations

* [epilot-workflow_closing_reason](docs/resources/closing_reason.md)
* [epilot-workflow_workflow_definition](docs/resources/workflow_definition.md)
### Data Sources

* [epilot-workflow_closing_reason](docs/data-sources/closing_reason.md)
* [epilot-workflow_workflow_definition](docs/data-sources/workflow_definition.md)
<!-- End Available Resources and Data Sources [operations] -->
<!-- End Available Resources and Operations [operations] -->

<!-- Start Summary [summary] -->
## Summary
Expand Down
3 changes: 2 additions & 1 deletion docs/data-sources/closing_reason.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ClosingReason DataSource

```terraform
data "epilot-workflow_closing_reason" "my_closingreason" {
reason_id = "x739cew"
}
```

Expand All @@ -25,5 +26,5 @@ data "epilot-workflow_closing_reason" "my_closingreason" {
- `creation_time` (String)
- `id` (String) The ID of this resource.
- `last_update_time` (String)
- `status` (String)
- `status` (String) must be one of ["ACTIVE", "INACTIVE"]
- `title` (String)
7 changes: 4 additions & 3 deletions docs/data-sources/workflow_definition.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ WorkflowDefinition DataSource

```terraform
data "epilot-workflow_workflow_definition" "my_workflowdefinition" {
definition_id = "7hj28a"
}
```

Expand Down Expand Up @@ -51,18 +52,18 @@ Read-Only:

Read-Only:

- `action_type_condition` (String)
- `action_type_condition` (String) must be one of ["WORKFLOW_STARTED", "STEP_CLOSED"]
- `number_of_units` (Number)
- `step_id` (String)
- `time_period` (String)
- `time_period` (String) must be one of ["minutes", "hours", "days", "weeks", "months"]


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

Read-Only:

- `source` (String)
- `source` (String) must be one of ["workflow_status", "current_section", "current_step"]
- `target` (Attributes) (see [below for nested schema](#nestedatt--update_entity_attributes--target))

<a id="nestedatt--update_entity_attributes--target"></a>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ terraform {
required_providers {
epilot-workflow = {
source = "epilot-dev/epilot-workflow"
version = "0.15.2"
version = "0.16.0"
}
}
}
Expand Down
20 changes: 9 additions & 11 deletions docs/resources/closing_reason.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ ClosingReason Resource

```terraform
resource "epilot-workflow_closing_reason" "my_closingreason" {
creation_time = "...my_creation_time..."
id = "...my_id..."
last_update_time = "...my_last_update_time..."
status = "INACTIVE"
title = "...my_title..."
reason_id = "x739cew"
status = "ACTIVE"
title = "Miss"
}
```

Expand All @@ -27,14 +25,14 @@ resource "epilot-workflow_closing_reason" "my_closingreason" {

### Required

- `status` (String) must be one of ["ACTIVE", "INACTIVE"]; Requires replacement if changed.
- `title` (String) Requires replacement if changed.
- `status` (String) must be one of ["ACTIVE", "INACTIVE"]
- `title` (String)

### Optional
### Read-Only

- `creation_time` (String) Requires replacement if changed.
- `id` (String) Requires replacement if changed.
- `last_update_time` (String) Requires replacement if changed.
- `creation_time` (String)
- `id` (String) The ID of this resource.
- `last_update_time` (String)

## Import

Expand Down
44 changes: 8 additions & 36 deletions docs/resources/workflow_definition.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,16 @@ WorkflowDefinition Resource

```terraform
resource "epilot-workflow_workflow_definition" "my_workflowdefinition" {
assigned_to = [
"..."
]
closing_reasons = [
{
id = "x739cew"
}
]
creation_time = "2021-04-27T12:01:13.000Z"
description = "...my_description..."
due_date = "2021-04-27T12:00:00.000Z"
dynamic_due_date = {
action_type_condition = "STEP_CLOSED"
number_of_units = 0.36
step_id = "...my_step_id..."
time_period = "days"
}
enable_ecp_workflow = false
enabled = false
creation_time = "2021-04-27T12:01:13.000Z"
definition_id = "7hj28a"
description = "...my_description..."
due_date = "2021-04-27T12:00:00.000Z"
enabled = true
enable_ecp_workflow = true
flow = "{ \"see\": \"documentation\" }"
id = "...my_id..."
id = "1a10cbc6-dd84-4604-abba-b3cfdce452e3"
last_update_time = "2021-04-27T12:01:13.000Z"
name = "...my_name..."
taxonomies = [
"..."
]
update_entity_attributes = [
{
source = "current_step"
target = {
entity_attribute = "my_status"
entity_schema = "opportunity"
}
}
]
user_ids = [
5.93
]
name = "Tammy Moore PhD"
}
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
data "epilot-workflow_closing_reason" "my_closingreason" {
reason_id = "x739cew"
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
data "epilot-workflow_workflow_definition" "my_workflowdefinition" {
definition_id = "7hj28a"
}
2 changes: 1 addition & 1 deletion examples/provider/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
epilot-workflow = {
source = "epilot-dev/epilot-workflow"
version = "0.15.2"
version = "0.16.0"
}
}
}
Expand Down
8 changes: 3 additions & 5 deletions examples/resources/epilot-workflow_closing_reason/resource.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
resource "epilot-workflow_closing_reason" "my_closingreason" {
creation_time = "...my_creation_time..."
id = "...my_id..."
last_update_time = "...my_last_update_time..."
status = "INACTIVE"
title = "...my_title..."
reason_id = "x739cew"
status = "ACTIVE"
title = "Miss"
}
44 changes: 8 additions & 36 deletions examples/resources/epilot-workflow_workflow_definition/resource.tf
Original file line number Diff line number Diff line change
@@ -1,40 +1,12 @@
resource "epilot-workflow_workflow_definition" "my_workflowdefinition" {
assigned_to = [
"..."
]
closing_reasons = [
{
id = "x739cew"
}
]
creation_time = "2021-04-27T12:01:13.000Z"
description = "...my_description..."
due_date = "2021-04-27T12:00:00.000Z"
dynamic_due_date = {
action_type_condition = "STEP_CLOSED"
number_of_units = 0.36
step_id = "...my_step_id..."
time_period = "days"
}
enable_ecp_workflow = false
enabled = false
creation_time = "2021-04-27T12:01:13.000Z"
definition_id = "7hj28a"
description = "...my_description..."
due_date = "2021-04-27T12:00:00.000Z"
enabled = true
enable_ecp_workflow = true
flow = "{ \"see\": \"documentation\" }"
id = "...my_id..."
id = "1a10cbc6-dd84-4604-abba-b3cfdce452e3"
last_update_time = "2021-04-27T12:01:13.000Z"
name = "...my_name..."
taxonomies = [
"..."
]
update_entity_attributes = [
{
source = "current_step"
target = {
entity_attribute = "my_status"
entity_schema = "opportunity"
}
}
]
user_ids = [
5.93
]
name = "Tammy Moore PhD"
}
2 changes: 1 addition & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ go:
outputModelSuffix: output
packageName: openapi
terraform:
version: 0.15.2
version: 0.16.0
additionalDataSources: []
additionalDependencies: {}
additionalResources: []
Expand Down
22 changes: 11 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module github.com/epilot-dev/terraform-provider-epilot-workflow

go 1.22.0
go 1.21

require (
github.com/cenkalti/backoff/v4 v4.2.0
github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05
github.com/hashicorp/terraform-plugin-docs v0.19.4
github.com/hashicorp/terraform-plugin-framework v1.12.0
github.com/hashicorp/terraform-plugin-framework v1.10.0
github.com/hashicorp/terraform-plugin-framework-validators v0.13.0
github.com/hashicorp/terraform-plugin-go v0.24.0
github.com/hashicorp/terraform-plugin-go v0.23.0
)

require (
Expand All @@ -32,7 +32,7 @@ require (
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.6.1 // indirect
github.com/hashicorp/go-plugin v1.6.0 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/hashicorp/hc-install v0.7.0 // indirect
Expand Down Expand Up @@ -60,15 +60,15 @@ require (
github.com/yuin/goldmark-meta v1.1.0 // indirect
github.com/zclconf/go-cty v1.14.4 // indirect
go.abhg.dev/goldmark/frontmatter v0.2.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect
google.golang.org/grpc v1.66.2 // indirect
google.golang.org/protobuf v1.34.2 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.15.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/grpc v1.63.2 // indirect
google.golang.org/protobuf v1.34.0 // indirect
gopkg.in/yaml.v2 v2.3.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 55be6c4

Please sign in to comment.