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

Issue updating Resource ID using Update-GSResource #239

Closed
cmason34 opened this issue Oct 4, 2019 · 2 comments
Closed

Issue updating Resource ID using Update-GSResource #239

cmason34 opened this issue Oct 4, 2019 · 2 comments
Assignees
Labels

Comments

@cmason34
Copy link

cmason34 commented Oct 4, 2019

We are working on creating new resources as well as updating existing ones. We want to change the id on some of our resources and am trying your example "Update-GSResource -ResourceId Train01 -Id TrainingRoom01" using our test resource and it is returning an error. We are able to update the capacity successfully using the same ResourceId, but get a "resource not found" error when we try to do -id.

@scrthq scrthq self-assigned this Oct 5, 2019
@scrthq scrthq added the bug label Oct 5, 2019
@scrthq
Copy link
Member

scrthq commented Oct 5, 2019

Alright, so did some digging @cmason34 - The Id parameter there is a convenience parameter for Calendar Resources that I added on the Update function since it was being returned when using Get. The confusion on my end was that I'm adding that property to the returned object on the Get function, so it doesn't actually exist. On the Update function, what happens is it first sets the ResourceId to the value set for that parameter (which would be the actual ResourceId of the resource), then the additional pass of a value for Id overwrites that with an expectedly non-existent ResourceId, resulting in failure to find the Resource.

Checking Google's REST documentation here, you can see that...

  1. There is no property on the object named Id
  2. The resourceId property is actually not writable, meaning that once set, you can't change it from what I can tell.

I'm going to remove the additional Id parameter to avoid confusion and subsequent failures. Thank you for bringing this to my attention!

Let me know if you have any questions regarding this!!

scrthq added a commit that referenced this issue Oct 6, 2019
## 2.33.1 - 2019-10-06

* [Issue #235](#235)
    * Removed: `Name` parameter from `Start-GSDriveFileUpload` as it was unused in the function and doesnt make sense when uploading an array of files.
* [Issue #238](#238)
    * Added: `Get-GSDataTransfer` to Get/List current Data Transfers
* [Issue #239](#239)
    * Removed: `Update-GSResource` `Id` parameter as it was non-applicable (duplicate of `ResourceId` and not writable per API docs)
    * Cleaned up function help and examples to match changes
* [Issue #240](#240)
    * Fixed: `Get-GSCalendar` now properly resolves single calendar metadata retrieval and passes List requests to `Get-GSCalendarSubscription` since the `Calendars` service does not support List requests.
* Miscellaneous
    * Updated Google .NET SDKs to latest versions
    * Cleaned up build.ps1 script
scrthq added a commit that referenced this issue Oct 6, 2019
## 2.33.1 - 2019-10-06

* [Issue #235](#235)
    * Removed: `Name` parameter from `Start-GSDriveFileUpload` as it was unused in the function and doesnt make sense when uploading an array of files.
* [Issue #238](#238)
    * Added: `Get-GSDataTransfer` to Get/List current Data Transfers
* [Issue #239](#239)
    * Removed: `Update-GSResource` `Id` parameter as it was non-applicable (duplicate of `ResourceId` and not writable per API docs)
    * Cleaned up function help and examples to match changes
* [Issue #240](#240)
    * Fixed: `Get-GSCalendar` now properly resolves single calendar metadata retrieval and passes List requests to `Get-GSCalendarSubscription` since the `Calendars` service does not support List requests.
* Miscellaneous
    * Updated Google .NET SDKs to latest versions
    * Cleaned up build.ps1 script
@scrthq
Copy link
Member

scrthq commented Oct 7, 2019

hey @cmason34 - Updates have been deployed that remove the Id parameter as mentioned to avoid confusion! Docs also updated with a working example.

@scrthq scrthq closed this as completed Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants