1
+ import { InputFile } from "./lib/inputFile";
2
+
1
3
{% macro sub_schema(property , definition , spec ) %}
2
4
{% apply spaceless %}
3
5
{% if property .sub_schema %}
@@ -126,6 +128,18 @@ declare module "{{ language.params.npmPackage|caseDash }}" {
126
128
constructor(client: Client);
127
129
}
128
130
131
+ export class InputFile {
132
+ static fromPath(filePath: string, filename: string): InputFile;
133
+
134
+ static fromBuffer(buffer: Buffer, filename: string): InputFile;
135
+
136
+ static fromBlob(blob: Blob, filename: string): InputFile;
137
+
138
+ static fromStream(stream: any, filename: string, size: number): InputFile;
139
+
140
+ static fromPlainText(content: string, filename: string): InputFile;
141
+ }
142
+
129
143
type QueryTypesSingle = string | number | boolean;
130
144
type QueryTypesList = string[] | number[] | boolean[];
131
145
type QueryTypes = QueryTypesSingle | QueryTypesList;
@@ -152,6 +166,27 @@ declare module "{{ language.params.npmPackage|caseDash }}" {
152
166
153
167
{% for service in spec .services %}
154
168
export class {{ service .name | caseUcfirst }} extends Service {
169
+ constructor(client: Client{% for parameter in service .globalParams %}, {{ parameter .name | caseCamel | escapeKeyword }}: {{ parameter .type | typeName }}{% if not parameter .required %}|null{% endif %}{% endfor %});
170
+
171
+ {% if service .globalParams | length %}
172
+ {% for parameter in service .globalParams %}
173
+ /**
174
+ * Get {{ parameter .name }}.
175
+ *
176
+ * @returns {{ ' {' }}{{ parameter .type | typeName }}{{ ' }' }}
177
+ */
178
+ get{{ parameter .name | caseUcfirst | escapeKeyword }}(): {{ parameter .type | typeName }};
179
+
180
+ /**
181
+ * Set {{ parameter .name }}.
182
+ *
183
+ * @param {{ ' {' }}{{ parameter .type | typeName }}{{ ' }' }} {{ parameter .name | caseCamel | escapeKeyword }}
184
+ * @returns {void}
185
+ */
186
+ set{{ parameter .name | caseUcfirst | escapeKeyword }}({{ parameter .name | caseCamel | escapeKeyword }}: {{ parameter .type | typeName }}): void;
187
+
188
+ {% endfor %}
189
+ {% endif %}
155
190
{% for method in service .methods %}
156
191
{% set generics = _self.get_generics_method (spec .definitions [method .responseModel ], spec , true , true ) %}
157
192
{% set generics_return = _self.get_generics_method_return (spec .definitions [method .responseModel ], spec ) %}
@@ -162,13 +197,13 @@ declare module "{{ language.params.npmPackage|caseDash }}" {
162
197
{{ method .description | comment1 }}
163
198
*
164
199
{% endif %}
165
- {% for parameter in method .parameters .all %}
200
+ {% for parameter in method .parameters .all | filter(( param ) => not param . isGlobal ) %}
166
201
* @param {{ ' {' }}{{ parameter .type | typeName }}{{ ' }' }} {{ parameter .name | caseCamel }}
167
202
{% endfor %}
168
203
* @throws {{ ' {' }}{{ spec .title | caseUcfirst }}Exception}
169
204
* @returns {Promise}
170
205
*/
171
- {{ method .name | caseCamel }}{% if generics %}< {{generics }}>{% endif %}({% for parameter in method .parameters .all %}{{ parameter .name | caseCamel | escapeKeyword }}{% if not parameter .required %}?{% endif %}: {{ parameter .type | typeName }}{% if not loop .last %}, {% endif %}{% endfor %}): Promise< {% if method .type == ' location' %}Buffer{% else %}{% if method .responseModel and method .responseModel != ' any' %}{% if not spec .definitions [method .responseModel ].additionalProperties %}Models.{% endif %}{{method .responseModel | caseUcfirst }}{% if generics_return %}< {{generics_return }}>{% endif %}{% else %}Response{% endif %}{% endif %}>;
206
+ {{ method .name | caseCamel }}{% if generics %}< {{generics }}>{% endif %}({% for parameter in method .parameters .all | filter(( param ) => not param . isGlobal ) %}{{ parameter .name | caseCamel | escapeKeyword }}{% if not parameter .required %}?{% endif %}: {{ parameter .type | typeName }}{% if not loop .last %}, {% endif %}{% endfor %}): Promise< {% if method .type == ' location' %}Buffer{% else %}{% if method .responseModel and method .responseModel != ' any' %}{% if not spec .definitions [method .responseModel ].additionalProperties %}Models.{% endif %}{{method .responseModel | caseUcfirst }}{% if generics_return %}< {{generics_return }}>{% endif %}{% else %}Response{% endif %}{% endif %}>;
172
207
{% endfor %}
173
208
}
174
209
{% endfor %}
0 commit comments