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

Fix: env0_cost_credentials_project_assignment not working #369

Merged
merged 1 commit into from
May 9, 2022

Conversation

TomerHeber
Copy link
Collaborator

Issue & Steps to Reproduce / Feature Request

fixes #366

Solution

The body argument was incorrect.
The URL path was incorrect.
Added an integration test.

@@ -9,7 +9,9 @@ type CostCredentialProjectAssignment struct {
func (client *ApiClient) AssignCostCredentialsToProject(projectId string, credentialId string) (CostCredentialProjectAssignment, error) {
var result CostCredentialProjectAssignment

err := client.http.Put("/costs/project/"+projectId+"/credentials", credentialId, &result)
err := client.http.Put("/costs/project/"+projectId+"/credentials", map[string]string{
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

body passed was incorrect.

@@ -22,7 +24,7 @@ func (client *ApiClient) RemoveCostCredentialsFromProject(projectId string, cred

func (client *ApiClient) CostCredentialIdsInProject(projectId string) ([]CostCredentialProjectAssignment, error) {
var result []CostCredentialProjectAssignment
err := client.http.Get("/costs/project/"+projectId, nil, &result)
err := client.http.Get("/costs/project/"+projectId+"/credentials", nil, &result)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

url path was incorrect.

@@ -0,0 +1,23 @@
provider "random" {}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added an integration test to avoid issues moving forward.

@TomerHeber TomerHeber requested a review from yaronya May 9, 2022 14:36
Copy link
Contributor

@sagilaufer1992 sagilaufer1992 left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added ready to merge PR approved - can be merged once the PR owner is ready and removed pending final review labels May 9, 2022
@TomerHeber TomerHeber merged commit ca47ac8 into main May 9, 2022
@TomerHeber TomerHeber deleted the fix-env0_cost_credentials_project_assignment-#366 branch May 9, 2022 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-client fix integration-tests ready to merge PR approved - can be merged once the PR owner is ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

env0_cost_credentials_project_assignment Not Working - "Bad Request: /body must be object"
2 participants