Skip to content

Commit

Permalink
Merge pull request #4 from epilot-dev/feat/product-v2
Browse files Browse the repository at this point in the history
Feat/product v2
  • Loading branch information
blomqma authored Aug 15, 2024
2 parents 9fc5467 + 004a5fd commit 1ce958c
Show file tree
Hide file tree
Showing 62 changed files with 5,256 additions and 840 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
.terraform*
*.tfstate*
.DS_Store

original.yaml
original_modified.yaml
26 changes: 16 additions & 10 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 5a857039-7f4b-42d5-86fd-449767242ed2
management:
docChecksum: b65e946770e3a784f31e803acac5da37
docChecksum: 7446fbd54cd29817b6b4110c1afaed31
docVersion: 1.0.0
speakeasyVersion: 1.352.0
generationVersion: 2.384.4
releaseVersion: 0.9.0
configChecksum: 13c38cc62d480ce217bdee54ee139bb6
speakeasyVersion: 1.369.1
generationVersion: 2.399.0
releaseVersion: 0.10.2
configChecksum: 7300c01d33ff202a9e839150d63b1292
repoURL: https://github.com/epilot-dev/terraform-provider-epilot-product.git
repoSubDirectory: .
published: true
Expand All @@ -22,10 +22,12 @@ features:
terraform:
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.4
core: 3.24.6
globalSecurity: 2.81.6
core: 3.24.7
envVarSecurityUsage: 0.1.0
globalSecurity: 2.81.8
globalServerURLs: 2.82.1
nullables: 0.0.0
retries: 2.81.1
generatedFiles:
- internal/sdk/price.go
- internal/sdk/product.go
Expand Down Expand Up @@ -68,11 +70,13 @@ generatedFiles:
- internal/sdk/models/shared/pricetier.go
- internal/sdk/models/shared/pricetierdisplaymode.go
- internal/sdk/models/shared/pricecomponentrelation.go
- internal/sdk/models/shared/baseentityowner.go
- internal/sdk/models/shared/baserelation.go
- internal/sdk/models/shared/baseentityacl.go
- internal/sdk/models/shared/clienterror.go
- internal/sdk/models/shared/pricecreate.go
- internal/sdk/models/shared/pricepatch.go
- internal/sdk/models/shared/product.go
- internal/sdk/models/shared/baserelation.go
- internal/sdk/models/shared/productcreate.go
- internal/sdk/models/shared/productpatch.go
- internal/sdk/models/shared/tax.go
Expand Down Expand Up @@ -128,11 +132,13 @@ generatedFiles:
- main.go
- terraform-registry-manifest.json
- tools/tools.go
- internal/provider/types/base_entity_acl.go
- internal/provider/types/dollar_relation.go
- internal/provider/types/base_relation.go
- internal/provider/types/base_entity_owner.go
- internal/provider/types/price_component_relation.go
- internal/provider/types/price_create_price_components.go
- internal/provider/types/price_tier.go
- internal/provider/types/dollar_relation.go
- internal/provider/types/base_relation.go
- USAGE.md
- internal/provider/provider.go
- examples/provider/provider.tf
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"makefile.configureOnOpen": false
}
18 changes: 16 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
.PHONY: all docs
all: docs speakeasy
all: speakeasy docs

original.yaml: openapi.yml
# curl https://docs.api.epilot.io/product.yaml > original.yaml
cp openapi.yml original.yaml

original_modified.yaml: original.yaml overlay.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

speakeasy:
speakeasy generate sdk --lang terraform -o . -s product.yaml
$(eval TMP := $(shell mktemp -d))
# curl https://docs.api.epilot.io/product.yaml > $(TMP)/openapi.yaml
cp openapi.yml $(TMP)/openapi.yaml
speakeasy overlay apply -s $(TMP)/openapi.yaml -o overlay.yaml > $(TMP)/final.yaml
speakeasy generate sdk --lang terraform -o . -s $(TMP)/final.yaml

docs:
go generate ./...
Expand Down
8 changes: 1 addition & 7 deletions 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.9.0"
version = "0.10.2"
}
}
}
Expand Down Expand Up @@ -100,12 +100,6 @@ TF_REATTACH_PROVIDERS=... terraform apply



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


<!-- End Available Resources and Operations [operations] -->

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

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.
Expand Down
52 changes: 49 additions & 3 deletions docs/data-sources/price.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ Price DataSource

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

Expand All @@ -25,19 +26,26 @@ data "epilot-product_price" "my_price" {
### Optional

- `hydrate` (Boolean) Hydrates entities in relations when passed true
- `strict` (Boolean) When passed true, the response will contain only fields that match the schema, with non-matching fields included in `__additional`

### 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.
- `additional` (Map of String) Additional fields that are not part of the schema
- `billing_duration_amount` (Number) The billing period duration
- `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.
- `files` (Attributes) (see [below for nested schema](#nestedatt--files))
- `id` (String) The ID of this resource.
- `is_composite_price` (Boolean) The flag for prices that contain price components.
- `is_tax_inclusive` (Boolean) Specifies whether the price is considered `inclusive` of taxes or not.
- `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) 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_components` (Attributes) A set of [price](/api/pricing#tag/simple_price_schema) components that define the composite price. (see [below for nested schema](#nestedatt--price_components))
- `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`.
Expand All @@ -49,17 +57,57 @@ data "epilot-product_price" "my_price" {
must be one of ["per_unit", "tiered_volume", "tiered_graduated", "tiered_flatfee"]
- `renewal_duration_amount` (Number) The renewal period duration
- `renewal_duration_unit` (String) The renewal period duration unit. must be one of ["weeks", "months", "years"]
- `schema` (String) must be one of ["price"]
- `tags` (List of String)
- `tax` (String) Parsed as JSON.
- `termination_time_amount` (Number) The termination period duration
- `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) 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"]
- `unit` (String) The unit of measurement used for display purposes and possibly for calculations when the price is variable.
- `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) The flag for prices that can be influenced by external variables such as user input.

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

Read-Only:

- `delete` (List of String)
- `edit` (List of String)
- `view` (List of String)


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

Read-Only:

- `dollar_relation` (Attributes List) (see [below for nested schema](#nestedatt--files--dollar_relation))

<a id="nestedatt--files--dollar_relation"></a>
### Nested Schema for `files.dollar_relation`

Read-Only:

- `entity_id` (String)
- `tags` (List of String)



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

Read-Only:

- `org_id` (String)
- `user_id` (String)


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

Expand Down Expand Up @@ -88,5 +136,3 @@ Read-Only:
- `unit_amount` (Number)
- `unit_amount_decimal` (String)
- `up_to` (Number)


105 changes: 102 additions & 3 deletions docs/data-sources/product.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ Product DataSource

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

Expand All @@ -25,19 +26,31 @@ data "epilot-product_product" "my_product" {
### Optional

- `hydrate` (Boolean) Hydrates entities in relations when passed true
- `strict` (Boolean) When passed true, the response will contain only fields that match the schema, with non-matching fields included in `__additional`

### 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)
- `additional` (Map of String) Additional fields that are not part of the schema
- `availability_files` (Attributes) (see [below for nested schema](#nestedatt--availability_files))
- `code` (String) The product code
- `created_at` (String)
- `description` (String) A description of the product. Multi-line supported.
- `feature` (List of String)
- `files` (Attributes) (see [below for nested schema](#nestedatt--files))
- `id` (String) The ID of this resource.
- `internal_name` (String) Not visible to customers, only in internal tables
- `name` (String) The description for the product
- `org` (String) Organization Id the entity belongs to
- `owners` (Attributes List) (see [below for nested schema](#nestedatt--owners))
- `price_options` (Attributes) (see [below for nested schema](#nestedatt--price_options))
- `product_downloads` (String) Parsed as JSON.
- `product_images` (String) Parsed as JSON.
- `product_downloads` (Attributes) (see [below for nested schema](#nestedatt--product_downloads))
- `product_images` (Attributes) (see [below for nested schema](#nestedatt--product_images))
- `purpose` (List of String)
- `schema` (String) must be one of ["product"]
- `tags` (List of String)
- `title` (String)
- `type` (String) The type of Product:

| type | description |
Expand All @@ -46,6 +59,60 @@ data "epilot-product_product" "my_product" {
| `service` | Represents a service or virtual product |

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

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

Read-Only:

- `delete` (List of String)
- `edit` (List of String)
- `view` (List of String)


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

Read-Only:

- `dollar_relation` (Attributes List) (see [below for nested schema](#nestedatt--availability_files--dollar_relation))

<a id="nestedatt--availability_files--dollar_relation"></a>
### Nested Schema for `availability_files.dollar_relation`

Read-Only:

- `entity_id` (String)
- `tags` (List of String)



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

Read-Only:

- `dollar_relation` (Attributes List) (see [below for nested schema](#nestedatt--files--dollar_relation))

<a id="nestedatt--files--dollar_relation"></a>
### Nested Schema for `files.dollar_relation`

Read-Only:

- `entity_id` (String)
- `tags` (List of String)



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

Read-Only:

- `org_id` (String)
- `user_id` (String)


<a id="nestedatt--price_options"></a>
### Nested Schema for `price_options`
Expand All @@ -63,3 +130,35 @@ Read-Only:
- `tags` (List of String)



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

Read-Only:

- `dollar_relation` (Attributes List) (see [below for nested schema](#nestedatt--product_downloads--dollar_relation))

<a id="nestedatt--product_downloads--dollar_relation"></a>
### Nested Schema for `product_downloads.dollar_relation`

Read-Only:

- `entity_id` (String)
- `tags` (List of String)



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

Read-Only:

- `dollar_relation` (Attributes List) (see [below for nested schema](#nestedatt--product_images--dollar_relation))

<a id="nestedatt--product_images--dollar_relation"></a>
### Nested Schema for `product_images.dollar_relation`

Read-Only:

- `entity_id` (String)
- `tags` (List of String)
Loading

0 comments on commit 1ce958c

Please sign in to comment.