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

Feat: add API calls for configuration set #853

Merged
merged 4 commits into from
May 21, 2024
Merged

Conversation

TomerHeber
Copy link
Collaborator

Solution

Part of #829

  1. Added the API calls required for configuration set.
  2. Added unit tests for configuration set.

Copy link
Contributor

@GiliFaroEnv0 GiliFaroEnv0 left a comment

Choose a reason for hiding this comment

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

Left 1 comment which is a must the rest is recommendations
Do you plan to add the assignment/unassignment API in a separate PR?

client/configuration_set_test.go Show resolved Hide resolved

if err := client.http.Get("/configuration", map[string]string{
"setId": setId,
"organizationId": organizationId,
Copy link
Contributor

Choose a reason for hiding this comment

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

don't send the organizationId it will return both the variables of the set and the organization...
You should send only the setId

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

got it! thanks!

Comment on lines 50 to 69
func (client *ApiClient) ConfigurationSets(scope string, scopeId string) ([]ConfigurationSet, error) {
var result []ConfigurationSet
var err error

if scope == "organization" {
scopeId, err = client.OrganizationId()
if err != nil {
return nil, err
}
}

if err := client.http.Get("/configuration-sets", map[string]string{
"scope": scope,
"scopeId": scopeId,
"includeHigherScopes": "false",
}, &result); err != nil {
return nil, err
}

return result, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure why you need this API...
In the FE we want to list the sets
do you plan to add all_sets data ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure I can remove it for now.

}

type ConfigurationSet struct {
Id string `json:"id"`
Copy link
Contributor

Choose a reason for hiding this comment

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

the return also contain the name and the description

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes I know. Not really needed. But I'll add it.

@TomerHeber
Copy link
Collaborator Author

Left 1 comment which is a must the rest is recommendations Do you plan to add the assignment/unassignment API in a separate PR?

yes.

@TomerHeber TomerHeber requested a review from GiliFaroEnv0 May 21, 2024 14:18
Copy link
Contributor

@GiliFaroEnv0 GiliFaroEnv0 left a comment

Choose a reason for hiding this comment

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

NICE work as always

@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 21, 2024
@TomerHeber TomerHeber merged commit 7314bd3 into main May 21, 2024
3 of 4 checks passed
@TomerHeber TomerHeber deleted the feat-con-set-api-#829 branch May 21, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-client feature 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.

2 participants