@looker/sdk-codegen 21.11.1 → 21.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/lib/codeGen.d.ts +2 -1
  3. package/lib/codeGen.js +14 -9
  4. package/lib/codeGen.js.map +1 -1
  5. package/lib/codeGenerators.js.map +1 -1
  6. package/lib/csharp.gen.d.ts +5 -0
  7. package/lib/csharp.gen.js +21 -4
  8. package/lib/csharp.gen.js.map +1 -1
  9. package/lib/declarationInfo.js.map +1 -1
  10. package/lib/esm/codeGen.js +15 -9
  11. package/lib/esm/codeGen.js.map +1 -1
  12. package/lib/esm/codeGenerators.js.map +1 -1
  13. package/lib/esm/csharp.gen.js +21 -4
  14. package/lib/esm/csharp.gen.js.map +1 -1
  15. package/lib/esm/declarationInfo.js.map +1 -1
  16. package/lib/esm/exampleInfo.js.map +1 -1
  17. package/lib/esm/go.gen.js +19 -5
  18. package/lib/esm/go.gen.js.map +1 -1
  19. package/lib/esm/index.js.map +1 -1
  20. package/lib/esm/kotlin.gen.js +10 -5
  21. package/lib/esm/kotlin.gen.js.map +1 -1
  22. package/lib/esm/pseudo.gen.js +2 -2
  23. package/lib/esm/pseudo.gen.js.map +1 -1
  24. package/lib/esm/python.gen.js +17 -6
  25. package/lib/esm/python.gen.js.map +1 -1
  26. package/lib/esm/sdkModels.js +37 -36
  27. package/lib/esm/sdkModels.js.map +1 -1
  28. package/lib/esm/specConverter.js +10 -10
  29. package/lib/esm/specConverter.js.map +1 -1
  30. package/lib/esm/specDiff.js.map +1 -1
  31. package/lib/esm/swift.gen.js +13 -6
  32. package/lib/esm/swift.gen.js.map +1 -1
  33. package/lib/esm/typescript.gen.js +17 -4
  34. package/lib/esm/typescript.gen.js.map +1 -1
  35. package/lib/exampleInfo.js.map +1 -1
  36. package/lib/go.gen.d.ts +5 -0
  37. package/lib/go.gen.js +19 -5
  38. package/lib/go.gen.js.map +1 -1
  39. package/lib/index.js.map +1 -1
  40. package/lib/kotlin.gen.d.ts +2 -1
  41. package/lib/kotlin.gen.js +10 -5
  42. package/lib/kotlin.gen.js.map +1 -1
  43. package/lib/pseudo.gen.js +2 -2
  44. package/lib/pseudo.gen.js.map +1 -1
  45. package/lib/python.gen.d.ts +5 -0
  46. package/lib/python.gen.js +17 -6
  47. package/lib/python.gen.js.map +1 -1
  48. package/lib/sdkModels.js +38 -39
  49. package/lib/sdkModels.js.map +1 -1
  50. package/lib/specConverter.js +11 -11
  51. package/lib/specConverter.js.map +1 -1
  52. package/lib/specDiff.js.map +1 -1
  53. package/lib/swift.gen.js +13 -6
  54. package/lib/swift.gen.js.map +1 -1
  55. package/lib/typescript.gen.d.ts +5 -0
  56. package/lib/typescript.gen.js +17 -4
  57. package/lib/typescript.gen.js.map +1 -1
  58. package/package.json +4 -4
package/lib/python.gen.js CHANGED
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.PythonGen = void 0;
7
7
  var _sdkModels = require("./sdkModels");
8
8
  var _codeGen = require("./codeGen");
