project

package
v1.14.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2024 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDeleteDaysAfterCreation = 15
)

Variables

View Source
var ProjectResourceDataV0 = tftypes.Object{
	AttributeTypes: map[string]tftypes.Type{
		"id":         tftypes.String,
		"key":        tftypes.String,
		"version":    tftypes.Number,
		"name":       tftypes.String,
		"currencies": tftypes.List{ElementType: tftypes.String},
		"countries":  tftypes.List{ElementType: tftypes.String},
		"languages":  tftypes.List{ElementType: tftypes.String},

		"enable_search_index_products": tftypes.Bool,
		"enable_search_index_orders":   tftypes.Bool,

		"carts": tftypes.Object{
			AttributeTypes: map[string]tftypes.Type{
				"country_tax_rate_fallback_enabled":   tftypes.Bool,
				"delete_days_after_last_modification": tftypes.Number,
			},
		},
		"messages": tftypes.Object{
			AttributeTypes: map[string]tftypes.Type{
				"enabled":                    tftypes.Bool,
				"delete_days_after_creation": tftypes.Number,
			},
		},
		"external_oauth": tftypes.Object{
			AttributeTypes: map[string]tftypes.Type{
				"url":                  tftypes.String,
				"authorization_header": tftypes.String,
			},
		},
		"shipping_rate_input_type": tftypes.String,
		"shipping_rate_cart_classification_value": tftypes.List{
			ElementType: tftypes.Object{
				AttributeTypes: map[string]tftypes.Type{
					"key": tftypes.String,
					"label": tftypes.Map{
						ElementType: tftypes.String,
					},
				},
			},
		},
	},
}
View Source
var ProjectResourceDataV1 = tftypes.Object{
	AttributeTypes: map[string]tftypes.Type{
		"id":         tftypes.String,
		"key":        tftypes.String,
		"version":    tftypes.Number,
		"name":       tftypes.String,
		"currencies": tftypes.List{ElementType: tftypes.String},
		"countries":  tftypes.List{ElementType: tftypes.String},
		"languages":  tftypes.List{ElementType: tftypes.String},

		"enable_search_index_products": tftypes.Bool,
		"enable_search_index_orders":   tftypes.Bool,

		"carts": tftypes.List{
			ElementType: tftypes.Object{
				AttributeTypes: map[string]tftypes.Type{
					"country_tax_rate_fallback_enabled":   tftypes.Bool,
					"delete_days_after_last_modification": tftypes.Number,
				},
			},
		},
		"messages": tftypes.List{
			ElementType: tftypes.Object{
				AttributeTypes: map[string]tftypes.Type{
					"enabled":                    tftypes.Bool,
					"delete_days_after_creation": tftypes.Number,
				},
			},
		},
		"external_oauth": tftypes.List{
			ElementType: tftypes.Object{
				AttributeTypes: map[string]tftypes.Type{
					"url":                  tftypes.String,
					"authorization_header": tftypes.String,
				},
			},
		},
		"shipping_rate_input_type": tftypes.String,
		"shipping_rate_cart_classification_value": tftypes.List{
			ElementType: tftypes.Object{
				AttributeTypes: map[string]tftypes.Type{
					"key": tftypes.String,
					"label": tftypes.Map{
						ElementType: tftypes.String,
					},
				},
			},
		},
	},
}

Functions

func NewResource

func NewResource() resource.Resource

NewOrderResource is a helper function to simplify the provider implementation.

Types

type Carts

type Carts struct {
	CountryTaxRateFallbackEnabled   types.Bool  `tfsdk:"country_tax_rate_fallback_enabled"`
	DeleteDaysAfterLastModification types.Int64 `tfsdk:"delete_days_after_last_modification"`
}

type ExternalOAuth

type ExternalOAuth struct {
	URL                 types.String `tfsdk:"url"`
	AuthorizationHeader types.String `tfsdk:"authorization_header"`
}

type Messages

type Messages struct {
	Enabled                 types.Bool  `tfsdk:"enabled"`
	DeleteDaysAfterCreation types.Int64 `tfsdk:"delete_days_after_creation"`
}

type Project

type Project struct {
	ID      types.String `tfsdk:"id"`
	Key     types.String `tfsdk:"key"`
	Version types.Int64  `tfsdk:"version"`

	Name       types.String   `tfsdk:"name"`
	Currencies []types.String `tfsdk:"currencies"`
	Countries  []types.String `tfsdk:"countries"`
	Languages  []types.String `tfsdk:"languages"`

	EnableSearchIndexProducts types.Bool `tfsdk:"enable_search_index_products"`
	EnableSearchIndexOrders   types.Bool `tfsdk:"enable_search_index_orders"`

	// These items all have maximal one item. We don't use SingleNestedBlock
	// here since it isn't quite robust currently.
	// See https://github.com/hashicorp/terraform-plugin-framework/issues/603
	Carts         []Carts         `tfsdk:"carts"`
	Messages      []Messages      `tfsdk:"messages"`
	ExternalOAuth []ExternalOAuth `tfsdk:"external_oauth"`

	ShippingRateInputType               types.String                           `tfsdk:"shipping_rate_input_type"`
	ShippingRateCartClassificationValue []models.CustomFieldLocalizedEnumValue `tfsdk:"shipping_rate_cart_classification_value"`
}

func NewProjectFromNative

func NewProjectFromNative(n *platform.Project) Project

type ProjectResource

type ProjectResource struct {
	// contains filtered or unexported fields
}

orderResource is the resource implementation.

func (*ProjectResource) Configure

Configure adds the provider configured client to the data source.

func (*ProjectResource) Create

Create creates the resource and sets the initial Terraform state.

func (*ProjectResource) Delete

Delete deletes the resource and removes the Terraform state on success.

func (*ProjectResource) ImportState

func (*ProjectResource) Metadata

Metadata returns the data source type name.

func (*ProjectResource) Read

Read refreshes the Terraform state with the latest data.

func (*ProjectResource) Schema

Schema defines the schema for the data source.

func (*ProjectResource) Update

Update updates the resource and sets the updated Terraform state on success.

func (*ProjectResource) UpgradeState

func (p *ProjectResource) UpgradeState(ctx context.Context) map[int64]resource.StateUpgrader

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL