-
Notifications
You must be signed in to change notification settings - Fork 4
CUT-2378: -Attribues Object needs custom type #69
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think everything looks fine to me, Just two suggestions on the examples, if you remove associations from on object you technically don't need to pass in an attributes object. I think we should mark our examples this way but open for debate
SDKs/PowerShell/JumpCloud.SDK.V2/custom/generated/Set-JcSdkSystemAssociation.ps1
Outdated
Show resolved
Hide resolved
SDKs/PowerShell/JumpCloud.SDK.V2/custom/generated/Set-JcSdkSystemAssociation.ps1
Show resolved
Hide resolved
SDKs/PowerShell/JumpCloud.SDK.V2/custom/generated/Set-JcSdkUserAssociation.ps1
Outdated
Show resolved
Hide resolved
SDKs/PowerShell/JumpCloud.SDK.V2/custom/generated/Set-JcSdkUserAssociation.ps1
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the examples!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests worked and code looks good. Great work
Issues
What does this solve?
Through some discovery it was determined that the -Attributes object is being flattened by the SDKs and does not necessarily need a custom type.
As an example the following script would set sudo to enabled and withoutPassword to false
We can achieve the same result by doing the following:
This is due to the SDKs doing a sort of flattening to the sudo object and allowing us to instead call the sudoEnabled or SudoWithoutPassword property to set those values.
Rather than creating a custom object, we can update the documentation for this functionality
This behavior can also be applied to the
Set-JcSdkUserAssociation
functionIs there anything particularly tricky?
N/A
How should this be tested?
Pull the branch and import the updated version of the V2 SDK
Attempt to run the following script and ensure that the results are updated in the console: