diff --git a/docs/data-sources/billing_rules.md b/docs/data-sources/billing_rules.md
new file mode 100644
index 0000000..3c800bc
--- /dev/null
+++ b/docs/data-sources/billing_rules.md
@@ -0,0 +1,40 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "vantage_billing_rules Data Source - terraform-provider-vantage"
+subcategory: ""
+description: |-
+
+---
+
+# vantage_billing_rules (Data Source)
+
+
+
+
+
+
+## Schema
+
+### Read-Only
+
+- `billing_rules` (Attributes List) (see [below for nested schema](#nestedatt--billing_rules))
+
+
+### Nested Schema for `billing_rules`
+
+Read-Only:
+
+- `amount` (String) The amount for the Billing Rule (Charge).
+- `category` (String) The category for the Billing Rule (Charge).
+- `charge_type` (String) The charge type for the Billing Rule.
+- `created_at` (String) The date and time, in UTC, the Billing Rule was created. ISO 8601 Formatted.
+- `created_by_token` (String) The token of the User who created the Billing Rule.
+- `percentage` (String) The percentage of the cost shown for the Billing Rule (Adjustment).
+- `service` (String) The service for the Billing Rule (Charge).
+- `start_period` (String) The start period for the Billing Rule (Charge).
+- `sub_category` (String) The subcategory for the Billing Rule (Charge).
+- `title` (String) The title of the Billing Rule.
+- `token` (String)
+- `type` (String) The type of the Billing Rule.
+
+
diff --git a/docs/data-sources/business_metrics.md b/docs/data-sources/business_metrics.md
index b1584fc..ed2d0f9 100644
--- a/docs/data-sources/business_metrics.md
+++ b/docs/data-sources/business_metrics.md
@@ -24,11 +24,11 @@ description: |-
Read-Only:
-- `cost_report_tokens_with_metadata` (Attributes List) The tokens for any CostReports that use the BusinessMetric, and the unit scale. (see [below for nested schema](#nestedatt--business_metrics--cost_report_tokens_with_metadata))
+- `cost_report_tokens_with_metadata` (Attributes List) The tokens for any CostReports that use the BusinessMetric, the unit scale, and label filter. (see [below for nested schema](#nestedatt--business_metrics--cost_report_tokens_with_metadata))
- `created_by_token` (String) The token of the User who created the BusinessMetric.
- `title` (String) The title of the BusinessMetric.
- `token` (String) The token of the BusinessMetric.
-- `values` (Attributes List) The dates and amounts for the BusinessMetric (see [below for nested schema](#nestedatt--business_metrics--values))
+- `values` (Attributes List) The dates, amounts, and (optional) labels for the BusinessMetric. (see [below for nested schema](#nestedatt--business_metrics--values))
### Nested Schema for `business_metrics.cost_report_tokens_with_metadata`
@@ -36,6 +36,7 @@ Read-Only:
Read-Only:
- `cost_report_token` (String) The token of the CostReport the BusinessMetric is attached to.
+- `label_filter` (String) The labels that the BusinessMetric is filtered by within a particular CostReport.
- `unit_scale` (String) Determines the scale of the BusinessMetric's values within a particular CostReport.
@@ -46,5 +47,6 @@ Read-Only:
- `amount` (String) The amount of the Business Metric Value as a string to ensure precision.
- `date` (String) The date of the Business Metric Value. ISO 8601 formatted.
+- `label` (String) The label of the Business Metric Value.
diff --git a/docs/data-sources/cost_reports.md b/docs/data-sources/cost_reports.md
index 2fa3937..5a03989 100644
--- a/docs/data-sources/cost_reports.md
+++ b/docs/data-sources/cost_reports.md
@@ -24,10 +24,17 @@ description: |-
Read-Only:
+- `chart_type` (String)
+- `date_bin` (String)
+- `date_interval` (String)
+- `end_date` (String)
- `filter` (String)
- `folder_token` (String)
- `groupings` (String)
+- `previous_period_end_date` (String)
+- `previous_period_start_date` (String)
- `saved_filter_tokens` (List of String)
+- `start_date` (String)
- `title` (String)
- `token` (String)
- `workspace_token` (String)
diff --git a/docs/data-sources/managed_accounts.md b/docs/data-sources/managed_accounts.md
new file mode 100644
index 0000000..6eced47
--- /dev/null
+++ b/docs/data-sources/managed_accounts.md
@@ -0,0 +1,34 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "vantage_managed_accounts Data Source - terraform-provider-vantage"
+subcategory: ""
+description: |-
+
+---
+
+# vantage_managed_accounts (Data Source)
+
+
+
+
+
+
+## Schema
+
+### Read-Only
+
+- `managed_accounts` (Attributes List) (see [below for nested schema](#nestedatt--managed_accounts))
+
+
+### Nested Schema for `managed_accounts`
+
+Read-Only:
+
+- `access_credential_tokens` (List of String) The tokens for the Access Credentials assigned to the Managed Account.
+- `billing_rule_tokens` (List of String) The tokens for the Billing Rules assigned to the Managed Account.
+- `contact_email` (String)
+- `name` (String)
+- `parent_account_token` (String) The token for the parent Account.
+- `token` (String)
+
+
diff --git a/docs/data-sources/segments.md b/docs/data-sources/segments.md
index 2cdbd07..331c2d5 100644
--- a/docs/data-sources/segments.md
+++ b/docs/data-sources/segments.md
@@ -28,6 +28,7 @@ Read-Only:
- `filter` (String)
- `parent_segment_token` (String)
- `priority` (Number)
+- `report_token` (String)
- `title` (String)
- `token` (String)
- `track_unallocated` (Boolean)
diff --git a/docs/resources/billing_rule.md b/docs/resources/billing_rule.md
new file mode 100644
index 0000000..e4ed678
--- /dev/null
+++ b/docs/resources/billing_rule.md
@@ -0,0 +1,39 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "vantage_billing_rule Resource - terraform-provider-vantage"
+subcategory: ""
+description: |-
+
+---
+
+# vantage_billing_rule (Resource)
+
+
+
+
+
+
+## Schema
+
+### Required
+
+- `title` (String) The title of the Billing Rule.
+- `type` (String) The type of the Billing Rule. Note: the values are case insensitive.
+
+### Optional
+
+- `amount` (Number) The credit amount for the Billing Rule. Example value: 300
+- `category` (String) The category of the Billing Rule.
+- `charge_type` (String) The charge type of the Billing Rule.
+- `percentage` (Number) The percentage of the cost shown. Example value: 75.0
+- `service` (String) The service of the Billing Rule.
+- `start_period` (String) The start period of the Billing Rule.
+- `sub_category` (String) The subcategory of the Billing Rule.
+
+### Read-Only
+
+- `created_at` (String) The date and time, in UTC, the Billing Rule was created. ISO 8601 Formatted.
+- `created_by_token` (String) The token of the User who created the Billing Rule.
+- `token` (String) The token of the billing rule
+
+
diff --git a/docs/resources/budget.md b/docs/resources/budget.md
index 0938697..1e5bfb7 100644
--- a/docs/resources/budget.md
+++ b/docs/resources/budget.md
@@ -10,7 +10,21 @@ description: |-
-
+## Example Usage
+
+```terraform
+resource "vantage_budget" "demo_budget" {
+ name = "Demo Budget"
+ cost_report_token = vantage_cost_report.demo_report.token
+ periods = [
+ {
+ start_at = "2023-12-01"
+ end_at = "2024-01-01"
+ amount = 1000
+ }
+ ]
+}
+```
## Schema
diff --git a/docs/resources/cost_report.md b/docs/resources/cost_report.md
index 3a1c3d9..eeb0c4d 100644
--- a/docs/resources/cost_report.md
+++ b/docs/resources/cost_report.md
@@ -34,11 +34,18 @@ resource "vantage_cost_report" "demo_report" {
### Optional
+- `chart_type` (String) Chart type to apply to the Cost Report.
+- `date_bin` (String) Date bin to apply to the Cost Report.
+- `date_interval` (String) Date interval to apply to the Cost Report.
+- `end_date` (String) End date to apply to the Cost Report.
- `filter` (String) Filter query to apply to the Cost Report
-- `folder_token` (String) Token of the folder this report resides in.
+- `folder_token` (String) Token of the folder this Cost Report resides in.
- `groupings` (String) Grouping aggregations applied to the filtered data.
-- `saved_filter_tokens` (List of String) Saved filter tokens to be applied to the report.
-- `workspace_token` (String) Workspace token to add the cost report to.
+- `previous_period_end_date` (String) End date to apply to the Cost Report.
+- `previous_period_start_date` (String) Start date to apply to the Cost Report.
+- `saved_filter_tokens` (List of String) Saved filter tokens to be applied to the Cost Report.
+- `start_date` (String) Start date to apply to the Cost Report.
+- `workspace_token` (String) Workspace token to add the Cost Report to.
### Read-Only
diff --git a/docs/resources/managed_account.md b/docs/resources/managed_account.md
new file mode 100644
index 0000000..b7085f7
--- /dev/null
+++ b/docs/resources/managed_account.md
@@ -0,0 +1,33 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "vantage_managed_account Resource - terraform-provider-vantage"
+subcategory: ""
+description: |-
+
+---
+
+# vantage_managed_account (Resource)
+
+
+
+
+
+
+## Schema
+
+### Required
+
+- `contact_email` (String) The contact email address for the Managed Account.
+- `name` (String) The name of the Managed Account.
+
+### Optional
+
+- `access_credential_tokens` (List of String) Access Credential (aka Integrations) tokens to assign to the Managed Account.
+- `billing_rule_tokens` (List of String) Billing Rule tokens to assign to the Managed Account.
+
+### Read-Only
+
+- `parent_account_token` (String) The token for the parent Account.
+- `token` (String) The token of the managed account
+
+
diff --git a/docs/resources/segment.md b/docs/resources/segment.md
index 1154d64..1e61318 100644
--- a/docs/resources/segment.md
+++ b/docs/resources/segment.md
@@ -44,6 +44,7 @@ resource "vantage_segment" "demo_segment" {
### Read-Only
+- `report_token` (String) Token of the report for this segment.
- `token` (String) Unique segment identifier
diff --git a/go.mod b/go.mod
index 3994857..45df4e8 100644
--- a/go.mod
+++ b/go.mod
@@ -10,7 +10,7 @@ require (
github.com/hashicorp/terraform-plugin-docs v0.14.1
github.com/hashicorp/terraform-plugin-framework v1.5.0
github.com/hashicorp/terraform-plugin-testing v1.6.0
- github.com/vantage-sh/vantage-go v0.0.30
+ github.com/vantage-sh/vantage-go v0.0.35
)
require (
diff --git a/go.sum b/go.sum
index 04e1adb..2112b8b 100644
--- a/go.sum
+++ b/go.sum
@@ -318,8 +318,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
-github.com/vantage-sh/vantage-go v0.0.30 h1:9+9SnjLDi3dWx2yN/Do0t9eZgem/Dvi359gpQ9LaXPY=
-github.com/vantage-sh/vantage-go v0.0.30/go.mod h1:MsSI4gX/Wvkzo9kqWphZfE6puolmnbHcXSaoGkDCmXg=
+github.com/vantage-sh/vantage-go v0.0.35 h1:FuFabVryZyBocqauSnIJo/lmQk2tNArmrWxE+JnSGGw=
+github.com/vantage-sh/vantage-go v0.0.35/go.mod h1:MsSI4gX/Wvkzo9kqWphZfE6puolmnbHcXSaoGkDCmXg=
github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI=
github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
diff --git a/vantage/cost_report_resource.go b/vantage/cost_report_resource.go
index b5b2dc3..f1d7b10 100644
--- a/vantage/cost_report_resource.go
+++ b/vantage/cost_report_resource.go
@@ -25,13 +25,20 @@ func NewCostReportResource() resource.Resource {
}
type CostReportResourceModel struct {
- Token types.String `tfsdk:"token"`
- Title types.String `tfsdk:"title"`
- FolderToken types.String `tfsdk:"folder_token"`
- Filter types.String `tfsdk:"filter"`
- SavedFilterTokens types.List `tfsdk:"saved_filter_tokens"`
- WorkspaceToken types.String `tfsdk:"workspace_token"`
- Groupings types.String `tfsdk:"groupings"`
+ Token types.String `tfsdk:"token"`
+ Title types.String `tfsdk:"title"`
+ FolderToken types.String `tfsdk:"folder_token"`
+ Filter types.String `tfsdk:"filter"`
+ SavedFilterTokens types.List `tfsdk:"saved_filter_tokens"`
+ WorkspaceToken types.String `tfsdk:"workspace_token"`
+ Groupings types.String `tfsdk:"groupings"`
+ StartDate types.String `tfsdk:"start_date"`
+ EndDate types.String `tfsdk:"end_date"`
+ PreviousPeriodStartDate types.String `tfsdk:"previous_period_start_date"`
+ PreviousPeriodEndDate types.String `tfsdk:"previous_period_end_date"`
+ DateInterval types.String `tfsdk:"date_interval"`
+ ChartType types.String `tfsdk:"chart_type"`
+ DateBin types.String `tfsdk:"date_bin"`
}
func (r *CostReportResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
@@ -46,7 +53,7 @@ func (r CostReportResource) Schema(ctx context.Context, req resource.SchemaReque
Required: true,
},
"folder_token": schema.StringAttribute{
- MarkdownDescription: "Token of the folder this report resides in.",
+ MarkdownDescription: "Token of the folder this Cost Report resides in.",
Optional: true,
Computed: true,
},
@@ -60,14 +67,61 @@ func (r CostReportResource) Schema(ctx context.Context, req resource.SchemaReque
Optional: true,
Computed: true,
},
+ "start_date": schema.StringAttribute{
+ MarkdownDescription: "Start date to apply to the Cost Report.",
+ Optional: true,
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "end_date": schema.StringAttribute{
+ MarkdownDescription: "End date to apply to the Cost Report.",
+ Optional: true,
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "previous_period_start_date": schema.StringAttribute{
+ MarkdownDescription: "Start date to apply to the Cost Report.",
+ Optional: true,
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "previous_period_end_date": schema.StringAttribute{
+ MarkdownDescription: "End date to apply to the Cost Report.",
+ Optional: true,
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "date_interval": schema.StringAttribute{
+ MarkdownDescription: "Date interval to apply to the Cost Report.",
+ Optional: true,
+ Computed: true,
+ },
+ "chart_type": schema.StringAttribute{
+ MarkdownDescription: "Chart type to apply to the Cost Report.",
+ Optional: true,
+ Computed: true,
+ },
+ "date_bin": schema.StringAttribute{
+ MarkdownDescription: "Date bin to apply to the Cost Report.",
+ Optional: true,
+ Computed: true,
+ },
"saved_filter_tokens": schema.ListAttribute{
ElementType: types.StringType,
- MarkdownDescription: "Saved filter tokens to be applied to the report.",
+ MarkdownDescription: "Saved filter tokens to be applied to the Cost Report.",
Optional: true,
Computed: true,
},
"workspace_token": schema.StringAttribute{
- MarkdownDescription: "Workspace token to add the cost report to.",
+ MarkdownDescription: "Workspace token to add the Cost Report to.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.String{
@@ -107,12 +161,19 @@ func (r CostReportResource) Create(ctx context.Context, req resource.CreateReque
params := costsv2.NewCreateCostReportParams()
body := &modelsv2.CreateCostReport{
- Title: data.Title.ValueStringPointer(),
- FolderToken: data.FolderToken.ValueString(),
- Filter: data.Filter.ValueString(),
- Groupings: data.Groupings.ValueString(),
- SavedFilterTokens: fromStringsValue(sft),
- WorkspaceToken: data.WorkspaceToken.ValueString(),
+ Title: data.Title.ValueStringPointer(),
+ FolderToken: data.FolderToken.ValueString(),
+ Filter: data.Filter.ValueString(),
+ Groupings: data.Groupings.ValueString(),
+ SavedFilterTokens: fromStringsValue(sft),
+ WorkspaceToken: data.WorkspaceToken.ValueString(),
+ StartDate: data.StartDate.ValueString(),
+ EndDate: data.EndDate.ValueStringPointer(),
+ DateInterval: data.DateInterval.ValueString(),
+ PreviousPeriodStartDate: data.PreviousPeriodStartDate.ValueString(),
+ PreviousPeriodEndDate: data.PreviousPeriodEndDate.ValueStringPointer(),
+ ChartType: data.ChartType.ValueStringPointer(),
+ DateBin: data.DateBin.ValueStringPointer(),
}
params.WithCreateCostReport(body)
out, err := r.client.V2.Costs.CreateCostReport(params, r.client.Auth)
@@ -125,6 +186,13 @@ func (r CostReportResource) Create(ctx context.Context, req resource.CreateReque
data.Token = types.StringValue(out.Payload.Token)
data.Filter = types.StringValue(out.Payload.Filter)
data.Groupings = types.StringValue(out.Payload.Groupings)
+ data.StartDate = types.StringValue(out.Payload.StartDate)
+ data.EndDate = types.StringValue(out.Payload.EndDate)
+ data.PreviousPeriodStartDate = types.StringValue(out.Payload.PreviousPeriodStartDate)
+ data.PreviousPeriodEndDate = types.StringValue(out.Payload.PreviousPeriodEndDate)
+ data.DateInterval = types.StringValue(out.Payload.DateInterval)
+ data.ChartType = types.StringValue(out.Payload.ChartType)
+ data.DateBin = types.StringValue(out.Payload.DateBin)
data.FolderToken = types.StringValue(out.Payload.FolderToken)
data.WorkspaceToken = types.StringValue(out.Payload.WorkspaceToken)
savedFilterTokensValue, diag := types.ListValueFrom(ctx, types.StringType, out.Payload.SavedFilterTokens)
@@ -163,6 +231,13 @@ func (r CostReportResource) Read(ctx context.Context, req resource.ReadRequest,
state.Title = types.StringValue(out.Payload.Title)
state.Filter = types.StringValue(out.Payload.Filter)
state.Groupings = types.StringValue(out.Payload.Groupings)
+ state.StartDate = types.StringValue(out.Payload.StartDate)
+ state.EndDate = types.StringValue(out.Payload.EndDate)
+ state.PreviousPeriodStartDate = types.StringValue(out.Payload.PreviousPeriodStartDate)
+ state.PreviousPeriodEndDate = types.StringValue(out.Payload.PreviousPeriodEndDate)
+ state.DateInterval = types.StringValue(out.Payload.DateInterval)
+ state.ChartType = types.StringValue(out.Payload.ChartType)
+ state.DateBin = types.StringValue(out.Payload.DateBin)
state.WorkspaceToken = types.StringValue(out.Payload.WorkspaceToken)
savedFilterTokensValue, diag := types.ListValueFrom(ctx, types.StringType, out.Payload.SavedFilterTokens)
if diag.HasError() {
@@ -193,11 +268,18 @@ func (r CostReportResource) Update(ctx context.Context, req resource.UpdateReque
params := costsv2.NewUpdateCostReportParams()
params.WithCostReportToken(data.Token.ValueString())
model := &modelsv2.UpdateCostReport{
- FolderToken: data.FolderToken.ValueString(),
- Title: data.Title.ValueString(),
- Filter: data.Filter.ValueString(),
- SavedFilterTokens: fromStringsValue(sft),
- Groupings: data.Groupings.ValueString(),
+ FolderToken: data.FolderToken.ValueString(),
+ Title: data.Title.ValueString(),
+ Filter: data.Filter.ValueString(),
+ SavedFilterTokens: fromStringsValue(sft),
+ Groupings: data.Groupings.ValueString(),
+ StartDate: data.StartDate.ValueString(),
+ EndDate: data.EndDate.ValueString(),
+ PreviousPeriodStartDate: data.PreviousPeriodStartDate.ValueString(),
+ PreviousPeriodEndDate: data.PreviousPeriodEndDate.ValueString(),
+ DateInterval: data.DateInterval.ValueString(),
+ ChartType: data.ChartType.ValueStringPointer(),
+ DateBin: data.DateBin.ValueStringPointer(),
}
params.WithUpdateCostReport(model)
out, err := r.client.V2.Costs.UpdateCostReport(params, r.client.Auth)
@@ -211,6 +293,13 @@ func (r CostReportResource) Update(ctx context.Context, req resource.UpdateReque
data.Filter = types.StringValue(out.Payload.Filter)
data.Groupings = types.StringValue(out.Payload.Groupings)
data.WorkspaceToken = types.StringValue(out.Payload.WorkspaceToken)
+ data.StartDate = types.StringValue(out.Payload.StartDate)
+ data.EndDate = types.StringValue(out.Payload.EndDate)
+ data.PreviousPeriodStartDate = types.StringValue(out.Payload.PreviousPeriodStartDate)
+ data.PreviousPeriodEndDate = types.StringValue(out.Payload.PreviousPeriodEndDate)
+ data.DateInterval = types.StringValue(out.Payload.DateInterval)
+ data.ChartType = types.StringValue(out.Payload.ChartType)
+ data.DateBin = types.StringValue(out.Payload.DateBin)
savedFilterTokensValue, diag := types.ListValueFrom(ctx, types.StringType, out.Payload.SavedFilterTokens)
if diag.HasError() {
resp.Diagnostics.Append(diag...)
diff --git a/vantage/cost_reports_data_source.go b/vantage/cost_reports_data_source.go
index 8b33a4f..f1332f6 100644
--- a/vantage/cost_reports_data_source.go
+++ b/vantage/cost_reports_data_source.go
@@ -23,13 +23,20 @@ type costReportsDataSource struct {
}
type costReportDataSourceModel struct {
- Token types.String `tfsdk:"token"`
- Title types.String `tfsdk:"title"`
- Filter types.String `tfsdk:"filter"`
- FolderToken types.String `tfsdk:"folder_token"`
- WorkspaceToken types.String `tfsdk:"workspace_token"`
- SavedFilterTokens types.List `tfsdk:"saved_filter_tokens"`
- Groupings types.String `tfsdk:"groupings"`
+ Token types.String `tfsdk:"token"`
+ Title types.String `tfsdk:"title"`
+ Filter types.String `tfsdk:"filter"`
+ FolderToken types.String `tfsdk:"folder_token"`
+ WorkspaceToken types.String `tfsdk:"workspace_token"`
+ SavedFilterTokens types.List `tfsdk:"saved_filter_tokens"`
+ Groupings types.String `tfsdk:"groupings"`
+ StartDate types.String `tfsdk:"start_date"`
+ EndDate types.String `tfsdk:"end_date"`
+ PreviousPeriodStartDate types.String `tfsdk:"previous_period_start_date"`
+ PreviousPeriodEndDate types.String `tfsdk:"previous_period_end_date"`
+ DateInterval types.String `tfsdk:"date_interval"`
+ ChartType types.String `tfsdk:"chart_type"`
+ DateBin types.String `tfsdk:"date_bin"`
}
type costReportsDataSourceModel struct {
@@ -68,6 +75,27 @@ func (d *costReportsDataSource) Schema(_ context.Context, _ datasource.SchemaReq
"groupings": schema.StringAttribute{
Computed: true,
},
+ "start_date": schema.StringAttribute{
+ Computed: true,
+ },
+ "end_date": schema.StringAttribute{
+ Computed: true,
+ },
+ "previous_period_start_date": schema.StringAttribute{
+ Computed: true,
+ },
+ "previous_period_end_date": schema.StringAttribute{
+ Computed: true,
+ },
+ "date_interval": schema.StringAttribute{
+ Computed: true,
+ },
+ "chart_type": schema.StringAttribute{
+ Computed: true,
+ },
+ "date_bin": schema.StringAttribute{
+ Computed: true,
+ },
},
},
Computed: true,
@@ -100,13 +128,20 @@ func (d *costReportsDataSource) Read(ctx context.Context, req datasource.ReadReq
return
}
costReports = append(costReports, costReportDataSourceModel{
- Title: types.StringValue(r.Title),
- Token: types.StringValue(r.Token),
- Filter: types.StringValue(r.Filter),
- FolderToken: types.StringValue(r.FolderToken),
- WorkspaceToken: types.StringValue(r.WorkspaceToken),
- SavedFilterTokens: savedFilterTokens,
- Groupings: types.StringValue(r.Groupings),
+ Title: types.StringValue(r.Title),
+ Token: types.StringValue(r.Token),
+ Filter: types.StringValue(r.Filter),
+ FolderToken: types.StringValue(r.FolderToken),
+ WorkspaceToken: types.StringValue(r.WorkspaceToken),
+ SavedFilterTokens: savedFilterTokens,
+ Groupings: types.StringValue(r.Groupings),
+ StartDate: types.StringValue(r.StartDate),
+ EndDate: types.StringValue(r.EndDate),
+ PreviousPeriodStartDate: types.StringValue(r.PreviousPeriodStartDate),
+ PreviousPeriodEndDate: types.StringValue(r.PreviousPeriodEndDate),
+ DateInterval: types.StringValue(r.DateInterval),
+ ChartType: types.StringValue(r.ChartType),
+ DateBin: types.StringValue(r.DateBin),
})
}
state.CostReports = costReports
diff --git a/vantage/virtual_tag_config_resource_model.go b/vantage/virtual_tag_config_resource_model.go
index 5aad2eb..3535802 100644
--- a/vantage/virtual_tag_config_resource_model.go
+++ b/vantage/virtual_tag_config_resource_model.go
@@ -77,8 +77,8 @@ func (m *VirtualTagConfigResourceModel) toCreate(ctx context.Context, diags *dia
values := make([]*modelsv2.CreateVirtualTagConfigValuesItems0, 0, len(tfValues))
for _, v := range tfValues {
value := &modelsv2.CreateVirtualTagConfigValuesItems0{
- Name: v.Name.ValueStringPointer(),
- Filter: v.Filter.ValueString(),
+ Name: v.Name.ValueString(),
+ Filter: v.Filter.ValueStringPointer(),
}
values = append(values, value)
}
@@ -120,8 +120,8 @@ func (m *VirtualTagConfigResourceModel) toUpdate(ctx context.Context, diags *dia
values := make([]*modelsv2.UpdateVirtualTagConfigValuesItems0, 0, len(tfValues))
for _, v := range tfValues {
value := &modelsv2.UpdateVirtualTagConfigValuesItems0{
- Name: v.Name.ValueStringPointer(),
- Filter: v.Filter.ValueString(),
+ Name: v.Name.ValueString(),
+ Filter: v.Filter.ValueStringPointer(),
}
values = append(values, value)
}