Closed prat0088 closed 7 years ago
My problem was that I was using GTLRSheets_Sheet instead of GTLRSheets_Spreadsheet. It makes sense as that is the prefix of the query.
The generated docs usually include what the result object should be; so for GTLRSheetsQuery_SpreadsheetsGet
, https://github.com/google/google-api-objectivec-client-for-rest/blob/master/Source/GeneratedServices/Sheets/GTLRSheetsQuery.h#L242-L266 says it should be GTLRSheets_Spreadsheet
.
Since ObjC does't have nested naming like Swift, the names end up having to be merged chunks into a single name. So the service you are talking to is Sheets (hence the GTLRSheetsQuery
name on the front), the actually query is SpreadsheetsGet, which is sorta the "hint" that the result is a Spreadsheet object of some kind. The generated docs will have the info when the discovery document provides the details.
PS - in they link, the first part of the comment:
Fetches a @c GTLRSheets_Spreadsheet.
Is what calls out what will come back from executeQuery
.
I have the following code that queries metadata about a spreadsheet
The output is
error is nil.
How can I determine the object type of "result" for a given query? I didn't see any reference or instruction in the documentation. I Just want to get the name of the document and names and IDs of any sheets it contains.
I was calling the Google Sheets v4 REST API directly. Although it takes a bit more code, the API is very well documented and I never got stuck. I'm attempting to use this wrapper because it would mean less code once I figure out how to use it.