Just wanted to report an error on the Collections page in the documentation.
For Unity/.NET this is the example given for reading a Storage object:
var result = await client.ReadStorageObjectsAsync(session, new StorageObjectId {
Collection = "saves",
Key = "savegame",
UserId = session.UserId
});
Console.WriteLine("Read objects: [{0}]", string.Join(",\n ", result.Objects));
But the latest version of the SDK doesn’t have a constructor for ReadStorageObjectsAsync which takes a single IApiReadStorageObjectId.
So it’s either an error in the documentation, or an oversight in the actual SDK. I believe there should be an option in the SDK to READ just one object instead of having to create an IEnumerable of IApiReadStorageObjectId with a single object every time you only want to read one.
This is actually the case for DeleteStorageObjectsAsync and WriteStorageObjectsAsync as well!
Thanks for reporting the issue @Antviss. I can confirm that the documentation is indeed incorrect and those functions do take an array. We will get this fixed in our documentation ASAP.
@Fauman Just to clarify, our documentation is kept up to date with each new release of our products and is regularly updated with additional guides and content outside of those release cadences.
@Fauman No problem, I have just checked our documentation and can confirm that this particular issue was resolved at the time (June 9th 2022 specifically).
Please can you confirm the actual documentation issue you are having?
Ahh I understand. Thank you for pointing that out, I have updated the documentation and you should see the changes reflect on the live docs site in the next few hours.
In the meantime, you can replace this line:
var result = await client.ReadStorageObjectsAsync(session, readObjectId);
With this:
var result = await client.ReadStorageObjectsAsync(session, new [] { readObjectId });