Skip to content

Commit 6c1df26

Browse files
author
Mateus Nardo
committed
fix: make id non readonly
1 parent 06d637f commit 6c1df26

30 files changed

+1000
-1798
lines changed

.speakeasy/gen.lock

Lines changed: 86 additions & 1477 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 47 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,19 @@ Template Variables API: API to provide variables for email and document template
2626

2727
<!-- Start Table of Contents [toc] -->
2828
## Table of Contents
29+
<!-- $toc-max-depth=2 -->
30+
* [epilot-custom-variable](#epilot-custom-variable)
31+
* [🏗 **Welcome to your new Terraform Provider!** 🏗](#welcome-to-your-new-terraform-provider)
32+
* [Installation](#installation)
33+
* [Available Resources and Data Sources](#available-resources-and-data-sources)
34+
* [Testing the provider locally](#testing-the-provider-locally)
35+
* [Development](#development)
36+
* [Contributions](#contributions)
2937

30-
* [Installation](#installation)
31-
* [Available Resources and Data Sources](#available-resources-and-data-sources)
32-
* [Testing the provider locally](#testing-the-provider-locally)
3338
<!-- End Table of Contents [toc] -->
3439

35-
<!-- Start SDK Installation [installation] -->
36-
## SDK Installation
40+
<!-- Start Installation [installation] -->
41+
## Installation
3742

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

@@ -42,7 +47,7 @@ terraform {
4247
required_providers {
4348
epilot-custom-variable = {
4449
source = "epilot-dev/epilot-custom-variable"
45-
version = "1.1.2"
50+
version = "1.2.0"
4651
}
4752
}
4853
}
@@ -51,25 +56,28 @@ provider "epilot-custom-variable" {
5156
# Configuration options
5257
}
5358
```
54-
<!-- End SDK Installation [installation] -->
59+
<!-- End Installation [installation] -->
5560

56-
<!-- Start Available Resources and Operations [operations] -->
57-
## Available Resources and Operations
61+
<!-- Start Available Resources and Data Sources [operations] -->
62+
## Available Resources and Data Sources
5863

64+
### Resources
5965

60-
<!-- End Available Resources and Operations [operations] -->
66+
* [epilot-custom-variable_custom_variable](docs/resources/custom_variable.md)
67+
### Data Sources
6168

62-
<!-- Start SDK Example Usage [usage] -->
63-
## SDK Example Usage
69+
* [epilot-custom-variable_custom_variable](docs/data-sources/custom_variable.md)
70+
<!-- End Available Resources and Data Sources [operations] -->
6471

65-
### Testing the provider locally
72+
<!-- Start Testing the provider locally [usage] -->
73+
## Testing the provider locally
74+
75+
#### Local Provider
6676

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

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

71-
### Example
72-
7381
```sh
7482
go run main.go --debug
7583
# Copy the TF_REATTACH_PROVIDERS env var
@@ -78,7 +86,30 @@ cd examples/your-example
7886
TF_REATTACH_PROVIDERS=... terraform init
7987
TF_REATTACH_PROVIDERS=... terraform apply
8088
```
81-
<!-- End SDK Example Usage [usage] -->
89+
90+
#### Compiled Provider
91+
92+
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.
93+
94+
1. Execute `go build` to construct a binary called `terraform-provider-epilot-custom-variable`
95+
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
96+
97+
Terraform searches for the `.terraformrc` file in your home directory and applies any configuration settings you set.
98+
99+
```
100+
provider_installation {
101+
102+
dev_overrides {
103+
"registry.terraform.io/epilot-dev/epilot-custom-variable" = "<PATH>"
104+
}
105+
106+
# For all other providers, install them directly from their origin provider
107+
# registries as normal. If you omit this, Terraform will _only_ use
108+
# the dev_overrides block, and so no other providers will be available.
109+
direct {}
110+
}
111+
```
112+
<!-- End Testing the provider locally [usage] -->
82113

83114
<!-- Placeholder for Future Speakeasy SDK Sections -->
84115

docs/data-sources/custom_variable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ data "epilot-custom-variable_custom_variable" "my_customvariable" {
3636
- `name` (String) Custom variable name
3737
- `tags` (List of String) The tags of custom variable
3838
- `template` (String) Handlebar template that used to generate the variable content
39-
- `type` (String) Custom variable type. must be one of ["order_table", "custom", "journey_link"]
39+
- `type` (String) Custom variable type
4040
- `updated_at` (String) Last update time
4141
- `updated_by` (String) Updated by

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ terraform {
1717
required_providers {
1818
epilot-custom-variable = {
1919
source = "epilot-dev/epilot-custom-variable"
20-
version = "1.1.2"
20+
version = "1.2.0"
2121
}
2222
}
2323
}

docs/resources/custom_variable.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,41 @@ CustomVariable Resource
1515
```terraform
1616
resource "epilot-custom-variable_custom_variable" "my_customvariable" {
1717
config = "{ \"see\": \"documentation\" }"
18+
created_at = "2022-04-19T12:41:43.662Z"
19+
created_by = 100042
1820
helper_logic = "return param1 * param2;"
19-
key = "my_custom_table"
20-
name = "My Custom table"
21-
template = "<table style=\"table-layout: fixed;width: 100%;max-width: 1000px;border-collapse: collapse;\">\n <thead>\n <tr style=\"height: 48px;border-bottom: 1px solid #D5E1ED;\">\n {{#each table_config.header.columns as |column|}}\n {{#if column.enable}}\n <th style=\"{{makeStyle @root.table_config.header.style}};{{makeStyle column.style}};\">{{column._label}}</th>\n {{/if}}\n {{/each}}\n </tr>\n </thead>\n <tbody style=\"vertical-align: baseline !important;font-weight: 400;font-size: 12px;position: relative;\">\n <!-- Start rendering products -->\n {{#each order.products as |product|}}\n {{#if @last}}\n <tr style=\"height: 48px;;font-size:14px;border-bottom: 1px solid #D5E1ED;\">\n {{else}}\n <tr style=\"height: 48px;;font-size:14px;\">\n {{/if}}\n {{#each @root.table_config.header.columns as |column|}}\n {{#if column.enable}}\n {{#if (eq column.id 'item')}}\n <!-- Item -->\n <td style=\"{{makeStyle @root.table_config.body.product_name.style}}\">\n {{#if @root.table_config.body.product_name.enable}}\n {{product.name}}\n {{/if}}\n {{#if @root.table_config.body.price_description.enable}}\n <br>\n <span style=\"{{makeStyle @root.table_config.body.price_description.style}}\">{{product.price.description}}</span>\n {{/if}}\n {{#if @root.table_config.body.product_description.enable}}\n <br>\n <span style=\"{{makeStyle @root.table_config.body.product_description.style}}\">{{product.description}}</span>\n {{/if}}\n </td>\n {{/if}}\n {{#if (eq column.id 'quantity')}}\n <!-- Quantity -->\n <td style=\"{{makeStyle @root.table_config.body.quantity.style}}\">{{product.price.quantity}}\n </td>\n {{/if}}\n {{#if (eq column.id 'tax')}}\n <!-- Tax -->\n <td style=\"{{makeStyle @root.table_config.body.tax.style}}\">\n {{product.price.tax_rate}}\n </td>\n {{/if}}\n {{#if (eq column.id 'unit_amount')}}\n <!-- Unit amount -->\n <td style=\"{{makeStyle @root.table_config.body.unit_amount.style}}\">\n {{product.price.unit_amount_net}}\n </td>\n {{/if}}\n {{#if (eq column.id 'net_total')}}\n <!-- Amount Subtotal -->\n <td style=\"{{makeStyle @root.table_config.body.net_total.style}}\">\n {{product.price.amount_subtotal}}\n </td>\n {{/if}}\n {{#if (eq column.id 'amount_tax')}}\n <!-- Tax amount-->\n <td style=\"{{makeStyle @root.table_config.body.amount_tax.style}}\">\n {{product.price.amount_tax}}\n </td>\n {{/if}}\n {{#if (eq column.id 'gross_total')}}\n <!-- Gross total -->\n <td style=\"{{makeStyle @root.table_config.body.gross_total.style}}\">\n {{product.price.amount_total}}\n {{#if @root.table_config.body.payment_type.enable}}\n {{#if (eq product.price.type 'recurring')}}\n <br>\n <span style=\"{{makeStyle @root.table_config.body.payment_type.style}}\">{{product.price.billing_period}}</span>\n {{/if}}\n {{/if}}\n </td>\n {{/if}}\n {{/if}}\n {{/each}}\n </tr>\n {{/each}}\n <!-- Finish rendering products -->\n {{#if table_config.footer.gross_total.enable}}\n {{#each order.total_details.recurrences as |item|}}\n <tr style=\"height: 48px;font-size: 14px;\">\n <td style=\"padding-top: 16px; padding-bottom: 8px; border: none !important; vertical-align: top;\" colspan=\"{{calculate_colspan @root.table_config}}\"></td>\n {{#if @root.table_config.footer.payment_type.enable}}\n <td style=\"{{makeStyle @root.table_config.footer.payment_type.style}}\" colspan=\"2\">{{item.billing_period}}</td>\n {{/if}}\n {{#if (isColumnEnabled @root.table_config 'net_total')}}\n {{#if @root.table_config.footer.net_total.enable}}\n <td style=\"{{makeStyle @root.table_config.footer.net_total.style}}\">{{item.amount_subtotal}}</td>\n {{/if}}\n {{/if}}\n <td style=\"{{makeStyle @root.table_config.footer.gross_total.style}}\">{{item.amount_total}}\n {{#if @root.table_config.footer.amount_tax.enable}}\n <br>\n <span style=\"{{makeStyle @root.table_config.footer.amount_tax.style}}\">{{item.full_amount_tax}}</span>\n {{/if}}\n </td>\n </tr>\n {{/each}}\n {{/if}}\n <tr style=\"height:16px !important;\"></tr>\n </tbody>\n</table>\n"
22-
type = "order_table"
21+
helper_params = [
22+
"..."
23+
]
24+
id = "rbse777b-3cf8-4bff-bb0c-253fd1123250"
25+
key = "my_custom_table"
26+
name = "My Custom table"
27+
tags = [
28+
"..."
29+
]
30+
template = "<table style=\"table-layout: fixed;width: 100%;max-width: 1000px;border-collapse: collapse;\">\n <thead>\n <tr style=\"height: 48px;border-bottom: 1px solid #D5E1ED;\">\n {{#each table_config.header.columns as |column|}}\n {{#if column.enable}}\n <th style=\"{{makeStyle @root.table_config.header.style}};{{makeStyle column.style}};\">{{column._label}}</th>\n {{/if}}\n {{/each}}\n </tr>\n </thead>\n <tbody style=\"vertical-align: baseline !important;font-weight: 400;font-size: 12px;position: relative;\">\n <!-- Start rendering products -->\n {{#each order.products as |product|}}\n {{#if @last}}\n <tr style=\"height: 48px;;font-size:14px;border-bottom: 1px solid #D5E1ED;\">\n {{else}}\n <tr style=\"height: 48px;;font-size:14px;\">\n {{/if}}\n {{#each @root.table_config.header.columns as |column|}}\n {{#if column.enable}}\n {{#if (eq column.id 'item')}}\n <!-- Item -->\n <td style=\"{{makeStyle @root.table_config.body.product_name.style}}\">\n {{#if @root.table_config.body.product_name.enable}}\n {{product.name}}\n {{/if}}\n {{#if @root.table_config.body.price_description.enable}}\n <br>\n <span style=\"{{makeStyle @root.table_config.body.price_description.style}}\">{{product.price.description}}</span>\n {{/if}}\n {{#if @root.table_config.body.product_description.enable}}\n <br>\n <span style=\"{{makeStyle @root.table_config.body.product_description.style}}\">{{product.description}}</span>\n {{/if}}\n </td>\n {{/if}}\n {{#if (eq column.id 'quantity')}}\n <!-- Quantity -->\n <td style=\"{{makeStyle @root.table_config.body.quantity.style}}\">{{product.price.quantity}}\n </td>\n {{/if}}\n {{#if (eq column.id 'tax')}}\n <!-- Tax -->\n <td style=\"{{makeStyle @root.table_config.body.tax.style}}\">\n {{product.price.tax_rate}}\n </td>\n {{/if}}\n {{#if (eq column.id 'unit_amount')}}\n <!-- Unit amount -->\n <td style=\"{{makeStyle @root.table_config.body.unit_amount.style}}\">\n {{product.price.unit_amount_net}}\n </td>\n {{/if}}\n {{#if (eq column.id 'net_total')}}\n <!-- Amount Subtotal -->\n <td style=\"{{makeStyle @root.table_config.body.net_total.style}}\">\n {{product.price.amount_subtotal}}\n </td>\n {{/if}}\n {{#if (eq column.id 'amount_tax')}}\n <!-- Tax amount-->\n <td style=\"{{makeStyle @root.table_config.body.amount_tax.style}}\">\n {{product.price.amount_tax}}\n </td>\n {{/if}}\n {{#if (eq column.id 'gross_total')}}\n <!-- Gross total -->\n <td style=\"{{makeStyle @root.table_config.body.gross_total.style}}\">\n {{product.price.amount_total}}\n {{#if @root.table_config.body.payment_type.enable}}\n {{#if (eq product.price.type 'recurring')}}\n <br>\n <span style=\"{{makeStyle @root.table_config.body.payment_type.style}}\">{{product.price.billing_period}}</span>\n {{/if}}\n {{/if}}\n </td>\n {{/if}}\n {{/if}}\n {{/each}}\n </tr>\n {{/each}}\n <!-- Finish rendering products -->\n {{#if table_config.footer.gross_total.enable}}\n {{#each order.total_details.recurrences as |item|}}\n <tr style=\"height: 48px;font-size: 14px;\">\n <td style=\"padding-top: 16px; padding-bottom: 8px; border: none !important; vertical-align: top;\" colspan=\"{{calculate_colspan @root.table_config}}\"></td>\n {{#if @root.table_config.footer.payment_type.enable}}\n <td style=\"{{makeStyle @root.table_config.footer.payment_type.style}}\" colspan=\"2\">{{item.billing_period}}</td>\n {{/if}}\n {{#if (isColumnEnabled @root.table_config 'net_total')}}\n {{#if @root.table_config.footer.net_total.enable}}\n <td style=\"{{makeStyle @root.table_config.footer.net_total.style}}\">{{item.amount_subtotal}}</td>\n {{/if}}\n {{/if}}\n <td style=\"{{makeStyle @root.table_config.footer.gross_total.style}}\">{{item.amount_total}}\n {{#if @root.table_config.footer.amount_tax.enable}}\n <br>\n <span style=\"{{makeStyle @root.table_config.footer.amount_tax.style}}\">{{item.full_amount_tax}}</span>\n {{/if}}\n </td>\n </tr>\n {{/each}}\n {{/if}}\n <tr style=\"height:16px !important;\"></tr>\n </tbody>\n</table>\n"
31+
type = "custom"
32+
updated_at = "2022-04-20T12:41:43.662Z"
33+
updated_by = 100042
2334
}
2435
```
2536

2637
<!-- schema generated by tfplugindocs -->
2738
## Schema
2839

29-
### Required
30-
31-
- `key` (String) The key which is used for Handlebar variable syntax {{"{{"}}key{{"}}"}}
32-
- `template` (String) Handlebar template that used to generate the variable content
33-
3440
### Optional
3541

3642
- `config` (String) Parsed as JSON.
43+
- `created_at` (String) Creation time
44+
- `created_by` (String) Created by
3745
- `helper_logic` (String) The helper function logic
3846
- `helper_params` (List of String) The helper function parameter's names
47+
- `id` (String) ID
48+
- `key` (String) The key which is used for Handlebar variable syntax {{"{{"}}key{{"}}"}}
3949
- `name` (String) Custom variable name
4050
- `tags` (List of String) The tags of custom variable
51+
- `template` (String) Handlebar template that used to generate the variable content
4152
- `type` (String) Custom variable type. must be one of ["order_table", "custom", "journey_link"]
42-
43-
### Read-Only
44-
45-
- `created_at` (String) Creation time
46-
- `created_by` (String) Created by
47-
- `id` (String) Custom vairable ID
4853
- `updated_at` (String) Last update time
4954
- `updated_by` (String) Updated by
5055

examples/provider/provider.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
epilot-custom-variable = {
44
source = "epilot-dev/epilot-custom-variable"
5-
version = "1.1.2"
5+
version = "1.2.0"
66
}
77
}
88
}

0 commit comments

Comments
 (0)