Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Budgets Resource and Data Source #47

Merged
merged 2 commits into from
Apr 16, 2024
Merged

Budgets Resource and Data Source #47

merged 2 commits into from
Apr 16, 2024

Conversation

whereandy
Copy link
Contributor

No description provided.

@whereandy whereandy changed the title Andy/budgets Budgets Resource and Data Source Apr 16, 2024
@whereandy whereandy marked this pull request as ready for review April 16, 2024 19:11
cost_report_token = vantage_cost_report.demo_report.token
periods = [
{
start_at = "2023-12-01"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The format for the dates is YYYY-MM-DD, not ISO-8601.

return dst
}

func applyBudgetPayload(ctx context.Context, isDataSource bool, src *modelsv2.Budget, dst *budgetModel) diag.Diagnostics {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@conner n.b., unlike what you did, the model is not the receiver of this function, because i'm using the autogenerated model, (budgetModel is a resource_budget.BudgetModel) and can't attach methods to it.

// both the data source and the resource
type budgetModel resource_budget.BudgetModel
type budgetPerformanceModel resource_budget.PerformanceValue
type budgetPeriodResourceModel struct {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i hate that we need separate ways to describe the period depending on whether it is for a data source or a resource, but cant find a better workaround for this.

@whereandy whereandy requested a review from conner April 16, 2024 19:18
Copy link
Contributor

@conner conner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a comment to 🧹, but lgtm. ship it

}

if src.Periods != nil {
// var l types.List
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹

needs tests.

bump vantage-go

examples

tf fmt

cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants