Documentation
¶
Index ¶
- Constants
- Variables
- func NewResource() resource.Resource
- type Carts
- type ExternalOAuth
- type Messages
- type Project
- type ProjectResource
- func (r *ProjectResource) Configure(_ context.Context, req resource.ConfigureRequest, ...)
- func (r *ProjectResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *ProjectResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *ProjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *ProjectResource) Metadata(_ context.Context, req resource.MetadataRequest, ...)
- func (r *ProjectResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *ProjectResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *ProjectResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- func (p *ProjectResource) UpgradeState(ctx context.Context) map[int64]resource.StateUpgrader
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 ¶
NewOrderResource is a helper function to simplify the provider implementation.
Types ¶
type ExternalOAuth ¶
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 ¶
type ProjectResource ¶
type ProjectResource struct {
// contains filtered or unexported fields
}
orderResource is the resource implementation.
func (*ProjectResource) Configure ¶
func (r *ProjectResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse)
Configure adds the provider configured client to the data source.
func (*ProjectResource) Create ¶
func (r *ProjectResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
Create creates the resource and sets the initial Terraform state.
func (*ProjectResource) Delete ¶
func (r *ProjectResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
Delete deletes the resource and removes the Terraform state on success.
func (*ProjectResource) ImportState ¶
func (r *ProjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
func (*ProjectResource) Metadata ¶
func (r *ProjectResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
Metadata returns the data source type name.
func (*ProjectResource) Read ¶
func (r *ProjectResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
Read refreshes the Terraform state with the latest data.
func (*ProjectResource) Schema ¶
func (r *ProjectResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse)
Schema defines the schema for the data source.
func (*ProjectResource) Update ¶
func (r *ProjectResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
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
Click to show internal directories.
Click to hide internal directories.