9
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
10
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
9
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
10
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
11
11
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12
12
  class PythonGen extends _codeGen.CodeGen {
13
13
  constructor() {
@@ -35,7 +35,7 @@ class PythonGen extends _codeGen.CodeGen {
35
35
  _defineProperty(this, "hooks", []);
36
36
  _defineProperty(this, "structureHookTK", 'translate_keys_structure_hook');
37
37
  _defineProperty(this, "pythonReservedKeywordClasses", new Set());
38
- _defineProperty(this, "methodsPrologue", _indent => "\n# ".concat(this.warnEditing(), "\nimport datetime\nfrom typing import Any, MutableMapping, Optional, Sequence, Union, cast\nimport warnings\n\nfrom . import models as mdls\nfrom ").concat(this.packagePath, ".rtl import api_methods\nfrom ").concat(this.packagePath, ".rtl import transport\n\nclass ").concat(this.packageName, "(api_methods.APIMethods):\n"));
38
+ _defineProperty(this, "methodsPrologue", _indent => "\n# ".concat(this.warnEditing(), "\nimport datetime\nfrom typing import Any, MutableMapping, Optional, Sequence, Union, cast\nimport warnings\n\nfrom . import models as mdls\nfrom ").concat(this.packagePath, ".rtl import api_methods\nfrom ").concat(this.packagePath, ".rtl import model\nfrom ").concat(this.packagePath, ".rtl import transport\n\nclass ").concat(this.packageName, "(api_methods.APIMethods):\n"));
39
39
  _defineProperty(this, "methodsEpilogue", _indent => this.apiVersion === '4.0' ? "LookerSDK = ".concat(this.packageName) : '');
40
40
  _defineProperty(this, "modelsPrologue", _indent => "\n# ".concat(this.warnEditing(), "\nimport datetime\nimport enum\nfrom typing import Any, MutableMapping, Optional, Sequence\n\ntry:\n from typing import ForwardRef # type: ignore\nexcept ImportError:\n from typing import _ForwardRef as ForwardRef # type: ignore\n\nimport attr\n\nfrom ").concat(this.packagePath, ".rtl import model\nfrom ").concat(this.packagePath, ".rtl import serialize as sr\n\nEXPLICIT_NULL = model.EXPLICIT_NULL # type: ignore\nDelimSequence = model.DelimSequence\n"));
41
41
  _defineProperty(this, "modelsEpilogue", _indent => "\nimport functools # noqa:E402\n\nforward_ref_structure_hook = functools.partial(\n sr.forward_ref_structure_hook, globals(), sr.converter".concat(this.apiRef, "\n)\nsr.converter").concat(this.apiRef, ".register_structure_hook_func(\n lambda t: t.__class__ is ForwardRef, forward_ref_structure_hook\n)\n").concat(this.structureHookTK, " = functools.partial(sr.translate_keys_structure_hook, sr.converter").concat(this.apiRef, ")\n").concat(this.hooks.join('\n'), "\n"));
@@ -197,11 +197,11 @@ class PythonGen extends _codeGen.CodeGen {
197
197
  }
198
198
  httpArgs(callerIndent, method) {
199
199
  var currIndent = this.bumper(callerIndent);
200
- var args = '';
201
- args = this.argFill(args, "".concat(currIndent, "transport_options=transport_options"));
202
200
  var body = method.bodyArg ? method.bodyArg : this.nullStr;
203
201
  var query = method.queryArgs.length ? this.argGroup('', method.queryArgs) : this.nullStr;
204
- var formArgs = this.assignFormArgs(method, body, query);
202
+ var formArgs = this.assignFormArgs(method, body, query, 'transport_options');
203
+ var args = '';
204
+ args = this.argFill(args, "".concat(currIndent, "transport_options=").concat(formArgs.options));
205
205
  if (formArgs.body !== this.nullStr) {
206
206
  args = this.argFill(args, "".concat(currIndent, "body=").concat(formArgs.body));
207
207
  }
@@ -244,6 +244,17 @@ class PythonGen extends _codeGen.CodeGen {
244
244
  }
245
245
  return encodings;
246
246
  }
247
+ assignFormArgs(method, body, query, options) {
248
+ if (method.isFormUrlEncoded) {
249
+ body = "model.URLSearchParams(".concat(query, ")");
250
+ query = this.nullStr;
251
+ }
252
+ return {
253
+ body,
254
+ query,
255
+ options
256
+ };
257
+ }
247
258
  declareMethod(indent, method) {
248
259
  var bump = this.bumper(indent);
249
260
  return this.methodSignature(indent, method) + this.summary(bump, method.summary) + this.encodePathParams(bump, method) + this.httpCall(bump, method);
@@ -1 +1 @@
1
- {"version":3,"file":"python.gen.js","names":["_sdkModels","require","_codeGen","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","PythonGen","CodeGen","constructor","arguments","concat","indentStr","repeat","Set","_indent","warnEditing","packagePath","packageName","apiVersion","apiRef","structureHookTK","hooks","join","prop","required","type","customType","EnumType","includes","className","sdkFileName","baseFileName","fileName","argGroup","args","length","nullStr","hash","arg","push","dataStructureDelimiter","beginRegion","indent","description","endRegion","_description","declareProperty","property","annotations","undefined","mappedType","typeMapModels","propName","name","pythonKeywords","has","propType","propDef","annotation","isBareForwardRef","bumper","methodReturnType","method","typeMapMethods","returnType","responseIsBoth","responseIsBinary","methodSignature","_method$description","bump","params","allParams","forEach","p","declareParameter","head","trim","httpMethod","endpoint","commentHeader","paramDelimiter","param","location","strBody","writeableType","mapped","paramType","describeParam","default","makeTheCall","inputs","origDelim","argDelimiter","resp","assignParams","match","initArg","declareType","decl","invalid","typeProperties","values","requiredProperties","optionalProperties","construct","inits","declareConstructorArg","result","properties","some","argFill","current","delimiter","replace","httpArgs","callerIndent","currIndent","body","bodyArg","query","queryArgs","formArgs","assignFormArgs","test","httpCall","deprecation","callOpener","it","toLowerCase","callArgs","callCloser","returnStmt","encodePathParams","encodings","pathParams","doEncode","declareMethod","summary","typeSignature","b2","attrs","isEnum","baseClass","usesReservedPythonKeyword","attr","text","prefixModelsNamespace","format","forwardRef","typeMap","asString","_","v","pythonTypes","any","boolean","byte","date","datetime","double","float","int32","int64","integer","number","password","asVal","string","object","uri","void","elementType","map","typeName","defaultValue","Error","JSON","stringify","mt","exports"],"sources":["../src/python.gen.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { ArgValues } from '@looker/sdk-rtl';\nimport type { Arg, IMethod, IParameter, IProperty, IType } from './sdkModels';\nimport { EnumType, describeParam, strBody } from './sdkModels';\nimport type { CodeAssignment, IMappedType } from './codeGen';\nimport { CodeGen } from './codeGen';\n\nexport class PythonGen extends CodeGen {\n codePath = './python/';\n packagePath = 'looker_sdk';\n itself = 'self';\n fileExtension = '.py';\n commentStr = '# ';\n nullStr = 'None';\n\n indentStr = ' ';\n argDelimiter = `,\\n${this.indentStr.repeat(3)}`;\n argSetSep = '=';\n paramDelimiter = ',\\n';\n propDelimiter = '\\n';\n dataStructureDelimiter = ', ';\n enumDelimiter = '\\n';\n codeQuote = '\"';\n typeOpen = '(';\n typeClose = ')';\n hashKeyQuote = '\"';\n useModelClassForTypes = true;\n\n endTypeStr = '';\n\n // keyword.kwlist\n pythonKeywords = new Set<string>([\n 'False',\n 'None',\n 'True',\n 'and',\n 'as',\n 'assert',\n 'async',\n 'await',\n 'break',\n 'class',\n 'continue',\n 'def',\n 'del',\n 'elif',\n 'else',\n 'except',\n 'finally',\n 'for',\n 'from',\n 'global',\n 'if',\n 'import',\n 'in',\n 'is',\n 'lambda',\n 'nonlocal',\n 'not',\n 'or',\n 'pass',\n 'raise',\n 'return',\n 'try',\n 'while',\n 'with',\n 'yield',\n ]);\n\n // cattrs [un]structure hooks for model [de]serialization\n hooks: string[] = [];\n structureHookTK = 'translate_keys_structure_hook';\n pythonReservedKeywordClasses: Set<string> = new Set();\n\n methodsPrologue = (_indent: string) => `\n# ${this.warnEditing()}\nimport datetime\nfrom typing import Any, MutableMapping, Optional, Sequence, Union, cast\nimport warnings\n\nfrom . import models as mdls\nfrom ${this.packagePath}.rtl import api_methods\nfrom ${this.packagePath}.rtl import transport\n\nclass ${this.packageName}(api_methods.APIMethods):\n`;\n\n methodsEpilogue = (_indent: string) =>\n this.apiVersion === '4.0' ? `LookerSDK = ${this.packageName}` : '';\n\n modelsPrologue = (_indent: string) => `\n# ${this.warnEditing()}\nimport datetime\nimport enum\nfrom typing import Any, MutableMapping, Optional, Sequence\n\ntry:\n from typing import ForwardRef # type: ignore\nexcept ImportError:\n from typing import _ForwardRef as ForwardRef # type: ignore\n\nimport attr\n\nfrom ${this.packagePath}.rtl import model\nfrom ${this.packagePath}.rtl import serialize as sr\n\nEXPLICIT_NULL = model.EXPLICIT_NULL # type: ignore\nDelimSequence = model.DelimSequence\n`;\n\n modelsEpilogue = (_indent: string) => `\nimport functools # noqa:E402\n\nforward_ref_structure_hook = functools.partial(\n sr.forward_ref_structure_hook, globals(), sr.converter${this.apiRef}\n)\nsr.converter${this.apiRef}.register_structure_hook_func(\n lambda t: t.__class__ is ForwardRef, forward_ref_structure_hook\n)\n${\n this.structureHookTK\n} = functools.partial(sr.translate_keys_structure_hook, sr.converter${\n this.apiRef\n })\n${this.hooks.join('\\n')}\n`;\n\n sdkFileName(baseFileName: string) {\n return this.fileName(`sdk/api${this.apiRef}/${baseFileName}`);\n }\n\n argGroup(_indent: string, args: Arg[]) {\n if (!args || args.length === 0) return this.nullStr;\n const hash: string[] = [];\n for (const arg of args) {\n hash.push(`\"${arg}\": ${arg}`);\n }\n return `{${hash.join(this.dataStructureDelimiter)}}`;\n }\n\n beginRegion(indent: string, description: string): string {\n // Sadly, Black reformats this to \"# region\" and IntelliJ doesn't recognize it either way\n return `${indent}#region ${description}`;\n }\n\n endRegion(indent: string, _description: string): string {\n // Sadly, Black reformats this to \"# endregion\" and IntelliJ doesn't recognize it either way\n return `${indent}#endregion`;\n }\n\n declareProperty(indent: string, property: IProperty, annotations = false) {\n const mappedType = this.typeMapModels(property.type);\n let propName = property.name;\n if (this.pythonKeywords.has(propName)) {\n propName = propName + '_';\n }\n let propType = mappedType.name;\n if (!property.required) {\n propType = `Optional[${mappedType.name}]`;\n }\n\n let propDef;\n if (annotations) {\n let annotation = propType;\n if (this.isBareForwardRef(property)) {\n annotation = `ForwardRef(${propType})`;\n }\n propDef = `${this.bumper(indent)}\"${propName}\": ${annotation}`;\n } else {\n if (!property.required) {\n propType += ` = ${this.nullStr}`;\n }\n propDef = `${indent}${propName}: ${propType}`;\n }\n return propDef;\n }\n\n private methodReturnType(method: IMethod) {\n const type = this.typeMapMethods(method.type);\n let returnType = type.name;\n if (method.responseIsBoth()) {\n returnType = `Union[${returnType}, bytes]`;\n } else if (method.responseIsBinary()) {\n returnType = 'bytes';\n }\n return returnType;\n }\n\n // because Python has named default parameters, Request types are not required like\n // they are for TypeScript\n methodSignature(indent: string, method: IMethod) {\n const returnType = this.methodReturnType(method);\n const bump = this.bumper(indent);\n const params: string[] = [];\n const args = method.allParams;\n if (args && args.length > 0) {\n method.allParams.forEach(p =>\n params.push(this.declareParameter(bump, method, p))\n );\n }\n let head = method.description?.trim();\n head =\n (head ? `${head}\\n\\n` : '') +\n `${method.httpMethod} ${method.endpoint} -> ${returnType}`;\n params.push(\n `${bump}transport_options: Optional[transport.TransportOptions] = None,`\n );\n return (\n this.commentHeader(indent, head) +\n `${indent}def ${method.name}(\\n` +\n `${bump}self${params.length > 0 ? ',\\n' : ''}` +\n `${params.join(this.paramDelimiter)}\\n` +\n `${indent}) -> ${returnType}:\\n`\n );\n }\n\n declareParameter(indent: string, method: IMethod, param: IParameter) {\n let type: IType;\n if (param.location === strBody) {\n type = this.writeableType(param.type, method) || param.type;\n } else {\n type = param.type;\n }\n const mapped = this.typeMapMethods(type);\n const paramType = param.required ? mapped.name : `Optional[${mapped.name}]`;\n return (\n this.commentHeader(indent, describeParam(param)) +\n `${indent}${param.name}: ${paramType}` +\n (param.required ? '' : ` = ${mapped.default}`)\n );\n }\n\n makeTheCall(method: IMethod, inputs: ArgValues): string {\n const origDelim = this.argDelimiter;\n this.argDelimiter = `,\\n${this.indentStr}`;\n let resp = `response = sdk.${method.name}(`;\n const args = this.assignParams(method, inputs);\n if (args.match(/\\bmdls\\b/)) {\n resp = 'from looker_sdk import models as mdls\\n\\n' + resp;\n }\n this.argDelimiter = origDelim;\n return `${resp}${args})`;\n }\n\n initArg(indent: string, property: IProperty) {\n let propName = property.name;\n if (this.pythonKeywords.has(propName)) {\n propName = propName + '_';\n }\n return `${indent}self.${propName} = ${propName}`;\n }\n\n declareType(indent: string, type: IType) {\n let decl = super.declareType(indent, type);\n if (type instanceof EnumType) {\n const invalid =\n 'invalid_api_enum_value = \"invalid_api_enum_value\"' +\n '\\n\\n\\n# https://github.com/python/mypy/issues/2427' +\n `\\n${type.name}.__new__ = model.safe_enum__new__ # type: ignore`;\n decl += `\\n${this.bumper(indent)}${invalid}`;\n }\n return decl;\n }\n\n typeProperties(type: IType) {\n return Object.values(type.requiredProperties).concat(\n Object.values(type.optionalProperties)\n );\n }\n\n private isBareForwardRef = (prop: IProperty) => {\n // contains a \"bare\" forward reference e.g. `result_format: \"ResultFormat\"`\n // so we need to emit the `__annotations__` property\n return (\n prop.required &&\n (prop.type.customType || prop.type instanceof EnumType) &&\n !['ArrayType', 'HashType', 'DelimArrayType'].includes(prop.type.className)\n );\n };\n\n /**\n * Ideally we'd rely on @attr.s to generate the constructor for us\n * However, neither Jedi (https://github.com/davidhalter/jedi-vim/issues/816)\n * nor microsoft/python-language-server\n * (https://github.com/microsoft/python-language-server/issues/399)\n * display good tooltips for these auto-generated __init__ methods. So for\n * now we'll generate them ourselves following the functionality of\n * @attr.s(kw_only=True) we'll only allow kw_args.\n */\n construct(indent: string, type: IType) {\n if (type instanceof EnumType) return '';\n indent = this.bumper(indent);\n const bump = this.bumper(indent);\n const annotations: string[] = [];\n const args: string[] = [];\n const inits: string[] = [];\n this.typeProperties(type).forEach(prop => {\n annotations.push(this.declareProperty(indent, prop, true));\n args.push(this.declareConstructorArg('', prop));\n inits.push(this.initArg(bump, prop));\n });\n let result = '';\n if (Object.values(type.properties).some(this.isBareForwardRef)) {\n result =\n `\\n${indent}__annotations__ = {\\n` +\n `${annotations.join(',\\n')}` +\n `\\n${indent}}`;\n }\n result +=\n `\\n\\n${indent}def __init__(self, *${this.argDelimiter}` +\n `${args.join(this.argDelimiter)}):\\n` +\n inits.join('\\n');\n return result;\n }\n\n declareConstructorArg(indent: string, property: IProperty) {\n const mappedType = this.typeMapModels(property.type);\n let propType: string;\n if (property.required) {\n propType = mappedType.name;\n } else {\n propType = `Optional[${mappedType.name}] = ${this.nullStr}`;\n }\n let propName = property.name;\n if (this.pythonKeywords.has(propName)) {\n propName = propName + '_';\n }\n return `${indent}${propName}: ${propType}`;\n }\n\n // this is a builder function to produce arguments with optional null place holders but no extra required optional arguments\n argFill(current: string, args: string): string {\n if (!current && args.trim() === this.nullStr) {\n // Don't append trailing optional arguments if none have been set yet\n return '';\n }\n let delimiter = ',\\n';\n if (!current) {\n delimiter = '';\n // Caller manually inserted delimiter followed by inline comment\n } else if (args.match(/, {2}#/)) {\n delimiter = delimiter.replace(',', '');\n }\n return `${args}${delimiter}${current}`;\n }\n\n httpArgs(callerIndent: string, method: IMethod): string {\n const currIndent = this.bumper(callerIndent);\n let args = '';\n args = this.argFill(\n args,\n `${currIndent}transport_options=transport_options`\n );\n const body = method.bodyArg ? method.bodyArg : this.nullStr;\n const query = method.queryArgs.length\n ? this.argGroup('', method.queryArgs)\n : this.nullStr;\n const formArgs = this.assignFormArgs(method, body, query);\n\n if (formArgs.body !== this.nullStr) {\n args = this.argFill(args, `${currIndent}body=${formArgs.body}`);\n }\n if (formArgs.query !== this.nullStr) {\n args = this.argFill(args, `${currIndent}query_params=${formArgs.query}`);\n }\n let returnType = this.methodReturnType(method);\n if (method.responseIsBoth()) {\n // cattrs needs the python object Union[<rt>, bytes] in order\n // to properly deserialize the response. However, this argument\n // is passed as a value so we get a mypy error that the argument\n // has type \"object\" instead of TStructure. Hence the # type: ignore\n returnType += ', # type: ignore';\n }\n args = this.argFill(args, `${currIndent}structure=${returnType}`);\n let endpoint = `\"${method.endpoint}\"`;\n if (/\\{\\w+\\}/.test(endpoint)) {\n // avoid flake8: f-string is missing placeholders\n endpoint = `f${endpoint}`;\n }\n args = this.argFill(args, `${currIndent}path=${endpoint}`);\n return args;\n }\n\n httpCall(callerIndent: string, method: IMethod): string {\n // callOpener itself is nested inside a cast()\n const currIndent = this.bumper(callerIndent);\n let deprecation = '';\n if (method.name === 'login_user') {\n deprecation =\n `${callerIndent}warnings.warn(\"login_user behavior changed significantly ` +\n `in 21.4.0. See https://git.io/JOtH1\")\\n`;\n }\n const callOpener =\n `${callerIndent}response = cast(\\n` +\n `${currIndent}${this.methodReturnType(method)},\\n` +\n `${currIndent}${this.it(method.httpMethod.toLowerCase())}(\\n`;\n const callArgs = `${this.httpArgs(currIndent, method)}\\n`;\n const callCloser = `${currIndent})\\n${callerIndent})\\n`;\n const returnStmt = `${callerIndent}return response`;\n return deprecation + callOpener + callArgs + callCloser + returnStmt;\n }\n\n encodePathParams(indent: string, method: IMethod) {\n let encodings = '';\n const pathParams = method.pathParams;\n if (pathParams.length > 0) {\n for (const param of pathParams) {\n if (param.doEncode()) {\n encodings += `${indent}${param.name} = self.encode_path_param(${param.name})\\n`;\n }\n }\n }\n return encodings;\n }\n\n declareMethod(indent: string, method: IMethod) {\n const bump = this.bumper(indent);\n\n return (\n this.methodSignature(indent, method) +\n this.summary(bump, method.summary) +\n this.encodePathParams(bump, method) +\n this.httpCall(bump, method)\n );\n }\n\n typeSignature(indent: string, type: IType) {\n const bump = this.bumper(indent);\n const b2 = this.bumper(bump);\n const attrs: string[] = [];\n const isEnum = type instanceof EnumType;\n const baseClass = isEnum ? 'enum.Enum' : 'model.Model';\n let usesReservedPythonKeyword = false;\n\n if (!isEnum) {\n for (const prop of this.typeProperties(type)) {\n let propName = prop.name;\n if (this.pythonKeywords.has(propName)) {\n propName = propName + '_';\n usesReservedPythonKeyword = true;\n }\n let attr = `${b2}${propName}:`;\n if (prop.description) {\n attr += ` ${prop.description}`;\n }\n attrs.push(attr);\n }\n }\n\n if (usesReservedPythonKeyword) {\n this.hooks.push(\n `sr.converter${this.apiRef}.register_structure_hook(\\n${bump}${type.name}, # type: ignore\\n${bump}${this.structureHookTK} # type:ignore\\n)`\n );\n }\n\n let result =\n `\\n` +\n (isEnum ? '' : `${indent}@attr.s(auto_attribs=True, init=False)\\n`) +\n `${indent}class ${type.name}(${baseClass}):\\n` +\n `${bump}\"\"\"\\n` +\n (type.description ? `${bump}${type.description}\\n\\n` : '');\n\n if (attrs.length > 0) {\n result += `${bump}Attributes:\\n` + `${attrs.join('\\n')}\\n`;\n }\n\n return result + `${bump}\"\"\"\\n`;\n }\n\n summary(indent: string, text: string | undefined) {\n return text ? `${indent}\"\"\"${text}\"\"\"\\n` : '';\n }\n\n // when format is \"methods\" that means we're in the methods.py module\n // and we need to reference the type by the `mdls.` package name\n prefixModelsNamespace(\n name: string,\n format: 'models' | 'methods',\n forwardRef = false\n ): string {\n if (format === 'models') {\n // need to quote this forwardRef\n name = forwardRef ? `\"${name}\"` : name;\n } else if (format === 'methods') {\n name = `mdls.${name}`;\n }\n return name;\n }\n\n // hack default format to 'methods' so that argValue() calls the right thing\n typeMap(type: IType, format: 'models' | 'methods' = 'methods'): IMappedType {\n const asString: CodeAssignment = (_, v) => `\"${v}\"`;\n const pythonTypes: Record<string, IMappedType> = {\n any: { default: this.nullStr, name: 'Any' },\n boolean: { default: this.nullStr, name: 'bool' },\n byte: { default: this.nullStr, name: 'bytes' },\n date: { default: this.nullStr, name: 'datetime.datetime' },\n datetime: { default: this.nullStr, name: 'datetime.datetime' },\n double: { default: this.nullStr, name: 'float' },\n float: { default: this.nullStr, name: 'float' },\n int32: { default: this.nullStr, name: 'int' },\n int64: { default: this.nullStr, name: 'int' },\n integer: { default: this.nullStr, name: 'int' },\n number: { default: this.nullStr, name: 'float' },\n password: { default: this.nullStr, name: 'str', asVal: asString },\n string: { default: this.nullStr, name: 'str', asVal: asString },\n object: { default: this.nullStr, name: 'str', asVal: asString },\n uri: { default: this.nullStr, name: 'str', asVal: asString },\n void: { default: this.nullStr, name: 'None' },\n };\n\n super.typeMap(type);\n if (type.elementType) {\n const map = this.typeMap(type.elementType, format);\n let typeName: string;\n let name: string;\n const defaultValue = this.nullStr;\n let asVal: CodeAssignment | undefined;\n switch (type.className) {\n case 'ArrayType':\n typeName = 'Sequence';\n name = `${typeName}[${map.name}]`;\n break;\n case 'HashType':\n typeName = 'MutableMapping';\n // TODO fix bad API spec, like MergeQuery vis_config\n name =\n typeName +\n '[str, ' +\n (type.elementType.name === 'string' ? 'Any' : map.name) +\n ']';\n break;\n case 'DelimArrayType':\n typeName = this.prefixModelsNamespace('DelimSequence', format);\n name = `${typeName}[${map.name}]`;\n asVal = (_, v) => `${typeName}([${v}])`;\n break;\n case 'EnumType':\n name = typeName = this.prefixModelsNamespace(type.name, format, true);\n asVal = (_, v) => `${typeName}.${v}`;\n break;\n default:\n throw new Error(`Don't know how to handle: ${JSON.stringify(type)}`);\n }\n const mt: IMappedType = { default: defaultValue, name };\n if (asVal) {\n mt.asVal = asVal;\n }\n return mt;\n }\n if (!type.name) {\n throw new Error('Cannot output a nameless type.');\n }\n const name = this.prefixModelsNamespace(\n type.name,\n format,\n !!type.customType\n );\n const result = pythonTypes[type.name];\n return result || { default: this.nullStr, name };\n }\n\n typeMapMethods(type: IType) {\n return this.typeMap(type, 'methods');\n }\n\n typeMapModels(type: IType) {\n return this.typeMap(type, 'models');\n }\n}\n"],"mappings":";;;;;;AA4BA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAAoC,SAAAE,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,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,QAAQ,OAAAnK,MAAA,CAAI8I,CAAC,CAAE;UACpC;QACF;UACE,MAAM,IAAIuB,KAAK,8BAAArK,MAAA,CAA8BsK,IAAI,CAACC,SAAS,CAACxJ,IAAI,CAAC,CAAE,CAAC;MACxE;MACA,IAAMyJ,EAAe,GAAG;QAAE1F,OAAO,EAAEsF,YAAY;QAAEzH,IAAI,EAAJA;MAAK,CAAC;MACvD,IAAIiH,KAAK,EAAE;QACTY,EAAE,CAACZ,KAAK,GAAGA,KAAK;MAClB;MACA,OAAOY,EAAE;IACX;IACA,IAAI,CAACzJ,IAAI,CAAC4B,IAAI,EAAE;MACd,MAAM,IAAI0H,KAAK,CAAC,gCAAgC,CAAC;IACnD;IACA,IAAM1H,IAAI,GAAG,IAAI,CAAC6F,qBAAqB,CACrCzH,IAAI,CAAC4B,IAAI,EACT8F,MAAM,EACN,CAAC,CAAC1H,IAAI,CAACC,UACT,CAAC;IACD,IAAMiF,MAAM,GAAG8C,WAAW,CAAChI,IAAI,CAAC4B,IAAI,CAAC;IACrC,OAAOsD,MAAM,IAAI;MAAEnB,OAAO,EAAE,IAAI,CAACpD,OAAO;MAAEiB;IAAK,CAAC;EAClD;EAEAU,cAAcA,CAACtC,IAAW,EAAE;IAC1B,OAAO,IAAI,CAAC4H,OAAO,CAAC5H,IAAI,EAAE,SAAS,CAAC;EACtC;EAEA0B,aAAaA,CAAC1B,IAAW,EAAE;IACzB,OAAO,IAAI,CAAC4H,OAAO,CAAC5H,IAAI,EAAE,QAAQ,CAAC;EACrC;AACF;AAAC0J,OAAA,CAAA7K,SAAA,GAAAA,SAAA"}
1
+ {"version":3,"file":"python.gen.js","names":["_sdkModels","require","_codeGen","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","PythonGen","CodeGen","constructor","arguments","concat","indentStr","repeat","Set","_indent","warnEditing","packagePath","packageName","apiVersion","apiRef","structureHookTK","hooks","join","prop","required","type","customType","EnumType","includes","className","sdkFileName","baseFileName","fileName","argGroup","args","length","nullStr","hash","arg","push","dataStructureDelimiter","beginRegion","indent","description","endRegion","_description","declareProperty","property","annotations","undefined","mappedType","typeMapModels","propName","name","pythonKeywords","has","propType","propDef","annotation","isBareForwardRef","bumper","methodReturnType","method","typeMapMethods","returnType","responseIsBoth","responseIsBinary","methodSignature","_method$description","bump","params","allParams","forEach","p","declareParameter","head","trim","httpMethod","endpoint","commentHeader","paramDelimiter","param","location","strBody","writeableType","mapped","paramType","describeParam","default","makeTheCall","inputs","origDelim","argDelimiter","resp","assignParams","match","initArg","declareType","decl","invalid","typeProperties","values","requiredProperties","optionalProperties","construct","inits","declareConstructorArg","result","properties","some","argFill","current","delimiter","replace","httpArgs","callerIndent","currIndent","body","bodyArg","query","queryArgs","formArgs","assignFormArgs","options","test","httpCall","deprecation","callOpener","it","toLowerCase","callArgs","callCloser","returnStmt","encodePathParams","encodings","pathParams","doEncode","isFormUrlEncoded","declareMethod","summary","typeSignature","b2","attrs","isEnum","baseClass","usesReservedPythonKeyword","attr","text","prefixModelsNamespace","format","forwardRef","typeMap","asString","_","v","pythonTypes","any","boolean","byte","date","datetime","double","float","int32","int64","integer","number","password","asVal","string","object","uri","void","elementType","map","typeName","defaultValue","Error","JSON","stringify","mt","exports"],"sources":["../src/python.gen.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { ArgValues } from '@looker/sdk-rtl';\nimport type { Arg, IMethod, IParameter, IProperty, IType } from './sdkModels';\nimport { EnumType, describeParam, strBody } from './sdkModels';\nimport type { CodeAssignment, IMappedType } from './codeGen';\nimport { CodeGen } from './codeGen';\n\nexport class PythonGen extends CodeGen {\n codePath = './python/';\n packagePath = 'looker_sdk';\n itself = 'self';\n fileExtension = '.py';\n commentStr = '# ';\n nullStr = 'None';\n\n indentStr = ' ';\n argDelimiter = `,\\n${this.indentStr.repeat(3)}`;\n argSetSep = '=';\n paramDelimiter = ',\\n';\n propDelimiter = '\\n';\n dataStructureDelimiter = ', ';\n enumDelimiter = '\\n';\n codeQuote = '\"';\n typeOpen = '(';\n typeClose = ')';\n hashKeyQuote = '\"';\n useModelClassForTypes = true;\n\n endTypeStr = '';\n\n // keyword.kwlist\n pythonKeywords = new Set<string>([\n 'False',\n 'None',\n 'True',\n 'and',\n 'as',\n 'assert',\n 'async',\n 'await',\n 'break',\n 'class',\n 'continue',\n 'def',\n 'del',\n 'elif',\n 'else',\n 'except',\n 'finally',\n 'for',\n 'from',\n 'global',\n 'if',\n 'import',\n 'in',\n 'is',\n 'lambda',\n 'nonlocal',\n 'not',\n 'or',\n 'pass',\n 'raise',\n 'return',\n 'try',\n 'while',\n 'with',\n 'yield',\n ]);\n\n // cattrs [un]structure hooks for model [de]serialization\n hooks: string[] = [];\n structureHookTK = 'translate_keys_structure_hook';\n pythonReservedKeywordClasses: Set<string> = new Set();\n\n methodsPrologue = (_indent: string) => `\n# ${this.warnEditing()}\nimport datetime\nfrom typing import Any, MutableMapping, Optional, Sequence, Union, cast\nimport warnings\n\nfrom . import models as mdls\nfrom ${this.packagePath}.rtl import api_methods\nfrom ${this.packagePath}.rtl import model\nfrom ${this.packagePath}.rtl import transport\n\nclass ${this.packageName}(api_methods.APIMethods):\n`;\n\n methodsEpilogue = (_indent: string) =>\n this.apiVersion === '4.0' ? `LookerSDK = ${this.packageName}` : '';\n\n modelsPrologue = (_indent: string) => `\n# ${this.warnEditing()}\nimport datetime\nimport enum\nfrom typing import Any, MutableMapping, Optional, Sequence\n\ntry:\n from typing import ForwardRef # type: ignore\nexcept ImportError:\n from typing import _ForwardRef as ForwardRef # type: ignore\n\nimport attr\n\nfrom ${this.packagePath}.rtl import model\nfrom ${this.packagePath}.rtl import serialize as sr\n\nEXPLICIT_NULL = model.EXPLICIT_NULL # type: ignore\nDelimSequence = model.DelimSequence\n`;\n\n modelsEpilogue = (_indent: string) => `\nimport functools # noqa:E402\n\nforward_ref_structure_hook = functools.partial(\n sr.forward_ref_structure_hook, globals(), sr.converter${this.apiRef}\n)\nsr.converter${this.apiRef}.register_structure_hook_func(\n lambda t: t.__class__ is ForwardRef, forward_ref_structure_hook\n)\n${\n this.structureHookTK\n} = functools.partial(sr.translate_keys_structure_hook, sr.converter${\n this.apiRef\n })\n${this.hooks.join('\\n')}\n`;\n\n sdkFileName(baseFileName: string) {\n return this.fileName(`sdk/api${this.apiRef}/${baseFileName}`);\n }\n\n argGroup(_indent: string, args: Arg[]) {\n if (!args || args.length === 0) return this.nullStr;\n const hash: string[] = [];\n for (const arg of args) {\n hash.push(`\"${arg}\": ${arg}`);\n }\n return `{${hash.join(this.dataStructureDelimiter)}}`;\n }\n\n beginRegion(indent: string, description: string): string {\n // Sadly, Black reformats this to \"# region\" and IntelliJ doesn't recognize it either way\n return `${indent}#region ${description}`;\n }\n\n endRegion(indent: string, _description: string): string {\n // Sadly, Black reformats this to \"# endregion\" and IntelliJ doesn't recognize it either way\n return `${indent}#endregion`;\n }\n\n declareProperty(indent: string, property: IProperty, annotations = false) {\n const mappedType = this.typeMapModels(property.type);\n let propName = property.name;\n if (this.pythonKeywords.has(propName)) {\n propName = propName + '_';\n }\n let propType = mappedType.name;\n if (!property.required) {\n propType = `Optional[${mappedType.name}]`;\n }\n\n let propDef;\n if (annotations) {\n let annotation = propType;\n if (this.isBareForwardRef(property)) {\n annotation = `ForwardRef(${propType})`;\n }\n propDef = `${this.bumper(indent)}\"${propName}\": ${annotation}`;\n } else {\n if (!property.required) {\n propType += ` = ${this.nullStr}`;\n }\n propDef = `${indent}${propName}: ${propType}`;\n }\n return propDef;\n }\n\n private methodReturnType(method: IMethod) {\n const type = this.typeMapMethods(method.type);\n let returnType = type.name;\n if (method.responseIsBoth()) {\n returnType = `Union[${returnType}, bytes]`;\n } else if (method.responseIsBinary()) {\n returnType = 'bytes';\n }\n return returnType;\n }\n\n // because Python has named default parameters, Request types are not required like\n // they are for TypeScript\n methodSignature(indent: string, method: IMethod) {\n const returnType = this.methodReturnType(method);\n const bump = this.bumper(indent);\n const params: string[] = [];\n const args = method.allParams;\n if (args && args.length > 0) {\n method.allParams.forEach(p =>\n params.push(this.declareParameter(bump, method, p))\n );\n }\n let head = method.description?.trim();\n head =\n (head ? `${head}\\n\\n` : '') +\n `${method.httpMethod} ${method.endpoint} -> ${returnType}`;\n params.push(\n `${bump}transport_options: Optional[transport.TransportOptions] = None,`\n );\n return (\n this.commentHeader(indent, head) +\n `${indent}def ${method.name}(\\n` +\n `${bump}self${params.length > 0 ? ',\\n' : ''}` +\n `${params.join(this.paramDelimiter)}\\n` +\n `${indent}) -> ${returnType}:\\n`\n );\n }\n\n declareParameter(indent: string, method: IMethod, param: IParameter) {\n let type: IType;\n if (param.location === strBody) {\n type = this.writeableType(param.type, method) || param.type;\n } else {\n type = param.type;\n }\n const mapped = this.typeMapMethods(type);\n const paramType = param.required ? mapped.name : `Optional[${mapped.name}]`;\n return (\n this.commentHeader(indent, describeParam(param)) +\n `${indent}${param.name}: ${paramType}` +\n (param.required ? '' : ` = ${mapped.default}`)\n );\n }\n\n makeTheCall(method: IMethod, inputs: ArgValues): string {\n const origDelim = this.argDelimiter;\n this.argDelimiter = `,\\n${this.indentStr}`;\n let resp = `response = sdk.${method.name}(`;\n const args = this.assignParams(method, inputs);\n if (args.match(/\\bmdls\\b/)) {\n resp = 'from looker_sdk import models as mdls\\n\\n' + resp;\n }\n this.argDelimiter = origDelim;\n return `${resp}${args})`;\n }\n\n initArg(indent: string, property: IProperty) {\n let propName = property.name;\n if (this.pythonKeywords.has(propName)) {\n propName = propName + '_';\n }\n return `${indent}self.${propName} = ${propName}`;\n }\n\n declareType(indent: string, type: IType) {\n let decl = super.declareType(indent, type);\n if (type instanceof EnumType) {\n const invalid =\n 'invalid_api_enum_value = \"invalid_api_enum_value\"' +\n '\\n\\n\\n# https://github.com/python/mypy/issues/2427' +\n `\\n${type.name}.__new__ = model.safe_enum__new__ # type: ignore`;\n decl += `\\n${this.bumper(indent)}${invalid}`;\n }\n return decl;\n }\n\n typeProperties(type: IType) {\n return Object.values(type.requiredProperties).concat(\n Object.values(type.optionalProperties)\n );\n }\n\n private isBareForwardRef = (prop: IProperty) => {\n // contains a \"bare\" forward reference e.g. `result_format: \"ResultFormat\"`\n // so we need to emit the `__annotations__` property\n return (\n prop.required &&\n (prop.type.customType || prop.type instanceof EnumType) &&\n !['ArrayType', 'HashType', 'DelimArrayType'].includes(prop.type.className)\n );\n };\n\n /**\n * Ideally we'd rely on @attr.s to generate the constructor for us\n * However, neither Jedi (https://github.com/davidhalter/jedi-vim/issues/816)\n * nor microsoft/python-language-server\n * (https://github.com/microsoft/python-language-server/issues/399)\n * display good tooltips for these auto-generated __init__ methods. So for\n * now we'll generate them ourselves following the functionality of\n * @attr.s(kw_only=True) we'll only allow kw_args.\n */\n construct(indent: string, type: IType) {\n if (type instanceof EnumType) return '';\n indent = this.bumper(indent);\n const bump = this.bumper(indent);\n const annotations: string[] = [];\n const args: string[] = [];\n const inits: string[] = [];\n this.typeProperties(type).forEach(prop => {\n annotations.push(this.declareProperty(indent, prop, true));\n args.push(this.declareConstructorArg('', prop));\n inits.push(this.initArg(bump, prop));\n });\n let result = '';\n if (Object.values(type.properties).some(this.isBareForwardRef)) {\n result =\n `\\n${indent}__annotations__ = {\\n` +\n `${annotations.join(',\\n')}` +\n `\\n${indent}}`;\n }\n result +=\n `\\n\\n${indent}def __init__(self, *${this.argDelimiter}` +\n `${args.join(this.argDelimiter)}):\\n` +\n inits.join('\\n');\n return result;\n }\n\n declareConstructorArg(indent: string, property: IProperty) {\n const mappedType = this.typeMapModels(property.type);\n let propType: string;\n if (property.required) {\n propType = mappedType.name;\n } else {\n propType = `Optional[${mappedType.name}] = ${this.nullStr}`;\n }\n let propName = property.name;\n if (this.pythonKeywords.has(propName)) {\n propName = propName + '_';\n }\n return `${indent}${propName}: ${propType}`;\n }\n\n // this is a builder function to produce arguments with optional null place holders but no extra required optional arguments\n argFill(current: string, args: string): string {\n if (!current && args.trim() === this.nullStr) {\n // Don't append trailing optional arguments if none have been set yet\n return '';\n }\n let delimiter = ',\\n';\n if (!current) {\n delimiter = '';\n // Caller manually inserted delimiter followed by inline comment\n } else if (args.match(/, {2}#/)) {\n delimiter = delimiter.replace(',', '');\n }\n return `${args}${delimiter}${current}`;\n }\n\n httpArgs(callerIndent: string, method: IMethod): string {\n const currIndent = this.bumper(callerIndent);\n const body = method.bodyArg ? method.bodyArg : this.nullStr;\n const query = method.queryArgs.length\n ? this.argGroup('', method.queryArgs)\n : this.nullStr;\n const formArgs = this.assignFormArgs(\n method,\n body,\n query,\n 'transport_options'\n );\n\n let args = '';\n args = this.argFill(\n args,\n `${currIndent}transport_options=${formArgs.options}`\n );\n\n if (formArgs.body !== this.nullStr) {\n args = this.argFill(args, `${currIndent}body=${formArgs.body}`);\n }\n if (formArgs.query !== this.nullStr) {\n args = this.argFill(args, `${currIndent}query_params=${formArgs.query}`);\n }\n let returnType = this.methodReturnType(method);\n if (method.responseIsBoth()) {\n // cattrs needs the python object Union[<rt>, bytes] in order\n // to properly deserialize the response. However, this argument\n // is passed as a value so we get a mypy error that the argument\n // has type \"object\" instead of TStructure. Hence the # type: ignore\n returnType += ', # type: ignore';\n }\n args = this.argFill(args, `${currIndent}structure=${returnType}`);\n let endpoint = `\"${method.endpoint}\"`;\n if (/\\{\\w+\\}/.test(endpoint)) {\n // avoid flake8: f-string is missing placeholders\n endpoint = `f${endpoint}`;\n }\n args = this.argFill(args, `${currIndent}path=${endpoint}`);\n return args;\n }\n\n httpCall(callerIndent: string, method: IMethod): string {\n // callOpener itself is nested inside a cast()\n const currIndent = this.bumper(callerIndent);\n let deprecation = '';\n if (method.name === 'login_user') {\n deprecation =\n `${callerIndent}warnings.warn(\"login_user behavior changed significantly ` +\n `in 21.4.0. See https://git.io/JOtH1\")\\n`;\n }\n const callOpener =\n `${callerIndent}response = cast(\\n` +\n `${currIndent}${this.methodReturnType(method)},\\n` +\n `${currIndent}${this.it(method.httpMethod.toLowerCase())}(\\n`;\n const callArgs = `${this.httpArgs(currIndent, method)}\\n`;\n const callCloser = `${currIndent})\\n${callerIndent})\\n`;\n const returnStmt = `${callerIndent}return response`;\n return deprecation + callOpener + callArgs + callCloser + returnStmt;\n }\n\n encodePathParams(indent: string, method: IMethod) {\n let encodings = '';\n const pathParams = method.pathParams;\n if (pathParams.length > 0) {\n for (const param of pathParams) {\n if (param.doEncode()) {\n encodings += `${indent}${param.name} = self.encode_path_param(${param.name})\\n`;\n }\n }\n }\n return encodings;\n }\n\n assignFormArgs(\n method: IMethod,\n body: string,\n query: string,\n options: string\n ): { body: string; query: string; options: string } {\n if (method.isFormUrlEncoded) {\n body = `model.URLSearchParams(${query})`;\n query = this.nullStr;\n }\n return { body, query, options };\n }\n\n declareMethod(indent: string, method: IMethod) {\n const bump = this.bumper(indent);\n\n return (\n this.methodSignature(indent, method) +\n this.summary(bump, method.summary) +\n this.encodePathParams(bump, method) +\n this.httpCall(bump, method)\n );\n }\n\n typeSignature(indent: string, type: IType) {\n const bump = this.bumper(indent);\n const b2 = this.bumper(bump);\n const attrs: string[] = [];\n const isEnum = type instanceof EnumType;\n const baseClass = isEnum ? 'enum.Enum' : 'model.Model';\n let usesReservedPythonKeyword = false;\n\n if (!isEnum) {\n for (const prop of this.typeProperties(type)) {\n let propName = prop.name;\n if (this.pythonKeywords.has(propName)) {\n propName = propName + '_';\n usesReservedPythonKeyword = true;\n }\n let attr = `${b2}${propName}:`;\n if (prop.description) {\n attr += ` ${prop.description}`;\n }\n attrs.push(attr);\n }\n }\n\n if (usesReservedPythonKeyword) {\n this.hooks.push(\n `sr.converter${this.apiRef}.register_structure_hook(\\n${bump}${type.name}, # type: ignore\\n${bump}${this.structureHookTK} # type:ignore\\n)`\n );\n }\n\n let result =\n `\\n` +\n (isEnum ? '' : `${indent}@attr.s(auto_attribs=True, init=False)\\n`) +\n `${indent}class ${type.name}(${baseClass}):\\n` +\n `${bump}\"\"\"\\n` +\n (type.description ? `${bump}${type.description}\\n\\n` : '');\n\n if (attrs.length > 0) {\n result += `${bump}Attributes:\\n` + `${attrs.join('\\n')}\\n`;\n }\n\n return result + `${bump}\"\"\"\\n`;\n }\n\n summary(indent: string, text: string | undefined) {\n return text ? `${indent}\"\"\"${text}\"\"\"\\n` : '';\n }\n\n // when format is \"methods\" that means we're in the methods.py module\n // and we need to reference the type by the `mdls.` package name\n prefixModelsNamespace(\n name: string,\n format: 'models' | 'methods',\n forwardRef = false\n ): string {\n if (format === 'models') {\n // need to quote this forwardRef\n name = forwardRef ? `\"${name}\"` : name;\n } else if (format === 'methods') {\n name = `mdls.${name}`;\n }\n return name;\n }\n\n // hack default format to 'methods' so that argValue() calls the right thing\n typeMap(type: IType, format: 'models' | 'methods' = 'methods'): IMappedType {\n const asString: CodeAssignment = (_, v) => `\"${v}\"`;\n const pythonTypes: Record<string, IMappedType> = {\n any: { default: this.nullStr, name: 'Any' },\n boolean: { default: this.nullStr, name: 'bool' },\n byte: { default: this.nullStr, name: 'bytes' },\n date: { default: this.nullStr, name: 'datetime.datetime' },\n datetime: { default: this.nullStr, name: 'datetime.datetime' },\n double: { default: this.nullStr, name: 'float' },\n float: { default: this.nullStr, name: 'float' },\n int32: { default: this.nullStr, name: 'int' },\n int64: { default: this.nullStr, name: 'int' },\n integer: { default: this.nullStr, name: 'int' },\n number: { default: this.nullStr, name: 'float' },\n password: { default: this.nullStr, name: 'str', asVal: asString },\n string: { default: this.nullStr, name: 'str', asVal: asString },\n object: { default: this.nullStr, name: 'str', asVal: asString },\n uri: { default: this.nullStr, name: 'str', asVal: asString },\n void: { default: this.nullStr, name: 'None' },\n };\n\n super.typeMap(type);\n if (type.elementType) {\n const map = this.typeMap(type.elementType, format);\n let typeName: string;\n let name: string;\n const defaultValue = this.nullStr;\n let asVal: CodeAssignment | undefined;\n switch (type.className) {\n case 'ArrayType':\n typeName = 'Sequence';\n name = `${typeName}[${map.name}]`;\n break;\n case 'HashType':\n typeName = 'MutableMapping';\n // TODO fix bad API spec, like MergeQuery vis_config\n name =\n typeName +\n '[str, ' +\n (type.elementType.name === 'string' ? 'Any' : map.name) +\n ']';\n break;\n case 'DelimArrayType':\n typeName = this.prefixModelsNamespace('DelimSequence', format);\n name = `${typeName}[${map.name}]`;\n asVal = (_, v) => `${typeName}([${v}])`;\n break;\n case 'EnumType':\n name = typeName = this.prefixModelsNamespace(type.name, format, true);\n asVal = (_, v) => `${typeName}.${v}`;\n break;\n default:\n throw new Error(`Don't know how to handle: ${JSON.stringify(type)}`);\n }\n const mt: IMappedType = { default: defaultValue, name };\n if (asVal) {\n mt.asVal = asVal;\n }\n return mt;\n }\n if (!type.name) {\n throw new Error('Cannot output a nameless type.');\n }\n const name = this.prefixModelsNamespace(\n type.name,\n format,\n !!type.customType\n );\n const result = pythonTypes[type.name];\n return result || { default: this.nullStr, name };\n }\n\n typeMapMethods(type: IType) {\n return this.typeMap(type, 'methods');\n }\n\n typeMapModels(type: IType) {\n return this.typeMap(type, 'models');\n }\n}\n"],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IAAI;MAAEnB,OAAO,EAAE,IAAI,CAACpD,OAAO;MAAEiB;IAAK,CAAC;EAClD;EAEAU,cAAcA,CAACtC,IAAW,EAAE;IAC1B,OAAO,IAAI,CAAC8H,OAAO,CAAC9H,IAAI,EAAE,SAAS,CAAC;EACtC;EAEA0B,aAAaA,CAAC1B,IAAW,EAAE;IACzB,OAAO,IAAI,CAAC8H,OAAO,CAAC9H,IAAI,EAAE,QAAQ,CAAC;EACrC;AACF;AAAC4J,OAAA,CAAA/K,SAAA,GAAAA,SAAA","ignoreList":[]}
package/lib/sdkModels.js CHANGED
@@ -9,13 +9,12 @@ var _blueimpMd = _interopRequireDefault(require("blueimp-md5"));
9
9
  var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
10
10
  var _sdkRtl = require("@looker/sdk-rtl");
11
11
  var _specConverter = require("./specConverter");
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
14
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
15
14
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16
15
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
18
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
16
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
19
18
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
20
19
  var strBody = exports.strBody = 'body';
21
20
  var strRequest = exports.strRequest = 'Request';
@@ -195,7 +194,7 @@ var typeRefs = (api, refs) => {
195
194
  return result;
196
195
  };
197
196
  exports.typeRefs = typeRefs;
198
- var firstMethodRef = exports.firstMethodRef = function firstMethodRef(api, type) {
197
+ var _firstMethodRef = exports.firstMethodRef = function firstMethodRef(api, type) {
199
198
  var stack = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Set();
200
199
  stack.add(type.name);
201
200
  var method = methodRefs(api, type.methodRefs)[0];
@@ -203,14 +202,14 @@ var firstMethodRef = exports.firstMethodRef = function firstMethodRef(api, type)
203
202
  var parents = typeRefs(api, type.parentTypes);
204
203
  for (var parent of parents) {
205
204
  if (!stack.has(parent.name)) {
206
- method = firstMethodRef(api, parent, stack);
205
+ method = _firstMethodRef(api, parent, stack);
207
206
  }
208
207
  if (method) break;
209
208
  }
210
209
  }
211
210
  return method;
212
211
  };
213
- var anyWriter = function anyWriter(api, type) {
212
+ var _anyWriter = function anyWriter(api, type) {
214
213
  var stack = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Set();
215
214
  var result;
216
215
  if (stack.has(type.name)) return undefined;
@@ -227,7 +226,7 @@ var anyWriter = function anyWriter(api, type) {
227
226
  allTypes.delete(type.name);
228
227
  var refs = typeRefs(api, allTypes);
229
228
  for (var ref of refs) {
230
- result = anyWriter(api, ref, stack);
229
+ result = _anyWriter(api, ref, stack);
231
230
  if (result) {
232
231
  break;
233
232
  }
@@ -281,7 +280,7 @@ var tagTypes = (api, types) => {
281
280
  var [name, type] = _ref2;
282
281
  var methods = methodRefs(api, type.methodRefs);
283
282
  if (methods.length === 0) {
284
- var first = firstMethodRef(api, type);
283
+ var first = _firstMethodRef(api, type);
285
284
  if (first) methods = [first];
286
285
  }
287
286
  methods.forEach(method => {
@@ -318,7 +317,7 @@ class MethodResponse {
318
317
  return result;
319
318
  }
320
319
  }
321
- class _Symbol {
320
+ class _Symbol2 {
322
321
  constructor(name, type) {
323
322
  var owner = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
324
323
  this.name = name;
@@ -348,7 +347,7 @@ class _Symbol {
348
347
  return result;
349
348
  }
350
349
  }
351
- class SchemadSymbol extends _Symbol {
350
+ class SchemadSymbol extends _Symbol2 {
352
351
  constructor(name, type, schema) {
353
352
  var owner = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
354
353
  super(name, type, owner);
@@ -1149,16 +1148,16 @@ class Type {
1149
1148
  var [a] = _ref8;
1150
1149
  var [b] = _ref9;
1151
1150
  return a.localeCompare(b);
1152
- }).forEach(_ref10 => {
1153
- var [, prop] = _ref10;
1151
+ }).forEach(_ref0 => {
1152
+ var [, prop] = _ref0;
1154
1153
  result += prop.asHashString() + ':';
1155
1154
  });
1156
1155
  return result;
1157
1156
  }
1158
1157
  isRecursive() {
1159
1158
  var selfType = this.name;
1160
- return Object.entries(this.properties).some(_ref11 => {
1161
- var [, prop] = _ref11;
1159
+ return Object.entries(this.properties).some(_ref1 => {
1160
+ var [, prop] = _ref1;
1162
1161
  return prop.type.name === selfType;
1163
1162
  });
1164
1163
  }
@@ -1190,8 +1189,8 @@ class Type {
1190
1189
  if (this.deprecated) result += searchIt('deprecated');
1191
1190
  }
1192
1191
  if (criteria.has(SearchCriterion.property)) {
1193
- Object.entries(this.properties).forEach(_ref12 => {
1194
- var [, prop] = _ref12;
1192
+ Object.entries(this.properties).forEach(_ref10 => {
1193
+ var [, prop] = _ref10;
1195
1194
  if (this.name !== prop.type.name) {
1196
1195
  result += prop.searchString(criteria);
1197
1196
  }
@@ -1384,11 +1383,11 @@ class WriteType extends Type {
1384
1383
  exports.WriteType = WriteType;
1385
1384
  _defineProperty(WriteType, "readonlyProps", properties => {
1386
1385
  var result = [];
1387
- Object.entries(properties).filter(_ref21 => {
1388
- var [, prop] = _ref21;
1386
+ Object.entries(properties).filter(_ref19 => {
1387
+ var [, prop] = _ref19;
1389
1388
  return prop.readOnly || prop.type.readOnly;
1390
- }).forEach(_ref22 => {
1391
- var [, prop] = _ref22;
1389
+ }).forEach(_ref20 => {
1390
+ var [, prop] = _ref20;
1392
1391
  return result.push(prop);
1393
1392
  });
1394
1393
  return result;
@@ -1469,8 +1468,8 @@ class ApiModel {
1469
1468
  return result;
1470
1469
  }
1471
1470
  if (ApiModel.isMethodSearch(criteria)) {
1472
- Object.entries(this.methods).forEach(_ref13 => {
1473
- var [, method] = _ref13;
1471
+ Object.entries(this.methods).forEach(_ref11 => {
1472
+ var [, method] = _ref11;
1474
1473
  if (method.search(rx, criteria)) {
1475
1474
  methodCount++;
1476
1475
  ApiModel.addMethodToTags(tags, method);
@@ -1478,8 +1477,8 @@ class ApiModel {
1478
1477
  });
1479
1478
  }
1480
1479
  if (ApiModel.isTypeSearch(criteria)) {
1481
- Object.entries(this.types).forEach(_ref14 => {
1482
- var [key, type] = _ref14;
1480
+ Object.entries(this.types).forEach(_ref12 => {
1481
+ var [key, type] = _ref12;
1483
1482
  if (!rx) {
1484
1483
  throw Error("".concat(key, " rx undefined"));
1485
1484
  }
@@ -1633,9 +1632,9 @@ class ApiModel {
1633
1632
  if (type.intrinsic) return undefined;
1634
1633
  if ((_type$elementType = type.elementType) !== null && _type$elementType !== void 0 && _type$elementType.intrinsic) return undefined;
1635
1634
  if (type instanceof WriteType) return type;
1636
- if (!anyWriter(this, type)) return undefined;
1637
- var props = Object.entries(type.properties).map(_ref15 => {
1638
- var [, prop] = _ref15;
1635
+ if (!_anyWriter(this, type)) return undefined;
1636
+ var props = Object.entries(type.properties).map(_ref13 => {
1637
+ var [, prop] = _ref13;
1639
1638
  return prop;
1640
1639
  });
1641
1640
  if (props.length === 0) return undefined;
@@ -1656,8 +1655,8 @@ class ApiModel {
1656
1655
  return result;
1657
1656
  }
1658
1657
  loadDynamicTypes() {
1659
- Object.entries(this.methods).forEach(_ref16 => {
1660
- var [, method] = _ref16;
1658
+ Object.entries(this.methods).forEach(_ref14 => {
1659
+ var [, method] = _ref14;
1661
1660
  method.makeTypes(this);
1662
1661
  });
1663
1662
  }
@@ -1682,8 +1681,8 @@ class ApiModel {
1682
1681
  load() {
1683
1682
  var _this$spec3, _this$spec3$component, _this$spec4;
1684
1683
  if ((_this$spec3 = this.spec) !== null && _this$spec3 !== void 0 && (_this$spec3$component = _this$spec3.components) !== null && _this$spec3$component !== void 0 && _this$spec3$component.schemas) {
1685
- Object.entries(this.spec.components.schemas).forEach(_ref17 => {
1686
- var [name, schema] = _ref17;
1684
+ Object.entries(this.spec.components.schemas).forEach(_ref15 => {
1685
+ var [name, schema] = _ref15;
1687
1686
  var t = new Type(schema, name);
1688
1687
  this.types[name] = t;
1689
1688
  this.refs["#/components/schemas/".concat(name)] = t;
@@ -1705,8 +1704,8 @@ class ApiModel {
1705
1704
  });
1706
1705
  }
1707
1706
  if ((_this$spec4 = this.spec) !== null && _this$spec4 !== void 0 && _this$spec4.paths) {
1708
- Object.entries(this.spec.paths).forEach(_ref18 => {
1709
- var [path, schema] = _ref18;
1707
+ Object.entries(this.spec.paths).forEach(_ref16 => {
1708
+ var [path, schema] = _ref16;
1710
1709
  var methods = this.loadMethods(path, schema);
1711
1710
  methods.forEach(method => {
1712
1711
  this.methods[method.name] = method;
@@ -1738,12 +1737,12 @@ class ApiModel {
1738
1737
  }
1739
1738
  methodResponses(schema) {
1740
1739
  var responses = [];
1741
- Object.entries(schema.responses).forEach(_ref19 => {
1742
- var [statusCode, contentSchema] = _ref19;
1740
+ Object.entries(schema.responses).forEach(_ref17 => {
1741
+ var [statusCode, contentSchema] = _ref17;
1743
1742
  var desc = contentSchema.description || '';
1744
1743
  if (contentSchema.content) {
1745
- Object.entries(contentSchema.content).forEach(_ref20 => {
1746
- var [mediaType, response] = _ref20;
1744
+ Object.entries(contentSchema.content).forEach(_ref18 => {
1745
+ var [mediaType, response] = _ref18;
1747
1746
  responses.push(new MethodResponse(parseInt(statusCode, 10), mediaType, this.resolveType(response.schema || {}), desc));
1748
1747
  });
1749
1748
  } else if (statusCode === '204') {