Skip to content

Commit 329b35a

Browse files
committed
Run make docs
1 parent c50809b commit 329b35a

File tree

5 files changed

+134
-22
lines changed

5 files changed

+134
-22
lines changed

docs/index.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ page_title: "commercetools provider"
33
subcategory: ""
44
description: |-
55
The commercetools provider provides resources to interact with the commercetools API
6-
6+
77
---
88

99
# commercetools provider
@@ -14,8 +14,9 @@ able to offer support. Please contact us at
1414
[opensource@labdigital.nl](opensource@labdigital.nl)!
1515

1616
## Installation
17-
Terraform 0.13 added support for automatically downloading providers from
18-
the terraform registry. Add the following to your terraform project
17+
Terraform automatically downloads providers from the terraform registry. Add the
18+
following to your terraform project
19+
1920

2021
```hcl
2122
terraform {
@@ -78,10 +79,11 @@ docker build . -t terraform-with-provider-commercetools:latest
7879
```
7980
Then you can run a terraform command on files in the current directory with:
8081
```sh
81-
docker run -v${pwd}:/config terraform-with-provider-commercetools:latest <CMD>
82+
docker run -v "${pwd}:/config" terraform-with-provider-commercetools:latest <CMD>
8283
```
84+
8385
## Authors
8486
This project is developed by [Lab Digital](https://www.labdigital.nl). We
8587
welcome additional contributors. Please see our
8688
[GitHub repository](https://github.com/labd/terraform-provider-commercetools)
87-
for more information.
89+
for more information.

docs/resources/cart_discount.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ resource "commercetools_cart_discount" "my-cart-discount" {
2929
permyriad = 1000
3030
}
3131
predicate = "1=1"
32-
target {
32+
target = {
3333
type = "lineItems"
3434
predicate = "1=1"
3535
}
@@ -61,7 +61,7 @@ resource "commercetools_cart_discount" "my-cart-discount" {
6161
}
6262
}
6363
predicate = "any-predicate"
64-
target {
64+
target = {
6565
type = "shipping"
6666
}
6767
sort_order = "0.8"
@@ -83,7 +83,7 @@ resource "commercetools_cart_discount" "my-cart-discount" {
8383
distribution_channel_id = "distribution-channel-id"
8484
}
8585
predicate = "any-predicate"
86-
target {
86+
target = {
8787
type = "shipping"
8888
}
8989
sort_order = "0.8"

docs/resources/product_discount.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "commercetools_product_discount Resource - terraform-provider-commercetools"
4+
subcategory: ""
5+
description: |-
6+
Product discounts are used to reduce certain product prices.
7+
Also see the Product Discount API Documentation https://docs.commercetools.com/api/projects/productDiscounts.
8+
---
9+
10+
# commercetools_product_discount (Resource)
11+
12+
Product discounts are used to reduce certain product prices.
13+
14+
Also see the [Product Discount API Documentation](https://docs.commercetools.com/api/projects/productDiscounts).
15+
16+
## Example Usage
17+
18+
```terraform
19+
resource "commercetools_product_discount" "my-product-discount" {
20+
key = "my-product-discount-key"
21+
name = {
22+
en = "Product discount name"
23+
}
24+
description = {
25+
en = "Product discount description"
26+
}
27+
predicate = "1=1"
28+
sort_order = "0.9"
29+
is_active = true
30+
valid_from = "2018-01-02T15:04:05Z"
31+
valid_until = "2019-01-02T15:04:05Z"
32+
33+
value {
34+
type = "relative"
35+
permyriad = 1000
36+
}
37+
}
38+
39+
resource "commercetools_product_discount" "my-product-discount-absolute" {
40+
key = "my-product-discount-absolute-key"
41+
name = {
42+
en = "Product discount name"
43+
}
44+
description = {
45+
en = "Product discount description"
46+
}
47+
predicate = "1=1"
48+
sort_order = "0.9"
49+
is_active = true
50+
valid_from = "2018-01-02T15:04:05Z"
51+
valid_until = "2019-01-02T15:04:05Z"
52+
53+
value {
54+
type = "absolute"
55+
money {
56+
currency_code = "EUR"
57+
cent_amount = 500
58+
}
59+
}
60+
}
61+
```
62+
63+
<!-- schema generated by tfplugindocs -->
64+
## Schema
65+
66+
### Required
67+
68+
- `name` (Map of String) [LocalizedString](https://docs.commercetools.com/api/types#localizedstring)
69+
- `predicate` (String) A valid [Product Predicate](https://docs.commercetools.com/api/projects/predicates#product-predicates)
70+
- `sort_order` (String) The string must contain a number between 0 and 1. All matching product discounts are applied to a product in the order defined by this field. A discount with greater sort order is prioritized higher than a discount with lower sort order. The sort order is unambiguous among all product discounts
71+
- `value` (Block List, Min: 1, Max: 1) Defines the effect the discount will have. [ProductDiscountValue](https://docs.commercetools.com/api/projects/productDiscounts#productdiscountvalue) (see [below for nested schema](#nestedblock--value))
72+
73+
### Optional
74+
75+
- `description` (Map of String) [LocalizedString](https://docs.commercetools.com/api/types#localizedstring)
76+
- `is_active` (Boolean) When set the product discount is applied to products matching the predicate
77+
- `key` (String) User-defined unique identifier for the ProductDiscount. Must be unique across a project
78+
- `valid_from` (String)
79+
- `valid_until` (String)
80+
81+
### Read-Only
82+
83+
- `id` (String) The ID of this resource.
84+
- `version` (Number)
85+
86+
<a id="nestedblock--value"></a>
87+
### Nested Schema for `value`
88+
89+
Required:
90+
91+
- `type` (String) Currently supports absolute/relative/external
92+
93+
Optional:
94+
95+
- `money` (Block List) Absolute discount specific fields (see [below for nested schema](#nestedblock--value--money))
96+
- `permyriad` (Number) Relative discount specific fields
97+
98+
<a id="nestedblock--value--money"></a>
99+
### Nested Schema for `value.money`
100+
101+
Required:
102+
103+
- `cent_amount` (Number) The amount in cents (the smallest indivisible unit of the currency)
104+
- `currency_code` (String) The currency code compliant to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)
105+
106+
Optional:
107+
108+
- `fraction_digits` (Number) The number of default fraction digits for the given currency, like 2 for EUR or 0 for JPY
109+
110+

docs/resources/product_type.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ resource "commercetools_product_type" "my-product-type" {
123123
type {
124124
name = "set"
125125
element_type {
126-
type = "lenum"
126+
name = "lenum"
127127
localized_value {
128128
key = "NL"
129129
label = {

examples/resources/commercetools_product_discount/resource.tf

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ resource "commercetools_product_discount" "my-product-discount" {
55
}
66
description = {
77
en = "Product discount description"
8-
}
9-
predicate = "1=1"
10-
sort_order = "0.9"
11-
is_active = true
12-
valid_from = "2018-01-02T15:04:05Z"
13-
valid_until = "2019-01-02T15:04:05Z"
8+
}
9+
predicate = "1=1"
10+
sort_order = "0.9"
11+
is_active = true
12+
valid_from = "2018-01-02T15:04:05Z"
13+
valid_until = "2019-01-02T15:04:05Z"
1414

1515
value {
1616
type = "relative"
@@ -25,15 +25,15 @@ resource "commercetools_product_discount" "my-product-discount-absolute" {
2525
}
2626
description = {
2727
en = "Product discount description"
28-
}
29-
predicate = "1=1"
30-
sort_order = "0.9"
31-
is_active = true
32-
valid_from = "2018-01-02T15:04:05Z"
33-
valid_until = "2019-01-02T15:04:05Z"
28+
}
29+
predicate = "1=1"
30+
sort_order = "0.9"
31+
is_active = true
32+
valid_from = "2018-01-02T15:04:05Z"
33+
valid_until = "2019-01-02T15:04:05Z"
3434

3535
value {
36-
type = "absolute"
36+
type = "absolute"
3737
money {
3838
currency_code = "EUR"
3939
cent_amount = 500

0 commit comments

Comments
 (0)