google-api-typings-generator icon indicating copy to clipboard operation
google-api-typings-generator copied to clipboard

Add support for enums

Open Maxim-Mazurok opened this issue 1 year ago • 0 comments

For example, valueRenderOption from https://sheets.googleapis.com/$discovery/rest?version=v4

"valueRenderOption": {
  "enum": [
    "FORMATTED_VALUE",
    "UNFORMATTED_VALUE",
    "FORMULA"
  ],
  "description": "How values should be represented in the output. The default render option is ValueRenderOption.FORMATTED_VALUE.",
  "enumDescriptions": [
    "Values will be calculated & formatted in the reply according to the cell's formatting. Formatting is based on the spreadsheet's locale, not the requesting user's locale. For example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency, then `A2` would return `\"$1.23\"`.",
    "Values will be calculated, but not formatted in the reply. For example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency, then `A2` would return the number `1.23`.",
    "Values will not be calculated. The reply will include the formulas. For example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency, then A2 would return `\"=A1\"`."
  ],
  "location": "query",
  "type": "string"
}

All I'm getting is this:

/**
 * How values should be represented in the output. The default render option is FORMATTED_VALUE.
 */
valueRenderOption?: string;

Instead, I want to either have a proper enum declared somewhere, or at least union type.

Maxim-Mazurok avatar Dec 29 '22 09:12 Maxim-Mazurok