-
Notifications
You must be signed in to change notification settings - Fork 67
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
Add Support for UserRelations #129
Comments
Looking for some ideas on how to implement the deletion of relations. To remove a relation via the HTTP API, a PUT of an empty JSON array is required:
|
@mattwoolnough - I believe I implemented something on another function for a similar purpose, let me try and dig it out. IIRC, you need to set the value as an empty generic list if the parameter is used in |
Sorry, to delete the JSON below is required. Did you happen to find the code you were thinking of?
|
@mattwoolnough - still hunting for it, but I know that the .NET SDK regards sending |
have you tried just sending |
disregard, just tested and that didn't do anything (at least for |
Alright, found the bit of code that I was thinking of similar to removing values: Did some testing based on this and the following works (although is does leave a null reference for the Relation value when pulling the user information via API): Before (view from Admin console and view from After: Update-GSUser -User $user.PrimaryEmail -Relations (Add-GSUserRelation -Type manager -Value $null) |
alright, that's going to be the only applicable approach for clearing the value of a single relation/phone/etc. I've looked at your code in your PR for Example in use: Update-GSUser -User $user.PrimaryEmail -Relations $null |
## 2.21.0 * [PR #130](#130) / [Issue #129](#129) * Added: Support for UserRelations management in `New-GSUser -Relations $relations` and `Update-GSUser -Relations $relations` via `Add-GSUserRelation` helper function. - _Thanks, [@mattwoolnough](https://github.com/mattwoolnough)!_ * Added: Logic to `Update-GSUser` to enable clearing of all values for user properties `Phones`, `ExternalIds`, `Organizations`, and `Relations` by REST API call via passing `$null` as the value when calling `Update-GSUser`. - _Thanks, [@mattwoolnough](https://github.com/mattwoolnough)!_ * [Issue #129](#129) * Fixed: Documentation for `Get-GSSheetInfo` around the `Fields` parameter. * Added: Additional correction of casing for `Fields` values in `Get-GSSheetInfo` so that it will always submit the values using the correct case, even if providing the incorrect case as the value to the parameter.
@mattwoolnough - Thanks for the contributions around this! UserRelation support is out now in v2.21.0. I've also included the updated logic for clearing out Let me know if you have any questions regarding this! |
Add Support for UserRelation
https://developers.google.com/resources/api-libraries/documentation/admin/directory_v1/java/latest/com/google/api/services/admin/directory/model/class-use/UserRelation.html
The text was updated successfully, but these errors were encountered: