Skip to content

Commit

Permalink
Fix tax resource
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishu Goel committed Aug 2, 2024
1 parent 2327a39 commit 37cb527
Show file tree
Hide file tree
Showing 128 changed files with 764 additions and 144 deletions.
11 changes: 6 additions & 5 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: eaabb563fad27e9ee9491821eed37c90
docVersion: 1.0.0
speakeasyVersion: 1.346.1
generationVersion: 2.379.5
releaseVersion: 0.7.1
configChecksum: 471b09ecdd5dfbf4b53a91017831717e
speakeasyVersion: 1.346.0
generationVersion: 2.379.3
releaseVersion: 0.8.0
configChecksum: b9b4343b0dcae6ca8e16dcda70cadc56
repoURL: https://github.com/epilot-dev/terraform-provider-epilot-product.git
repoSubDirectory: .
published: true
Expand All @@ -26,6 +26,7 @@ features:
globalSecurity: 2.81.6
globalServerURLs: 2.82.1
nullables: 0.0.0
typeOverrides: 2.81.1
generatedFiles:
- internal/sdk/price.go
- internal/sdk/product.go
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.7.1"
version = "0.8.0"
}
}
}
Expand Down
92 changes: 92 additions & 0 deletions docs/data-sources/price.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "epilot-product_price Data Source - terraform-provider-epilot-product"
subcategory: ""
description: |-
Price DataSource
---

# epilot-product_price (Data Source)

Price DataSource

## Example Usage

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

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

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

### Read-Only

- `active` (Boolean) Whether the price can be used for new purchases.
- `billing_duration_amount` (Number) The billing period duration
- `billing_duration_unit` (String) The billing period duration unit. must be one of ["weeks", "months", "years"]
- `description` (String) A brief description of the price.
- `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"]
- `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`.
- `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"]
- `renewal_duration_amount` (Number) The renewal period duration
- `renewal_duration_unit` (String) The renewal period duration unit. must be one of ["weeks", "months", "years"]
- `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))
- `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.
- `variable_price` (Boolean) The flag for prices that can be influenced by external variables such as user input.

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

Read-Only:

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

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

Read-Only:

- `entity_id` (String) The id of the price component
- `tags` (List of String) An arbitrary set of tags attached to the composite price - component relation



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

Read-Only:

- `display_mode` (String) must be one of ["hidden", "on_request"]
- `flat_fee_amount` (Number)
- `flat_fee_amount_decimal` (String)
- `unit_amount` (Number)
- `unit_amount_decimal` (String)
- `up_to` (Number)


65 changes: 65 additions & 0 deletions docs/data-sources/product.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "epilot-product_product Data Source - terraform-provider-epilot-product"
subcategory: ""
description: |-
Product DataSource
---

# epilot-product_product (Data Source)

Product DataSource

## Example Usage

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

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

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

### Read-Only

- `active` (Boolean)
- `code` (String) The product code
- `description` (String) A description of the product. Multi-line supported.
- `feature` (List of String)
- `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
- `price_options` (Attributes) (see [below for nested schema](#nestedatt--price_options))
- `product_downloads` (String) Parsed as JSON.
- `product_images` (String) Parsed as JSON.
- `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"]

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

Read-Only:

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

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

Read-Only:

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


38 changes: 38 additions & 0 deletions docs/data-sources/tax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "epilot-product_tax Data Source - terraform-provider-epilot-product"
subcategory: ""
description: |-
Tax DataSource
---

# epilot-product_tax (Data Source)

Tax DataSource

## Example Usage

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

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

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

### Read-Only

- `active` (Boolean)
- `description` (String)
- `id` (String) The ID of this resource.
- `rate` (String)
- `region` (String) must be one of ["DE", "AT", "CH"]
- `type` (String) must be one of ["VAT", "Custom"]


37 changes: 37 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "epilot-product Provider"
subcategory: ""
description: |-
---

# epilot-product Provider



## Example Usage

```terraform
terraform {
required_providers {
epilot-product = {
source = "epilot-dev/epilot-product"
version = "0.7.1"
}
}
}
provider "epilot-product" {
# Configuration options
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `epilot_auth` (String, Sensitive)
- `epilot_org` (String, Sensitive)
- `server_url` (String) Server URL (defaults to https://product.sls.epilot.io)
121 changes: 121 additions & 0 deletions docs/resources/price.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "epilot-product_price Resource - terraform-provider-epilot-product"
subcategory: ""
description: |-
Price Resource
---

# epilot-product_price (Resource)

Price Resource

## Example Usage

```terraform
resource "epilot-product_price" "my_price" {
active = true
billing_duration_amount = 66.76
billing_duration_unit = "weeks"
description = "...my_description..."
is_composite_price = false
is_tax_inclusive = true
long_description = "...my_long_description..."
notice_time_amount = 2.66
notice_time_unit = "months"
price_display_in_journeys = "show_as_starting_price"
price_id = "123e4567-e89b-12d3-a456-426614174000"
pricing_model = "tiered_graduated"
renewal_duration_amount = 66.62
renewal_duration_unit = "weeks"
tax = "{ \"see\": \"documentation\" }"
termination_time_amount = 44.65
termination_time_unit = "years"
type = "one_time"
unit = "...my_unit..."
unit_amount = 40.89
unit_amount_currency = "EUR"
unit_amount_decimal = "...my_unit_amount_decimal..."
variable_price = false
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `active` (Boolean) Whether the price can be used for new purchases.
- `description` (String) A brief description of the price.

### Optional

- `billing_duration_amount` (Number) The billing period duration
- `billing_duration_unit` (String) The billing period duration unit. must be one of ["weeks", "months", "years"]
- `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. 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) The notice period duration unit. must be one of ["weeks", "months", "years"]
- `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`.
- `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) The renewal period duration unit. must be one of ["weeks", "months", "years"]
- `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))
- `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` (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.
- `variable_price` (Boolean) The flag for prices that can be influenced by external variables such as user input. Default: false

### Read-Only

- `id` (String) The ID of this resource.

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

Optional:

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

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

Optional:

- `entity_id` (String) The id of the price component
- `tags` (List of String) An arbitrary set of tags attached to the composite price - component relation



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

Optional:

- `display_mode` (String) must be one of ["hidden", "on_request"]
- `flat_fee_amount` (Number)
- `flat_fee_amount_decimal` (String)
- `unit_amount` (Number)
- `unit_amount_decimal` (String)
- `up_to` (Number)

## Import

Import is supported using the following syntax:

```shell
terraform import epilot-product_price.my_epilot-product_price "123e4567-e89b-12d3-a456-426614174000"
```
Loading

0 comments on commit 37cb527

Please sign in to comment.