Skip to content

Commit

Permalink
jsonencode diff
Browse files Browse the repository at this point in the history
  • Loading branch information
anttiviljami committed Nov 26, 2024
1 parent 666b7d1 commit b7f5c49
Show file tree
Hide file tree
Showing 36 changed files with 5,982 additions and 1,251 deletions.
1,212 changes: 993 additions & 219 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ original.yaml:
curl https://docs.api.epilot.io/automation.yaml > original.yaml

original_modified.yaml: original.yaml
cp original.yaml original_modified.yaml
speakeasy overlay apply -s original.yaml -o overlay.yaml > original_modified.yaml

overlay.yaml:
speakeasy overlay compare -s original.yaml -s original_modified.yaml > overlay.yaml
Expand Down
52 changes: 13 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge" /></a>
</div>

<!-- 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 @@ -18,7 +18,7 @@ terraform {
required_providers {
epilot-automation = {
source = "epilot-dev/epilot-automation"
version = "0.5.0"
version = "0.5.2"
}
}
}
Expand All @@ -27,17 +27,19 @@ provider "epilot-automation" {
# 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 @@ -46,41 +48,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-automation`
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-automation" = "<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-automation_flow](docs/resources/flow.md)
### Data Sources

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

<!-- Start Summary [summary] -->
## Summary
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
data "epilot-automation_flow" "my_flow" {
flow_id = "7791b04a-16d2-44a2-9af9-2d59c25c512f"
}
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-automation = {
source = "epilot-dev/epilot-automation"
version = "0.5.0"
version = "0.5.2"
}
}
}
Expand Down
152 changes: 5 additions & 147 deletions examples/resources/epilot-automation_flow/resource.tf
Original file line number Diff line number Diff line change
@@ -1,158 +1,16 @@
resource "epilot-automation_flow" "my_flow" {
actions = [
"{ \"see\": \"documentation\" }"
"{ \"see\": \"documentation\" }",
]
conditions = [
{
evaluation_result = true
id = "...my_id..."
statements = [
{
id = "1c8d3d9c-6d4c-4a83-aa22-aa0d630cbc2d"
operation = "greater_than_or_equals"
source = {
attribute = "...my_attribute..."
attribute_operation = "deleted"
attribute_repeatable = true
attribute_type = "email"
id = "...my_id..."
origin = "action"
origin_type = "journey_block"
schema = "...my_schema..."
}
values = [
"..."
]
}
]
}
]
enabled = true
enabled = false
entity_schema = "submission"
flow_id = "7791b04a-16d2-44a2-9af9-2d59c25c512f"
flow_name = "Handle contact form"
schedules = [
{
configured_schedule_id = "...my_configured_schedule_id..."
id = "...my_id..."
number_of_units = 1.88
source = {
attribute = "...my_attribute..."
id = "...my_id..."
origin = "action"
schema = "...my_schema..."
}
time_period = "weeks"
time_relation = "after"
}
]
system_flow = true
trigger_conditions = [
"{ \"see\": \"documentation\" }"
]
system_flow = false
triggers = [
{
any = "{ \"see\": \"documentation\" }"
api_submission_trigger = {
configuration = {
source_id = "...my_source_id..."
}
id = "12d4f45a-1883-4841-a94c-5928cb338a94"
type = "api_submission"
}
entity_manual_trigger = {
configuration = {
schema = "submission"
}
id = "12d4f45a-1883-4841-a94c-5928cb338a94"
type = "entity_manual"
}
entity_operation_trigger = {
configuration = {
ecp_config = {
file_config = {
shared_with_end_customer = true
}
origin = "END_CUSTOMER_PORTAL"
}
exclude_activities = [
["SyncEntity"]
]
filter_config = {
activity = {
type = [
{
anything_but_condition = {
anything_but = [
"..."
]
}
equals_ignore_case_condition = {
equals_ignore_case = "...my_equals_ignore_case..."
}
exists_condition = {
exists = false
}
prefix_condition = {
prefix = "...my_prefix..."
}
str = "...my_str..."
suffix_condition = {
suffix = "...my_suffix..."
}
wildcard_condition = {
wildcard = "...my_wildcard..."
}
}
]
}
operation = {
diff = {
any = "{ \"see\": \"documentation\" }"
two = {
added = "{ \"see\": \"documentation\" }"
deleted = "{ \"see\": \"documentation\" }"
updated = "{ \"see\": \"documentation\" }"
}
}
operation = [
"updateEntity"
]
payload = "{ \"see\": \"documentation\" }"
}
}
include_activities = [
["CreateEntity"]
]
operations = [
"createEntity"
]
schema = "submission"
}
id = "12d4f45a-1883-4841-a94c-5928cb338a94"
type = "entity_operation"
}
frontend_submit_trigger = {
configuration = {
source_id = "99"
}
id = "12d4f45a-1883-4841-a94c-5928cb338a94"
type = "frontend_submission"
}
journey_submit_trigger = {
configuration = {
source_id = "36ccf21c-051d-4bb7-84ad-d0eb26b2da79"
}
id = "12d4f45a-1883-4841-a94c-5928cb338a94"
type = "journey_submission"
}
received_email_trigger = {
configuration = {
message_type = "RECEIVED"
}
id = "12d4f45a-1883-4841-a94c-5928cb338a94"
type = "received_email"
}
}
},
]
version = 2
}
2 changes: 1 addition & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ generation:
sdkFlattening: true
telemetryEnabled: false
terraform:
version: 0.5.0
version: 0.5.2
additionalDataSources: []
additionalDependencies: {}
additionalResources: []
Expand Down
75 changes: 7 additions & 68 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,74 +1,13 @@
module github.com/epilot-dev/terraform-provider-epilot-automation

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-validators v0.13.0
github.com/hashicorp/terraform-plugin-go v0.24.0
)

require (
github.com/BurntSushi/toml v1.2.1 // indirect
github.com/Kunde21/markdownfmt/v3 v3.1.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.2.0 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/ProtonMail/go-crypto v1.1.0-alpha.2 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/cli v1.1.6 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
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-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/hashicorp/hc-install v0.7.0 // indirect
github.com/hashicorp/terraform-exec v0.21.0 // indirect
github.com/hashicorp/terraform-json v0.22.1 // indirect
github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/oklog/run v1.0.0 // indirect
github.com/posener/complete v1.2.3 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/yuin/goldmark v1.7.1 // indirect
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/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
gopkg.in/yaml.v2 v2.3.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
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.10.0
github.com/hashicorp/terraform-plugin-framework-validators v0.13.0
github.com/hashicorp/terraform-plugin-go v0.23.0
github.com/spyzhov/ajson v0.9.0
)
Loading

0 comments on commit b7f5c49

Please sign in to comment.