commercetools.ProductType
Explore with Pulumi AI
Product types are used to describe common characteristics, most importantly common custom attributes, of many concrete products. Please note: to customize other resources than products, please refer to resource_type.
See also the Product Type API Documentation
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as commercetools from "@pulumi/commercetools";
const some_generic_properties_product_type = new commercetools.ProductType("some-generic-properties-product-type", {
    key: "some-key",
    description: "All the generic product properties",
    attributes: [{
        name: "perishable",
        label: {
            en: "Is perishable",
            nl: "Is perishable",
        },
        required: true,
        type: {
            name: "boolean",
        },
    }],
});
const my_product_type = new commercetools.ProductType("my-product-type", {
    key: "my-product-type-key",
    description: "All the specific info concerning the lens",
    attributes: [
        {
            name: "autofocus",
            label: {
                en: "Has autofocus",
                nl: "Heeft autofocus",
            },
            required: true,
            type: {
                name: "boolean",
            },
        },
        {
            name: "lens_product_no",
            label: {
                en: "Lens product number",
                nl: "Objectief productnummer",
            },
            required: true,
            type: {
                name: "text",
            },
            constraint: "Unique",
            inputTip: {
                en: "Enter the product code",
                nl: "Voer de product code in",
            },
            searchable: true,
        },
        {
            name: "previous_model",
            label: {
                en: "Previous model",
                nl: "Vorig model",
            },
            type: {
                name: "reference",
                referenceTypeId: "product",
            },
        },
        {
            name: "product_properties",
            label: {
                en: "Product properties",
                nl: "Product eigenschappen",
            },
            required: false,
            type: {
                name: "nested",
                typeReference: some_generic_properties_product_type.productTypeId,
            },
        },
        {
            name: "some-flag",
            label: {
                en: "Some flag",
                nl: "Een vlag",
            },
            required: false,
            type: {
                name: "enum",
                values: [
                    {
                        key: "FLAG-1",
                        label: "Flag 1",
                    },
                    {
                        key: "FLAG-2",
                        label: "FLAG-2",
                    },
                ],
            },
        },
        {
            name: "origin",
            label: {
                en: "Origin country",
                nl: "Land van herkomst",
            },
            required: false,
            type: {
                name: "set",
                elementType: {
                    name: "lenum",
                    localizedValues: [
                        {
                            key: "NL",
                            label: {
                                en: "Netherlands",
                                nl: "Nederland",
                            },
                        },
                        {
                            key: "DE",
                            label: {
                                en: "Germany",
                                nl: "Duitsland",
                            },
                        },
                    ],
                },
            },
        },
    ],
});
import pulumi
import pulumi_commercetools as commercetools
some_generic_properties_product_type = commercetools.ProductType("some-generic-properties-product-type",
    key="some-key",
    description="All the generic product properties",
    attributes=[{
        "name": "perishable",
        "label": {
            "en": "Is perishable",
            "nl": "Is perishable",
        },
        "required": True,
        "type": {
            "name": "boolean",
        },
    }])
my_product_type = commercetools.ProductType("my-product-type",
    key="my-product-type-key",
    description="All the specific info concerning the lens",
    attributes=[
        {
            "name": "autofocus",
            "label": {
                "en": "Has autofocus",
                "nl": "Heeft autofocus",
            },
            "required": True,
            "type": {
                "name": "boolean",
            },
        },
        {
            "name": "lens_product_no",
            "label": {
                "en": "Lens product number",
                "nl": "Objectief productnummer",
            },
            "required": True,
            "type": {
                "name": "text",
            },
            "constraint": "Unique",
            "input_tip": {
                "en": "Enter the product code",
                "nl": "Voer de product code in",
            },
            "searchable": True,
        },
        {
            "name": "previous_model",
            "label": {
                "en": "Previous model",
                "nl": "Vorig model",
            },
            "type": {
                "name": "reference",
                "reference_type_id": "product",
            },
        },
        {
            "name": "product_properties",
            "label": {
                "en": "Product properties",
                "nl": "Product eigenschappen",
            },
            "required": False,
            "type": {
                "name": "nested",
                "type_reference": some_generic_properties_product_type.product_type_id,
            },
        },
        {
            "name": "some-flag",
            "label": {
                "en": "Some flag",
                "nl": "Een vlag",
            },
            "required": False,
            "type": {
                "name": "enum",
                "values": [
                    {
                        "key": "FLAG-1",
                        "label": "Flag 1",
                    },
                    {
                        "key": "FLAG-2",
                        "label": "FLAG-2",
                    },
                ],
            },
        },
        {
            "name": "origin",
            "label": {
                "en": "Origin country",
                "nl": "Land van herkomst",
            },
            "required": False,
            "type": {
                "name": "set",
                "element_type": {
                    "name": "lenum",
                    "localized_values": [
                        {
                            "key": "NL",
                            "label": {
                                "en": "Netherlands",
                                "nl": "Nederland",
                            },
                        },
                        {
                            "key": "DE",
                            "label": {
                                "en": "Germany",
                                "nl": "Duitsland",
                            },
                        },
                    ],
                },
            },
        },
    ])
