Skip to content

Commit

Permalink
chore: regenerate
Browse files Browse the repository at this point in the history
build: add github workflows
  • Loading branch information
Hans Weber committed Jan 15, 2024
1 parent 677d3e0 commit 06f3509
Show file tree
Hide file tree
Showing 78 changed files with 2,147 additions and 1,587 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Terraform Provider release workflow.
name: Release

# This GitHub action creates a release when a tag that matches the pattern
# "v*" (e.g. v0.1.0) is created.
on:
push:
tags:
- "v*"

# Releases need permissions to read and write the repository contents.
# GitHub considers creating releases and uploading assets as writing contents.
permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
# Allow goreleaser to access older tag information.
fetch-depth: 0
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
with:
go-version-file: "go.mod"
cache: true
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@111c56156bcc6918c056dbef52164cfa583dc549 # v5.2.0
id: import_gpg
with:
gpg_private_key: ${{ secrets.TERRAFORM_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.TERRAFORM_GPG_PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@f82d6c1c344bcacabba2c841718984797f664a6b # v4.2.0
with:
args: release --clean
env:
# GitHub sets the GITHUB_TOKEN secret automatically.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
28 changes: 28 additions & 0 deletions .github/workflows/speakeasy_sdk_generation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Generate

on:
workflow_dispatch: # Allows manual triggering of the workflow to generate SDK
inputs:
force:
description: "Force generation of SDKs"
type: boolean
default: false
schedule:
- cron: 0 0 * * * # Runs every day at midnight

jobs:
generate:
uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-generation.yaml@v14
with:
speakeasy_version: latest
openapi_docs: |
- https://docs.api.epilot.io/journey-config.yaml
overlay_docs: |
- ./overlay.yaml
languages: |
- terraform
mode: pr
force: ${{ github.event.inputs.force }}
secrets:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
151 changes: 151 additions & 0 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
lockVersion: 2.0.0
id: 5a857039-7f4b-42d5-86fd-449767242ed2
management:
docChecksum: 6037ef09203af9f9491610a411a63353
docVersion: 1.0.0
speakeasyVersion: internal
generationVersion: 2.231.0
releaseVersion: 0.4.1
configChecksum: 6a68c10a26d34e28604613ae9f6592cc
features:
go:
additionalProperties: 0.1.1
constsAndDefaults: 0.1.1
core: 3.1.4
flattening: 2.81.1
globalSecurity: 2.82.2
globalServerURLs: 2.82.0
unions: 2.85.0
terraform:
additionalProperties: 0.1.2
constsAndDefaults: 0.1.2
core: 3.8.1
globalSecurity: 2.81.2
globalServerURLs: 2.82.1
unions: 2.81.7
generatedFiles:
- internal/sdk/price.go
- internal/sdk/product.go
- internal/sdk/tax.go
- internal/sdk/sdk.go
- examples/README.md
- go.mod
- go.sum
- internal/planmodifiers/boolplanmodifier/suppress_diff.go
- internal/planmodifiers/float64planmodifier/suppress_diff.go
- internal/planmodifiers/int64planmodifier/suppress_diff.go
- internal/planmodifiers/listplanmodifier/suppress_diff.go
- internal/planmodifiers/mapplanmodifier/suppress_diff.go
- internal/planmodifiers/numberplanmodifier/suppress_diff.go
- internal/planmodifiers/objectplanmodifier/suppress_diff.go
- internal/planmodifiers/setplanmodifier/suppress_diff.go
- internal/planmodifiers/stringplanmodifier/suppress_diff.go
- internal/planmodifiers/utils/state_check.go
- internal/provider/reflect/diags.go
- internal/provider/reflect/doc.go
- internal/provider/reflect/generic_attr_value.go
- internal/provider/reflect/helpers.go
- internal/provider/reflect/interfaces.go
- internal/provider/reflect/into.go
- internal/provider/reflect/map.go
- internal/provider/reflect/number.go
- internal/provider/reflect/options.go
- internal/provider/reflect/outof.go
- internal/provider/reflect/pointer.go
- internal/provider/reflect/primitive.go
- internal/provider/reflect/slice.go
- internal/provider/reflect/struct.go
- internal/provider/utils.go
- internal/sdk/pkg/models/sdkerrors/sdkerror.go
- internal/sdk/pkg/types/bigint.go
- internal/sdk/pkg/types/date.go
- internal/sdk/pkg/types/datetime.go
- internal/sdk/pkg/types/decimal.go
- internal/sdk/pkg/types/pointers.go
- internal/sdk/pkg/utils/contenttype.go
- internal/sdk/pkg/utils/form.go
- internal/sdk/pkg/utils/headers.go
- internal/sdk/pkg/utils/json.go
- internal/sdk/pkg/utils/pathparams.go
- internal/sdk/pkg/utils/queryparams.go
- internal/sdk/pkg/utils/requestbody.go
- internal/sdk/pkg/utils/retries.go
- internal/sdk/pkg/utils/security.go
- internal/sdk/pkg/utils/utils.go
- internal/validators/DateValidator.go
- internal/validators/ExactlyOneChild.go
- internal/validators/JSONParseValidator.go
- internal/validators/RFC3339Validator.go
- internal/validators/boolvalidators/not_null.go
- internal/validators/float64validators/not_null.go
- internal/validators/int64validators/not_null.go
- internal/validators/listvalidators/not_null.go
- internal/validators/mapvalidators/not_null.go
- internal/validators/numbervalidators/not_null.go
- internal/validators/objectvalidators/not_null.go
- internal/validators/setvalidators/not_null.go
- internal/validators/stringvalidators/not_null.go
- main.go
- terraform-registry-manifest.json
- tools/tools.go
- internal/sdk/pkg/models/operations/createprice.go
- internal/sdk/pkg/models/operations/deleteprice.go
- internal/sdk/pkg/models/operations/getprice.go
- internal/sdk/pkg/models/operations/patchprice.go
- internal/sdk/pkg/models/operations/updateprice.go
- internal/sdk/pkg/models/operations/createproduct.go
- internal/sdk/pkg/models/operations/deleteproduct.go
- internal/sdk/pkg/models/operations/getproduct.go
- internal/sdk/pkg/models/operations/patchproduct.go
- internal/sdk/pkg/models/operations/updateproduct.go
- internal/sdk/pkg/models/operations/createtax.go
- internal/sdk/pkg/models/operations/deletetax.go
- internal/sdk/pkg/models/operations/gettax.go
- internal/sdk/pkg/models/operations/patchtax.go
- internal/sdk/pkg/models/operations/updatetax.go
- internal/sdk/pkg/models/shared/servererror.go
- internal/sdk/pkg/models/shared/price.go
- internal/sdk/pkg/models/shared/pricetier.go
- internal/sdk/pkg/models/shared/pricetierdisplaymode.go
- internal/sdk/pkg/models/shared/baserelation.go
- internal/sdk/pkg/models/shared/baseentityowner.go
- internal/sdk/pkg/models/shared/baseentityacl.go
- internal/sdk/pkg/models/shared/clienterror.go
- internal/sdk/pkg/models/shared/pricecreate.go
- internal/sdk/pkg/models/shared/pricepatch.go
- internal/sdk/pkg/models/shared/product.go
- internal/sdk/pkg/models/shared/productcreate.go
- internal/sdk/pkg/models/shared/productpatch.go
- internal/sdk/pkg/models/shared/tax.go
- internal/sdk/pkg/models/shared/taxcreate.go
- internal/sdk/pkg/models/shared/taxpatch.go
- internal/sdk/pkg/models/shared/security.go
- internal/provider/type_base_entity_acl.go
- internal/provider/type_base_entity_owner.go
- internal/provider/type_dollar_relation.go
- internal/provider/type_base_relation.go
- internal/provider/type_price_tier.go
- internal/provider/type_price_create_unit.go
- internal/provider/type_feature.go
- USAGE.md
- internal/provider/provider.go
- examples/provider/provider.tf
- internal/provider/price_resource.go
- internal/provider/price_resource_sdk.go
- examples/resources/epilot-product_price/resource.tf
- internal/provider/product_resource.go
- internal/provider/product_resource_sdk.go
- examples/resources/epilot-product_product/resource.tf
- internal/provider/tax_resource.go
- internal/provider/tax_resource_sdk.go
- examples/resources/epilot-product_tax/resource.tf
- internal/provider/price_data_source.go
- internal/provider/price_data_source_sdk.go
- examples/data-sources/epilot-product_price/data-source.tf
- internal/provider/product_data_source.go
- internal/provider/product_data_source_sdk.go
- examples/data-sources/epilot-product_product/data-source.tf
- internal/provider/tax_data_source.go
- internal/provider/tax_data_source_sdk.go
- examples/data-sources/epilot-product_tax/data-source.tf
- .gitattributes
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
all: docs speakeasy

speakeasy:
speakeasy generate sdk --lang terraform -o . -s product.yml
speakeasy generate sdk --lang terraform -o . -s https://docs.api.epilot.io/product.yaml

docs:
go generate ./...
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ terraform {
required_providers {
epilot-product = {
source = "epilot-dev/epilot-product"
version = "0.2.0"
version = "0.4.1"
}
}
}
Expand Down
39 changes: 18 additions & 21 deletions docs/data-sources/price.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Price DataSource

```terraform
data "epilot-product_price" "my_price" {
id = "123e4567-e89b-12d3-a456-426614174000"
hydrate = true
id = "123e4567-e89b-12d3-a456-426614174000"
}
```

Expand All @@ -25,52 +26,49 @@ data "epilot-product_price" "my_price" {

- `id` (String) The price id

### Optional

- `hydrate` (Boolean) Hydrates entities in relations when passed true

### Read-Only

- `acl` (Attributes) Access control list (ACL) for an entity. Defines sharing access to external orgs or users. (see [below for nested schema](#nestedatt--acl))
- `active` (Boolean) Whether the price can be used for new purchases.
- `billing_duration_amount` (Number) The billing period duration
- `billing_duration_unit` (String) must be one of ["weeks", "months", "years"]
The billing period duration unit
- `billing_duration_unit` (String) The billing period duration unit. must be one of ["weeks", "months", "years"]
- `created_at` (String)
- `description` (String) A brief description of the price.
- `is_composite_price` (Boolean) The flag for prices that contain price components.
- `is_tax_inclusive` (Boolean) Default: false
Specifies whether the price is considered `inclusive` of taxes or not.
- `is_tax_inclusive` (Boolean) Specifies whether the price is considered `inclusive` of taxes or not. Default: false
- `long_description` (String) A detailed description of the price. This is shown on the order document and order table. Multi-line supported.
- `notice_time_amount` (Number) The notice period duration
- `notice_time_unit` (String) must be one of ["weeks", "months", "years"]
The notice period duration unit
- `notice_time_unit` (String) The notice period duration unit. must be one of ["weeks", "months", "years"]
- `org` (String) Organization Id the entity belongs to
- `owners` (Attributes List) (see [below for nested schema](#nestedatt--owners))
- `price_display_in_journeys` (String) must be one of ["show_price", "show_as_starting_price", "show_as_on_request"]
Defines the way the price amount is display in epilot journeys.
- `pricing_model` (String) must be one of ["per_unit", "tiered_volume", "tiered_graduated", "tiered_flatfee"]; Default: "per_unit"
Describes how to compute the price per period. Either `per_unit`, `tiered_graduated` or `tiered_volume`.
- `price_display_in_journeys` (String) Defines the way the price amount is display in epilot journeys. must be one of ["show_price", "show_as_starting_price", "show_as_on_request"]
- `pricing_model` (String) Describes how to compute the price per period. Either `per_unit`, `tiered_graduated` or `tiered_volume`.
- `per_unit` indicates that the fixed amount (specified in unit_amount or unit_amount_decimal) will be charged per unit in quantity
- `tiered_graduated` indicates that the unit pricing will be computed using tiers attribute. The customer pays the price per unit in every range their purchase rises through.
- `tiered_volume` indicates that the unit pricing will be computed using tiers attribute. The customer pays the same unit price for all purchased units.
- `tiered_flatfee` While similar to tiered_volume, tiered flat fee charges for the same price (flat) for the entire range instead using the unit price to multiply the quantity.

must be one of ["per_unit", "tiered_volume", "tiered_graduated", "tiered_flatfee"]; Default: "per_unit"
- `renewal_duration_amount` (Number) The renewal period duration
- `renewal_duration_unit` (String) must be one of ["weeks", "months", "years"]
The renewal period duration unit
- `renewal_duration_unit` (String) The renewal period duration unit. must be one of ["weeks", "months", "years"]
- `schema` (String)
- `tags` (List of String)
- `tax` (Attributes) (see [below for nested schema](#nestedatt--tax))
- `termination_time_amount` (Number) The termination period duration
- `termination_time_unit` (String) must be one of ["weeks", "months", "years"]
The termination period duration unit
- `termination_time_unit` (String) The termination period duration unit. must be one of ["weeks", "months", "years"]
- `tiers` (Attributes List) Defines an array of tiers. Each tier has an upper bound, an unit amount and a flat fee. (see [below for nested schema](#nestedatt--tiers))
- `title` (String)
- `type` (String) must be one of ["one_time", "recurring"]; Default: "one_time"
One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.
- `type` (String) One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. must be one of ["one_time", "recurring"]; Default: "one_time"
- `unit` (Attributes) The unit of measurement used for display purposes and possibly for calculations when the price is variable. (see [below for nested schema](#nestedatt--unit))
- `unit_amount` (Number) The unit amount in cents to be charged, represented as a whole integer if possible.
- `unit_amount_currency` (String) Three-letter ISO currency code, in lowercase.
- `unit_amount_decimal` (String) The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.
- `updated_at` (String)
- `variable_price` (Boolean) Default: false
The flag for prices that can be influenced by external variables such as user input.
- `variable_price` (Boolean) The flag for prices that can be influenced by external variables such as user input. Default: false

<a id="nestedatt--acl"></a>
### Nested Schema for `acl`
Expand Down Expand Up @@ -127,8 +125,7 @@ Read-Only:

Read-Only:

- `one` (String) must be one of ["kw", "kwh", "m", "m2", "l", "cubic-meter", "cubic-meter-h", "ls", "a", "kva", "w", "wp", "kwp"]
built-in units
- `one` (String) built-in units. must be one of ["kw", "kwh", "m", "m2", "l", "cubic-meter", "cubic-meter-h", "ls", "a", "kva", "w", "wp", "kwp"]
- `str` (String)


15 changes: 11 additions & 4 deletions docs/data-sources/product.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Product DataSource

```terraform
data "epilot-product_product" "my_product" {
id = "123e4567-e89b-12d3-a456-426614174000"
hydrate = false
id = "123e4567-e89b-12d3-a456-426614174000"
}
```

Expand All @@ -25,6 +26,10 @@ data "epilot-product_product" "my_product" {

- `id` (String) The product id

### Optional

- `hydrate` (Boolean) Hydrates entities in relations when passed true

### Read-Only

- `acl` (Attributes) Access control list (ACL) for an entity. Defines sharing access to external orgs or users. (see [below for nested schema](#nestedatt--acl))
Expand All @@ -40,13 +45,14 @@ data "epilot-product_product" "my_product" {
- `schema` (String)
- `tags` (List of String)
- `title` (String)
- `type` (String) must be one of ["product", "service"]; Default: "product"
The type of Product:
- `type` (String) The type of Product:

| type | description |
|----| ----|
| `product` | Represents a physical good |
| `service` | Represents a service or virtual product |

must be one of ["product", "service"]; Default: "product"
- `updated_at` (String)

<a id="nestedatt--acl"></a>
Expand All @@ -66,7 +72,8 @@ Read-Only:
Read-Only:

- `feature` (String)
- `tags` (List of String) An arbitrary set of tags attached to a feature
- `id` (String)
- `tags` (List of String)


<a id="nestedatt--owners"></a>
Expand Down
7 changes: 6 additions & 1 deletion docs/data-sources/tax.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Tax DataSource

```terraform
data "epilot-product_tax" "my_tax" {
id = "123e4567-e89b-12d3-a456-426614174000"
hydrate = false
id = "123e4567-e89b-12d3-a456-426614174000"
}
```

Expand All @@ -25,6 +26,10 @@ data "epilot-product_tax" "my_tax" {

- `id` (String) The tax id

### Optional

- `hydrate` (Boolean) Hydrates entities in relations when passed true

### Read-Only

- `acl` (Attributes) Access control list (ACL) for an entity. Defines sharing access to external orgs or users. (see [below for nested schema](#nestedatt--acl))
Expand Down
Loading

0 comments on commit 06f3509

Please sign in to comment.