package main
import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/commercetools/commercetools"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := commercetools.NewProductType(ctx, "some-generic-properties-product-type", &commercetools.ProductTypeArgs{
			Key:         pulumi.String("some-key"),
			Description: pulumi.String("All the generic product properties"),
			Attributes: commercetools.ProductTypeAttributeArray{
				&commercetools.ProductTypeAttributeArgs{
					Name: pulumi.String("perishable"),
					Label: pulumi.StringMap{
						"en": pulumi.String("Is perishable"),
						"nl": pulumi.String("Is perishable"),
					},
					Required: pulumi.Bool(true),
					Type: &commercetools.ProductTypeAttributeTypeArgs{
						Name: pulumi.String("boolean"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = commercetools.NewProductType(ctx, "my-product-type", &commercetools.ProductTypeArgs{
			Key:         pulumi.String("my-product-type-key"),
			Description: pulumi.String("All the specific info concerning the lens"),
			Attributes: commercetools.ProductTypeAttributeArray{
				&commercetools.ProductTypeAttributeArgs{
					Name: pulumi.String("autofocus"),
					Label: pulumi.StringMap{
						"en": pulumi.String("Has autofocus"),
						"nl": pulumi.String("Heeft autofocus"),
					},
					Required: pulumi.Bool(true),
					Type: &commercetools.ProductTypeAttributeTypeArgs{
						Name: pulumi.String("boolean"),
					},
				},
				&commercetools.ProductTypeAttributeArgs{
					Name: pulumi.String("lens_product_no"),
					Label: pulumi.StringMap{
						"en": pulumi.String("Lens product number"),
						"nl": pulumi.String("Objectief productnummer"),
					},
					Required: pulumi.Bool(true),
					Type: &commercetools.ProductTypeAttributeTypeArgs{
						Name: pulumi.String("text"),
					},
					Constraint: pulumi.String("Unique"),
					InputTip: pulumi.StringMap{
						"en": pulumi.String("Enter the product code"),
						"nl": pulumi.String("Voer de product code in"),
					},
					Searchable: pulumi.Bool(true),
				},
				&commercetools.ProductTypeAttributeArgs{
					Name: pulumi.String("previous_model"),
					Label: pulumi.StringMap{
						"en": pulumi.String("Previous model"),
						"nl": pulumi.String("Vorig model"),
					},
					Type: &commercetools.ProductTypeAttributeTypeArgs{
						Name:            pulumi.String("reference"),
						ReferenceTypeId: pulumi.String("product"),
					},
				},
				&commercetools.ProductTypeAttributeArgs{
					Name: pulumi.String("product_properties"),
					Label: pulumi.StringMap{
						"en": pulumi.String("Product properties"),
						"nl": pulumi.String("Product eigenschappen"),
					},
					Required: pulumi.Bool(false),
					Type: &commercetools.ProductTypeAttributeTypeArgs{
						Name:          pulumi.String("nested"),
						TypeReference: some_generic_properties_product_type.ProductTypeId,
					},
				},
				&commercetools.ProductTypeAttributeArgs{
					Name: pulumi.String("some-flag"),
					Label: pulumi.StringMap{
						"en": pulumi.String("Some flag"),
						"nl": pulumi.String("Een vlag"),
					},
					Required: pulumi.Bool(false),
					Type: &commercetools.ProductTypeAttributeTypeArgs{
						Name: pulumi.String("enum"),
						Values: commercetools.ProductTypeAttributeTypeValueArray{
							&commercetools.ProductTypeAttributeTypeValueArgs{
								Key:   pulumi.String("FLAG-1"),
								Label: pulumi.String("Flag 1"),
							},
							&commercetools.ProductTypeAttributeTypeValueArgs{
								Key:   pulumi.String("FLAG-2"),
								Label: pulumi.String("FLAG-2"),
							},
						},
					},
				},
				&commercetools.ProductTypeAttributeArgs{
					Name: pulumi.String("origin"),
					Label: pulumi.StringMap{
						"en": pulumi.String("Origin country"),
						"nl": pulumi.String("Land van herkomst"),
					},
					Required: pulumi.Bool(false),
					Type: &commercetools.ProductTypeAttributeTypeArgs{
						Name: pulumi.String("set"),
						ElementType: &commercetools.ProductTypeAttributeTypeElementTypeArgs{
							Name: pulumi.String("lenum"),
							LocalizedValues: commercetools.ProductTypeAttributeTypeElementTypeLocalizedValueArray{
								&commercetools.ProductTypeAttributeTypeElementTypeLocalizedValueArgs{
									Key: pulumi.String("NL"),
									Label: pulumi.StringMap{
										"en": pulumi.String("Netherlands"),
										"nl": pulumi.String("Nederland"),
									},
								},
								&commercetools.ProductTypeAttributeTypeElementTypeLocalizedValueArgs{
									Key: pulumi.String("DE"),
									Label: pulumi.StringMap{
										"en": pulumi.String("Germany"),
										"nl": pulumi.String("Duitsland"),
									},
								},
							},
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Commercetools = Pulumi.Commercetools;
return await Deployment.RunAsync(() => 
{
    var some_generic_properties_product_type = new Commercetools.ProductType("some-generic-properties-product-type", new()
    {
        Key = "some-key",
        Description = "All the generic product properties",
        Attributes = new[]
        {
            new Commercetools.Inputs.ProductTypeAttributeArgs
            {
                Name = "perishable",
                Label = 
                {
                    { "en", "Is perishable" },
                    { "nl", "Is perishable" },
                },
                Required = true,
                Type = new Commercetools.Inputs.ProductTypeAttributeTypeArgs
                {
                    Name = "boolean",
                },
            },
        },
    });
    var my_product_type = new Commercetools.ProductType("my-product-type", new()
    {
        Key = "my-product-type-key",
        Description = "All the specific info concerning the lens",
        Attributes = new[]
        {
            new Commercetools.Inputs.ProductTypeAttributeArgs
            {
                Name = "autofocus",
                Label = 
                {
                    { "en", "Has autofocus" },
                    { "nl", "Heeft autofocus" },
                },
                Required = true,
                Type = new Commercetools.Inputs.ProductTypeAttributeTypeArgs
                {
                    Name = "boolean",
                },
            },
            new Commercetools.Inputs.ProductTypeAttributeArgs
            {
                Name = "lens_product_no",
                Label = 
                {
                    { "en", "Lens product number" },
                    { "nl", "Objectief productnummer" },
                },
                Required = true,
                Type = new Commercetools.Inputs.ProductTypeAttributeTypeArgs
                {
                    Name = "text",
                },
                Constraint = "Unique",
                InputTip = 
                {
                    { "en", "Enter the product code" },
                    { "nl", "Voer de product code in" },
                },
                Searchable = true,
            },
            new Commercetools.Inputs.ProductTypeAttributeArgs
            {
                Name = "previous_model",
                Label = 
                {
                    { "en", "Previous model" },
                    { "nl", "Vorig model" },
                },
                Type = new Commercetools.Inputs.ProductTypeAttributeTypeArgs
                {
                    Name = "reference",
                    ReferenceTypeId = "product",
                },
            },
            new Commercetools.Inputs.ProductTypeAttributeArgs
            {
                Name = "product_properties",
                Label = 
                {
                    { "en", "Product properties" },
                    { "nl", "Product eigenschappen" },
                },
                Required = false,
                Type = new Commercetools.Inputs.ProductTypeAttributeTypeArgs
                {
                    Name = "nested",
                    TypeReference = some_generic_properties_product_type.ProductTypeId,
                },
            },
            new Commercetools.Inputs.ProductTypeAttributeArgs
            {
                Name = "some-flag",
                Label = 
                {
                    { "en", "Some flag" },
                    { "nl", "Een vlag" },
                },
                Required = false,
                Type = new Commercetools.Inputs.ProductTypeAttributeTypeArgs
                {
                    Name = "enum",
                    Values = new[]
                    {
                        new Commercetools.Inputs.ProductTypeAttributeTypeValueArgs
                        {
                            Key = "FLAG-1",
                            Label = "Flag 1",
                        },
                        new Commercetools.Inputs.ProductTypeAttributeTypeValueArgs
                        {
                            Key = "FLAG-2",
                            Label = "FLAG-2",
                        },
                    },
                },
            },
            new Commercetools.Inputs.ProductTypeAttributeArgs
            {
                Name = "origin",
                Label = 
                {
                    { "en", "Origin country" },
                    { "nl", "Land van herkomst" },
                },
                Required = false,
                Type = new Commercetools.Inputs.ProductTypeAttributeTypeArgs
                {
                    Name = "set",
                    ElementType = new Commercetools.Inputs.ProductTypeAttributeTypeElementTypeArgs
                    {
                        Name = "lenum",
                        LocalizedValues = new[]
                        {
                            new Commercetools.Inputs.ProductTypeAttributeTypeElementTypeLocalizedValueArgs
                            {
                                Key = "NL",
                                Label = 
                                {
                                    { "en", "Netherlands" },
                                    { "nl", "Nederland" },
                                },
                            },
                            new Commercetools.Inputs.ProductTypeAttributeTypeElementTypeLocalizedValueArgs
                            {
                                Key = "DE",
                                Label = 
                                {
                                    { "en", "Germany" },
                                    { "nl", "Duitsland" },
                                },
                            },
                        },
                    },
                },
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.commercetools.ProductType;
import com.pulumi.commercetools.ProductTypeArgs;
import com.pulumi.commercetools.inputs.ProductTypeAttributeArgs;
import com.pulumi.commercetools.inputs.ProductTypeAttributeTypeArgs;
import com.pulumi.commercetools.inputs.ProductTypeAttributeTypeElementTypeArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        var some_generic_properties_product_type = new ProductType("some-generic-properties-product-type", ProductTypeArgs.builder()
            .key("some-key")
            .description("All the generic product properties")
            .attributes(ProductTypeAttributeArgs.builder()
                .name("perishable")
                .label(Map.ofEntries(
                    Map.entry("en", "Is perishable"),
                    Map.entry("nl", "Is perishable")
                ))
                .required(true)
                .type(ProductTypeAttributeTypeArgs.builder()
                    .name("boolean")
                    .build())
                .build())
            .build());
        var my_product_type = new ProductType("my-product-type", ProductTypeArgs.builder()
            .key("my-product-type-key")
            .description("All the specific info concerning the lens")
            .attributes(            
                ProductTypeAttributeArgs.builder()
                    .name("autofocus")
                    .label(Map.ofEntries(
                        Map.entry("en", "Has autofocus"),
                        Map.entry("nl", "Heeft autofocus")
                    ))
                    .required(true)
                    .type(ProductTypeAttributeTypeArgs.builder()
                        .name("boolean")
                        .build())
                    .build(),
                ProductTypeAttributeArgs.builder()
                    .name("lens_product_no")
                    .label(Map.ofEntries(
                        Map.entry("en", "Lens product number"),
                        Map.entry("nl", "Objectief productnummer")
                    ))
                    .required(true)
                    .type(ProductTypeAttributeTypeArgs.builder()
                        .name("text")
                        .build())
                    .constraint("Unique")
                    .inputTip(Map.ofEntries(
                        Map.entry("en", "Enter the product code"),
                        Map.entry("nl", "Voer de product code in")
                    ))
                    .searchable(true)
                    .build(),
                ProductTypeAttributeArgs.builder()
                    .name("previous_model")
                    .label(Map.ofEntries(
                        Map.entry("en", "Previous model"),
                        Map.entry("nl", "Vorig model")
                    ))
                    .type(ProductTypeAttributeTypeArgs.builder()
                        .name("reference")
                        .referenceTypeId("product")
                        .build())
                    .build(),
                ProductTypeAttributeArgs.builder()
                    .name("product_properties")
                    .label(Map.ofEntries(
                        Map.entry("en", "Product properties"),
                        Map.entry("nl", "Product eigenschappen")
                    ))
                    .required(false)
                    .type(ProductTypeAttributeTypeArgs.builder()
                        .name("nested")
                        .typeReference(some_generic_properties_product_type.productTypeId())
                        .build())
                    .build(),
                ProductTypeAttributeArgs.builder()
                    .name("some-flag")
                    .label(Map.ofEntries(
                        Map.entry("en", "Some flag"),
                        Map.entry("nl", "Een vlag")
                    ))
                    .required(false)
                    .type(ProductTypeAttributeTypeArgs.builder()
                        .name("enum")
                        .values(                        
                            ProductTypeAttributeTypeValueArgs.builder()
                                .key("FLAG-1")
                                .label("Flag 1")
                                .build(),
                            ProductTypeAttributeTypeValueArgs.builder()
                                .key("FLAG-2")
                                .label("FLAG-2")
                                .build())
                        .build())
                    .build(),
                ProductTypeAttributeArgs.builder()
                    .name("origin")
                    .label(Map.ofEntries(
                        Map.entry("en", "Origin country"),
                        Map.entry("nl", "Land van herkomst")
                    ))
                    .required(false)
                    .type(ProductTypeAttributeTypeArgs.builder()
                        .name("set")
                        .elementType(ProductTypeAttributeTypeElementTypeArgs.builder()
                            .name("lenum")
                            .localizedValues(                            
                                ProductTypeAttributeTypeElementTypeLocalizedValueArgs.builder()
                                    .key("NL")
                                    .label(Map.ofEntries(
                                        Map.entry("en", "Netherlands"),
                                        Map.entry("nl", "Nederland")
                                    ))
                                    .build(),
                                ProductTypeAttributeTypeElementTypeLocalizedValueArgs.builder()
                                    .key("DE")
                                    .label(Map.ofEntries(
                                        Map.entry("en", "Germany"),
                                        Map.entry("nl", "Duitsland")
                                    ))
                                    .build())
                            .build())
                        .build())
                    .build())
            .build());
    }
}
resources:
  some-generic-properties-product-type:
    type: commercetools:ProductType
    properties:
      key: some-key
      description: All the generic product properties
      attributes:
        - name: perishable
          label:
            en: Is perishable
            nl: Is perishable
          required: true
          type:
            name: boolean
  my-product-type:
    type: commercetools:ProductType
    properties:
      key: my-product-type-key
      description: All the specific info concerning the lens
      attributes:
        - name: autofocus
          label:
            en: Has autofocus
            nl: Heeft autofocus
          required: true
          type:
            name: boolean
        - name: lens_product_no
          label:
            en: Lens product number
            nl: Objectief productnummer
          required: true
          type:
            name: text
          constraint: Unique
          inputTip:
            en: Enter the product code
            nl: Voer de product code in
          searchable: true
        - name: previous_model
          label:
            en: Previous model
            nl: Vorig model
          type:
            name: reference
            referenceTypeId: product
        - name: product_properties
          label:
            en: Product properties
            nl: Product eigenschappen
          required: false
          type:
            name: nested
            typeReference: ${["some-generic-properties-product-type"].productTypeId}
        - name: some-flag
          label:
            en: Some flag
            nl: Een vlag
          required: false
          type:
            name: enum
            values:
              - key: FLAG-1
                label: Flag 1
              - key: FLAG-2
                label: FLAG-2
        - name: origin
          label:
            en: Origin country
            nl: Land van herkomst
          required: false
          type:
            name: set
            elementType:
              name: lenum
              localizedValues:
                - key: NL
                  label:
                    en: Netherlands
                    nl: Nederland
                - key: DE
                  label:
                    en: Germany
                    nl: Duitsland
Create ProductType Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ProductType(name: string, args?: ProductTypeArgs, opts?: CustomResourceOptions);@overload
def ProductType(resource_name: str,
                args: Optional[ProductTypeArgs] = None,
                opts: Optional[ResourceOptions] = None)
@overload
def ProductType(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                attributes: Optional[Sequence[ProductTypeAttributeArgs]] = None,
                description: Optional[str] = None,
                key: Optional[str] = None,
                name: Optional[str] = None,
                product_type_id: Optional[str] = None)func NewProductType(ctx *Context, name string, args *ProductTypeArgs, opts ...ResourceOption) (*ProductType, error)public ProductType(string name, ProductTypeArgs? args = null, CustomResourceOptions? opts = null)
public ProductType(String name, ProductTypeArgs args)
public ProductType(String name, ProductTypeArgs args, CustomResourceOptions options)
type: commercetools:ProductType
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ProductTypeArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ProductTypeArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ProductTypeArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProductTypeArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ProductTypeArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var productTypeResource = new Commercetools.ProductType("productTypeResource", new()
{
    Attributes = new[]
    {
        new Commercetools.Inputs.ProductTypeAttributeArgs
        {
            Label = 
            {
                { "string", "string" },
            },
            Name = "string",
            Type = new Commercetools.Inputs.ProductTypeAttributeTypeArgs
            {
                Name = "string",
                ElementType = new Commercetools.Inputs.ProductTypeAttributeTypeElementTypeArgs
                {
                    Name = "string",
                    LocalizedValues = new[]
                    {
                        new Commercetools.Inputs.ProductTypeAttributeTypeElementTypeLocalizedValueArgs
                        {
                            Key = "string",
                            Label = 
                            {
                                { "string", "string" },
                            },
                        },
                    },
                    ReferenceTypeId = "string",
                    TypeReference = "string",
                    Values = new[]
                    {
                        new Commercetools.Inputs.ProductTypeAttributeTypeElementTypeValueArgs
                        {
                            Key = "string",
                            Label = "string",
                        },
                    },
                },
                LocalizedValues = new[]
                {
                    new Commercetools.Inputs.ProductTypeAttributeTypeLocalizedValueArgs
                    {
                        Key = "string",
                        Label = 
                        {
                            { "string", "string" },
                        },
                    },
                },
                ReferenceTypeId = "string",
                TypeReference = "string",
                Values = new[]
                {
                    new Commercetools.Inputs.ProductTypeAttributeTypeValueArgs
                    {
                        Key = "string",
                        Label = "string",
                    },
                },
            },
            Constraint = "string",
            InputHint = "string",
            InputTip = 
            {
                { "string", "string" },
            },
            Required = false,
            Searchable = false,
        },
    },
    Description = "string",
    Key = "string",
    Name = "string",
    ProductTypeId = "string",
});
example, err := commercetools.NewProductType(ctx, "productTypeResource", &commercetools.ProductTypeArgs{
Attributes: .ProductTypeAttributeArray{
&.ProductTypeAttributeArgs{
Label: pulumi.StringMap{
"string": pulumi.String("string"),
},
Name: pulumi.String("string"),
Type: &.ProductTypeAttributeTypeArgs{
Name: pulumi.String("string"),
ElementType: &.ProductTypeAttributeTypeElementTypeArgs{
Name: pulumi.String("string"),
LocalizedValues: .ProductTypeAttributeTypeElementTypeLocalizedValueArray{
&.ProductTypeAttributeTypeElementTypeLocalizedValueArgs{
Key: pulumi.String("string"),
Label: pulumi.StringMap{
"string": pulumi.String("string"),
},
},
},
ReferenceTypeId: pulumi.String("string"),
TypeReference: pulumi.String("string"),
Values: .ProductTypeAttributeTypeElementTypeValueArray{
&.ProductTypeAttributeTypeElementTypeValueArgs{
Key: pulumi.String("string"),
Label: pulumi.String("string"),
},
},
},
LocalizedValues: .ProductTypeAttributeTypeLocalizedValueArray{
&.ProductTypeAttributeTypeLocalizedValueArgs{
Key: pulumi.String("string"),
Label: pulumi.StringMap{
"string": pulumi.String("string"),
},
},
},
ReferenceTypeId: pulumi.String("string"),
TypeReference: pulumi.String("string"),
Values: .ProductTypeAttributeTypeValueArray{
&.ProductTypeAttributeTypeValueArgs{
Key: pulumi.String("string"),
Label: pulumi.String("string"),
},
},
},
Constraint: pulumi.String("string"),
InputHint: pulumi.String("string"),
InputTip: pulumi.StringMap{
"string": pulumi.String("string"),
},
Required: pulumi.Bool(false),
Searchable: pulumi.Bool(false),
},
},
Description: pulumi.String("string"),
Key: pulumi.String("string"),
Name: pulumi.String("string"),
ProductTypeId: pulumi.String("string"),
})
var productTypeResource = new ProductType("productTypeResource", ProductTypeArgs.builder()
    .attributes(ProductTypeAttributeArgs.builder()
        .label(Map.of("string", "string"))
        .name("string")
        .type(ProductTypeAttributeTypeArgs.builder()
            .name("string")
            .elementType(ProductTypeAttributeTypeElementTypeArgs.builder()
                .name("string")
                .localizedValues(ProductTypeAttributeTypeElementTypeLocalizedValueArgs.builder()
                    .key("string")
                    .label(Map.of("string", "string"))
                    .build())
                .referenceTypeId("string")
                .typeReference("string")
                .values(ProductTypeAttributeTypeElementTypeValueArgs.builder()
                    .key("string")
                    .label("string")
                    .build())
                .build())
            .localizedValues(ProductTypeAttributeTypeLocalizedValueArgs.builder()
                .key("string")
                .label(Map.of("string", "string"))
                .build())
            .referenceTypeId("string")
            .typeReference("string")
            .values(ProductTypeAttributeTypeValueArgs.builder()
                .key("string")
                .label("string")
                .build())
            .build())
        .constraint("string")
        .inputHint("string")
        .inputTip(Map.of("string", "string"))
        .required(false)
        .searchable(false)
        .build())
    .description("string")
    .key("string")
    .name("string")
    .productTypeId("string")
    .build());
product_type_resource = commercetools.ProductType("productTypeResource",
    attributes=[{
        "label": {
            "string": "string",
        },
        "name": "string",
        "type": {
            "name": "string",
            "element_type": {
                "name": "string",
                "localized_values": [{
                    "key": "string",
                    "label": {
                        "string": "string",
                    },
                }],
                "reference_type_id": "string",
                "type_reference": "string",
                "values": [{
                    "key": "string",
                    "label": "string",
                }],
            },
            "localized_values": [{
                "key": "string",
                "label": {
                    "string": "string",
                },
            }],
            "reference_type_id": "string",
            "type_reference": "string",
            "values": [{
                "key": "string",
                "label": "string",
            }],
        },
        "constraint": "string",
        "input_hint": "string",
        "input_tip": {
            "string": "string",
        },
        "required": False,
        "searchable": False,
    }],
    description="string",
    key="string",
    name="string",
    product_type_id="string")
const productTypeResource = new commercetools.ProductType("productTypeResource", {
    attributes: [{
        label: {
            string: "string",
        },
        name: "string",
        type: {
            name: "string",
            elementType: {
                name: "string",
                localizedValues: [{
                    key: "string",
                    label: {
                        string: "string",
                    },
                }],
                referenceTypeId: "string",
                typeReference: "string",
                values: [{
                    key: "string",
                    label: "string",
                }],
            },
            localizedValues: [{
                key: "string",
                label: {
                    string: "string",
                },
            }],
            referenceTypeId: "string",
            typeReference: "string",
            values: [{
                key: "string",
                label: "string",
            }],
        },
        constraint: "string",
        inputHint: "string",
        inputTip: {
            string: "string",
        },
        required: false,
        searchable: false,
    }],
    description: "string",
    key: "string",
    name: "string",
    productTypeId: "string",
});
type: commercetools:ProductType
properties:
    attributes:
        - constraint: string
          inputHint: string
          inputTip:
            string: string
          label:
            string: string
          name: string
          required: false
          searchable: false
          type:
            elementType:
                localizedValues:
                    - key: string
                      label:
                        string: string
                name: string
                referenceTypeId: string
                typeReference: string
                values:
                    - key: string
                      label: string
            localizedValues:
                - key: string
                  label:
                    string: string
            name: string
            referenceTypeId: string
            typeReference: string
            values:
                - key: string
                  label: string
    description: string
    key: string
    name: string
    productTypeId: string
ProductType Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ProductType resource accepts the following input properties:
- Attributes
List<ProductType Attribute> 
- Product attribute definition
- Description string
- Key string
- User-specific unique identifier for the product type (max. 256 characters)
- Name string
- ProductType stringId 
- The ID of this resource.
- Attributes
[]ProductType Attribute Args 
- Product attribute definition
- Description string
- Key string
- User-specific unique identifier for the product type (max. 256 characters)
- Name string
- ProductType stringId 
- The ID of this resource.
- attributes
List<ProductType Attribute> 
- Product attribute definition
- description String
- key String
- User-specific unique identifier for the product type (max. 256 characters)
- name String
- productType StringId 
- The ID of this resource.
- attributes
ProductType Attribute[] 
- Product attribute definition
- description string
- key string
- User-specific unique identifier for the product type (max. 256 characters)
- name string
- productType stringId 
- The ID of this resource.
- attributes
Sequence[ProductType Attribute Args] 
- Product attribute definition
- description str
- key str
- User-specific unique identifier for the product type (max. 256 characters)
- name str
- product_type_ strid 
- The ID of this resource.
- attributes List<Property Map>
- Product attribute definition
- description String
- key String
- User-specific unique identifier for the product type (max. 256 characters)
- name String
- productType StringId 
- The ID of this resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the ProductType resource produces the following output properties:
Look up Existing ProductType Resource
Get an existing ProductType resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ProductTypeState, opts?: CustomResourceOptions): ProductType@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        attributes: Optional[Sequence[ProductTypeAttributeArgs]] = None,
        description: Optional[str] = None,
        key: Optional[str] = None,
        name: Optional[str] = None,
        product_type_id: Optional[str] = None,
        version: Optional[float] = None) -> ProductTypefunc GetProductType(ctx *Context, name string, id IDInput, state *ProductTypeState, opts ...ResourceOption) (*ProductType, error)public static ProductType Get(string name, Input<string> id, ProductTypeState? state, CustomResourceOptions? opts = null)public static ProductType get(String name, Output<String> id, ProductTypeState state, CustomResourceOptions options)resources:  _:    type: commercetools:ProductType    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Attributes
List<ProductType Attribute> 
- Product attribute definition
- Description string
- Key string
- User-specific unique identifier for the product type (max. 256 characters)
- Name string
- ProductType stringId 
- The ID of this resource.
- Version double
- Attributes
[]ProductType Attribute Args 
- Product attribute definition
- Description string
- Key string
- User-specific unique identifier for the product type (max. 256 characters)
- Name string
- ProductType stringId 
- The ID of this resource.
- Version float64
- attributes
List<ProductType Attribute> 
- Product attribute definition
- description String
- key String
- User-specific unique identifier for the product type (max. 256 characters)
- name String
- productType StringId 
- The ID of this resource.
- version Double
- attributes
ProductType Attribute[] 
- Product attribute definition
- description string
- key string
- User-specific unique identifier for the product type (max. 256 characters)
- name string
- productType stringId 
- The ID of this resource.
- version number
- attributes
Sequence[ProductType Attribute Args] 
- Product attribute definition
- description str
- key str
- User-specific unique identifier for the product type (max. 256 characters)
- name str
- product_type_ strid 
- The ID of this resource.
- version float
- attributes List<Property Map>
- Product attribute definition
- description String
- key String
- User-specific unique identifier for the product type (max. 256 characters)
- name String
- productType StringId 
- The ID of this resource.
- version Number
Supporting Types
ProductTypeAttribute, ProductTypeAttributeArgs      
- Label Dictionary<string, string>
- A human-readable label for the attribute
- Name string
- The unique name of the attribute used in the API. The name must be between two and 256 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (_) and the hyphen-minus (-). When using the same name for an attribute in two or more product types all fields of the AttributeDefinition of this attribute need to be the same across the product types, otherwise an AttributeDefinitionAlreadyExists error code will be returned. An exception to this are the values of an enum or lenum type and sets thereof
- Type
ProductType Attribute Type 
- AttributeType
- Constraint string
- Describes how an attribute or a set of attributes should be validated across all variants of a product. See also Attribute Constraint
- InputHint string
- Provides a visual representation type for this attribute. only relevant for text-based attribute types like TextType and LocalizableTextType
- InputTip Dictionary<string, string>
- Additional information about the attribute that aids content managers when setting product details
- Required bool
- Whether the attribute is required to have a value
- Searchable bool
- Whether the attribute's values should generally be activated in product search
- Label map[string]string
- A human-readable label for the attribute
- Name string
- The unique name of the attribute used in the API. The name must be between two and 256 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (_) and the hyphen-minus (-). When using the same name for an attribute in two or more product types all fields of the AttributeDefinition of this attribute need to be the same across the product types, otherwise an AttributeDefinitionAlreadyExists error code will be returned. An exception to this are the values of an enum or lenum type and sets thereof
- Type
ProductType Attribute Type 
- AttributeType
- Constraint string
- Describes how an attribute or a set of attributes should be validated across all variants of a product. See also Attribute Constraint
- InputHint string
- Provides a visual representation type for this attribute. only relevant for text-based attribute types like TextType and LocalizableTextType
- InputTip map[string]string
- Additional information about the attribute that aids content managers when setting product details
- Required bool
- Whether the attribute is required to have a value
- Searchable bool
- Whether the attribute's values should generally be activated in product search
- label Map<String,String>
- A human-readable label for the attribute
- name String
- The unique name of the attribute used in the API. The name must be between two and 256 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (_) and the hyphen-minus (-). When using the same name for an attribute in two or more product types all fields of the AttributeDefinition of this attribute need to be the same across the product types, otherwise an AttributeDefinitionAlreadyExists error code will be returned. An exception to this are the values of an enum or lenum type and sets thereof
- type
ProductType Attribute Type 
- AttributeType
- constraint String
- Describes how an attribute or a set of attributes should be validated across all variants of a product. See also Attribute Constraint
- inputHint String
- Provides a visual representation type for this attribute. only relevant for text-based attribute types like TextType and LocalizableTextType
- inputTip Map<String,String>
- Additional information about the attribute that aids content managers when setting product details
- required Boolean
- Whether the attribute is required to have a value
- searchable Boolean
- Whether the attribute's values should generally be activated in product search
- label {[key: string]: string}
- A human-readable label for the attribute
- name string
- The unique name of the attribute used in the API. The name must be between two and 256 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (_) and the hyphen-minus (-). When using the same name for an attribute in two or more product types all fields of the AttributeDefinition of this attribute need to be the same across the product types, otherwise an AttributeDefinitionAlreadyExists error code will be returned. An exception to this are the values of an enum or lenum type and sets thereof
- type
ProductType Attribute Type 
- AttributeType
- constraint string
- Describes how an attribute or a set of attributes should be validated across all variants of a product. See also Attribute Constraint
- inputHint string
- Provides a visual representation type for this attribute. only relevant for text-based attribute types like TextType and LocalizableTextType
- inputTip {[key: string]: string}
- Additional information about the attribute that aids content managers when setting product details
- required boolean
- Whether the attribute is required to have a value
- searchable boolean
- Whether the attribute's values should generally be activated in product search
- label Mapping[str, str]
- A human-readable label for the attribute
- name str
- The unique name of the attribute used in the API. The name must be between two and 256 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (_) and the hyphen-minus (-). When using the same name for an attribute in two or more product types all fields of the AttributeDefinition of this attribute need to be the same across the product types, otherwise an AttributeDefinitionAlreadyExists error code will be returned. An exception to this are the values of an enum or lenum type and sets thereof
- type
ProductType Attribute Type 
- AttributeType
- constraint str
- Describes how an attribute or a set of attributes should be validated across all variants of a product. See also Attribute Constraint
- input_hint str
- Provides a visual representation type for this attribute. only relevant for text-based attribute types like TextType and LocalizableTextType
- input_tip Mapping[str, str]
- Additional information about the attribute that aids content managers when setting product details
- required bool
- Whether the attribute is required to have a value
- searchable bool
- Whether the attribute's values should generally be activated in product search
- label Map<String>
- A human-readable label for the attribute
- name String
- The unique name of the attribute used in the API. The name must be between two and 256 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (_) and the hyphen-minus (-). When using the same name for an attribute in two or more product types all fields of the AttributeDefinition of this attribute need to be the same across the product types, otherwise an AttributeDefinitionAlreadyExists error code will be returned. An exception to this are the values of an enum or lenum type and sets thereof
- type Property Map
- AttributeType
- constraint String
- Describes how an attribute or a set of attributes should be validated across all variants of a product. See also Attribute Constraint
- inputHint String
- Provides a visual representation type for this attribute. only relevant for text-based attribute types like TextType and LocalizableTextType
- inputTip Map<String>
- Additional information about the attribute that aids content managers when setting product details
- required Boolean
- Whether the attribute is required to have a value
- searchable Boolean
- Whether the attribute's values should generally be activated in product search
ProductTypeAttributeType, ProductTypeAttributeTypeArgs        
- Name string
- Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it
- ElementType ProductType Attribute Type Element Type 
- LocalizedValues List<ProductType Attribute Type Localized Value> 
- Localized values for the lenumtype.
- ReferenceType stringId 
- Resource type the Custom Field can reference. Required when type is reference
- TypeReference string
- Reference to another product type. Required when type is nested.
- Values
List<ProductType Attribute Type Value> 
- Values for the enumtype.
- Name string
- Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it
- ElementType ProductType Attribute Type Element Type 
- LocalizedValues []ProductType Attribute Type Localized Value 
- Localized values for the lenumtype.
- ReferenceType stringId 
- Resource type the Custom Field can reference. Required when type is reference
- TypeReference string
- Reference to another product type. Required when type is nested.
- Values
[]ProductType Attribute Type Value 
- Values for the enumtype.
- name String
- Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it
- elementType ProductType Attribute Type Element Type 
- localizedValues List<ProductType Attribute Type Localized Value> 
- Localized values for the lenumtype.
- referenceType StringId 
- Resource type the Custom Field can reference. Required when type is reference
- typeReference String
- Reference to another product type. Required when type is nested.
- values
List<ProductType Attribute Type Value> 
- Values for the enumtype.
- name string
- Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it
- elementType ProductType Attribute Type Element Type 
- localizedValues ProductType Attribute Type Localized Value[] 
- Localized values for the lenumtype.
- referenceType stringId 
- Resource type the Custom Field can reference. Required when type is reference
- typeReference string
- Reference to another product type. Required when type is nested.
- values
ProductType Attribute Type Value[] 
- Values for the enumtype.
- name str
- Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it
- element_type ProductType Attribute Type Element Type 
- localized_values Sequence[ProductType Attribute Type Localized Value] 
- Localized values for the lenumtype.
- reference_type_ strid 
- Resource type the Custom Field can reference. Required when type is reference
- type_reference str
- Reference to another product type. Required when type is nested.
- values
Sequence[ProductType Attribute Type Value] 
- Values for the enumtype.
- name String
- Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it
- elementType Property Map
- localizedValues List<Property Map>
- Localized values for the lenumtype.
- referenceType StringId 
- Resource type the Custom Field can reference. Required when type is reference
- typeReference String
- Reference to another product type. Required when type is nested.
- values List<Property Map>
- Values for the enumtype.
ProductTypeAttributeTypeElementType, ProductTypeAttributeTypeElementTypeArgs            
- Name string
- Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it
- LocalizedValues List<ProductType Attribute Type Element Type Localized Value> 
- Localized values for the lenumtype.
- ReferenceType stringId 
- Resource type the Custom Field can reference. Required when type is reference
- TypeReference string
- Reference to another product type. Required when type is nested.
- Values
List<ProductType Attribute Type Element Type Value> 
- Values for the enumtype.
- Name string
- Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it
- LocalizedValues []ProductType Attribute Type Element Type Localized Value 
- Localized values for the lenumtype.
- ReferenceType stringId 
- Resource type the Custom Field can reference. Required when type is reference
- TypeReference string
- Reference to another product type. Required when type is nested.
- Values
[]ProductType Attribute Type Element Type Value 
- Values for the enumtype.
- name String
- Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it
- localizedValues List<ProductType Attribute Type Element Type Localized Value> 
- Localized values for the lenumtype.
- referenceType StringId 
- Resource type the Custom Field can reference. Required when type is reference
- typeReference String
- Reference to another product type. Required when type is nested.
- values
List<ProductType Attribute Type Element Type Value> 
- Values for the enumtype.
- name string
- Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it
- localizedValues ProductType Attribute Type Element Type Localized Value[] 
- Localized values for the lenumtype.
- referenceType stringId 
- Resource type the Custom Field can reference. Required when type is reference
- typeReference string
- Reference to another product type. Required when type is nested.
- values
ProductType Attribute Type Element Type Value[] 
- Values for the enumtype.
- name str
- Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it
- localized_values Sequence[ProductType Attribute Type Element Type Localized Value] 
- Localized values for the lenumtype.
- reference_type_ strid 
- Resource type the Custom Field can reference. Required when type is reference
- type_reference str
- Reference to another product type. Required when type is nested.
- values
Sequence[ProductType Attribute Type Element Type Value] 
- Values for the enumtype.
- name String
- Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it
- localizedValues List<Property Map>
- Localized values for the lenumtype.
- referenceType StringId 
- Resource type the Custom Field can reference. Required when type is reference
- typeReference String
- Reference to another product type. Required when type is nested.
- values List<Property Map>
- Values for the enumtype.
ProductTypeAttributeTypeElementTypeLocalizedValue, ProductTypeAttributeTypeElementTypeLocalizedValueArgs                
ProductTypeAttributeTypeElementTypeValue, ProductTypeAttributeTypeElementTypeValueArgs              
ProductTypeAttributeTypeLocalizedValue, ProductTypeAttributeTypeLocalizedValueArgs            
ProductTypeAttributeTypeValue, ProductTypeAttributeTypeValueArgs          
Package Details
- Repository
- commercetools labd/terraform-provider-commercetools
- License
- Notes
- This Pulumi package is based on the commercetoolsTerraform Provider.