Skip to content

Commit e93bb9a

Browse files
committed
make api_gen gen_e2e gen_samples
1 parent 0b82afd commit e93bb9a

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

e2e/multipart/clients/ts/api_client.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export interface MiddlewareContext {
2626
response?: unknown;
2727
responseBody?: string;
2828
responseHeaders?: Headers;
29+
statusCode?: number;
2930
baseURL: string;
3031
headers: {[key: string]: string};
3132
options: {[key: string]: any};
@@ -186,6 +187,7 @@ class ParamClient {
186187
const responseText = await resp.text();
187188
context.responseBody = responseText;
188189
context.responseHeaders = resp.headers;
190+
context.statusCode = resp.status;
189191

190192
if (Math.floor(resp.status / 100) !== 2) {
191193
await this.callMiddleware(this.afterMiddleware, context);
@@ -402,6 +404,7 @@ export class APIClient {
402404
const responseText = await resp.text();
403405
context.responseBody = responseText;
404406
context.responseHeaders = resp.headers;
407+
context.statusCode = resp.status;
405408

406409
if (Math.floor(resp.status / 100) !== 2) {
407410
await this.callMiddleware(this.afterMiddleware, context);

samples/empty_root/clients/ts/api_client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export interface MiddlewareContext {
2121
response?: unknown;
2222
responseBody?: string;
2323
responseHeaders?: Headers;
24+
statusCode?: number;
2425
baseURL: string;
2526
headers: {[key: string]: string};
2627
options: {[key: string]: any};
@@ -170,6 +171,7 @@ class FooBarClient {
170171
const responseText = await resp.text();
171172
context.responseBody = responseText;
172173
context.responseHeaders = resp.headers;
174+
context.statusCode = resp.status;
173175

174176
if (Math.floor(resp.status / 100) !== 2) {
175177
await this.callMiddleware(this.afterMiddleware, context);

samples/standard/clients/ts/api_client.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export interface MiddlewareContext {
7070
response?: unknown;
7171
responseBody?: string;
7272
responseHeaders?: Headers;
73+
statusCode?: number;
7374
baseURL: string;
7475
headers: {[key: string]: string};
7576
options: {[key: string]: any};
@@ -253,6 +254,7 @@ class ServiceClient {
253254
const responseText = await resp.text();
254255
context.responseBody = responseText;
255256
context.responseHeaders = resp.headers;
257+
context.statusCode = resp.status;
256258

257259
if (Math.floor(resp.status / 100) !== 2) {
258260
await this.callMiddleware(this.afterMiddleware, context);
@@ -405,6 +407,7 @@ class ServiceGroupsClient {
405407
const responseText = await resp.text();
406408
context.responseBody = responseText;
407409
context.responseHeaders = resp.headers;
410+
context.statusCode = resp.status;
408411

409412
if (Math.floor(resp.status / 100) !== 2) {
410413
await this.callMiddleware(this.afterMiddleware, context);
@@ -600,6 +603,7 @@ class ServiceStaticPageClient {
600603
const responseText = await resp.text();
601604
context.responseBody = responseText;
602605
context.responseHeaders = resp.headers;
606+
context.statusCode = resp.status;
603607

604608
if (Math.floor(resp.status / 100) !== 2) {
605609
await this.callMiddleware(this.afterMiddleware, context);
@@ -805,6 +809,7 @@ class ServiceUser2Client {
805809
const responseText = await resp.text();
806810
context.responseBody = responseText;
807811
context.responseHeaders = resp.headers;
812+
context.statusCode = resp.status;
808813

809814
if (Math.floor(resp.status / 100) !== 2) {
810815
await this.callMiddleware(this.afterMiddleware, context);
@@ -889,6 +894,7 @@ class ServiceUser2Client {
889894
const responseText = await resp.text();
890895
context.responseBody = responseText;
891896
context.responseHeaders = resp.headers;
897+
context.statusCode = resp.status;
892898

893899
if (Math.floor(resp.status / 100) !== 2) {
894900
await this.callMiddleware(this.afterMiddleware, context);
@@ -989,6 +995,7 @@ class ServiceUser2Client {
989995
const responseText = await resp.text();
990996
context.responseBody = responseText;
991997
context.responseHeaders = resp.headers;
998+
context.statusCode = resp.status;
992999

9931000
if (Math.floor(resp.status / 100) !== 2) {
9941001
await this.callMiddleware(this.afterMiddleware, context);
@@ -1075,6 +1082,7 @@ class ServiceUser2Client {
10751082
const responseText = await resp.text();
10761083
context.responseBody = responseText;
10771084
context.responseHeaders = resp.headers;
1085+
context.statusCode = resp.status;
10781086

10791087
if (Math.floor(resp.status / 100) !== 2) {
10801088
await this.callMiddleware(this.afterMiddleware, context);
@@ -1224,6 +1232,7 @@ class ServiceUser2UserIDClient {
12241232
const responseText = await resp.text();
12251233
context.responseBody = responseText;
12261234
context.responseHeaders = resp.headers;
1235+
context.statusCode = resp.status;
12271236

12281237
if (Math.floor(resp.status / 100) !== 2) {
12291238
await this.callMiddleware(this.afterMiddleware, context);
@@ -1364,6 +1373,7 @@ class ServiceUser2UserIDJobIDClient {
13641373
const responseText = await resp.text();
13651374
context.responseBody = responseText;
13661375
context.responseHeaders = resp.headers;
1376+
context.statusCode = resp.status;
13671377

13681378
if (Math.floor(resp.status / 100) !== 2) {
13691379
await this.callMiddleware(this.afterMiddleware, context);
@@ -1505,6 +1515,7 @@ class ServiceUserClient {
15051515
const responseText = await resp.text();
15061516
context.responseBody = responseText;
15071517
context.responseHeaders = resp.headers;
1518+
context.statusCode = resp.status;
15081519

15091520
if (Math.floor(resp.status / 100) !== 2) {
15101521
await this.callMiddleware(this.afterMiddleware, context);
@@ -1591,6 +1602,7 @@ class ServiceUserClient {
15911602
const responseText = await resp.text();
15921603
context.responseBody = responseText;
15931604
context.responseHeaders = resp.headers;
1605+
context.statusCode = resp.status;
15941606

15951607
if (Math.floor(resp.status / 100) !== 2) {
15961608
await this.callMiddleware(this.afterMiddleware, context);
@@ -1677,6 +1689,7 @@ class ServiceUserClient {
16771689
const responseText = await resp.text();
16781690
context.responseBody = responseText;
16791691
context.responseHeaders = resp.headers;
1692+
context.statusCode = resp.status;
16801693

16811694
if (Math.floor(resp.status / 100) !== 2) {
16821695
await this.callMiddleware(this.afterMiddleware, context);
@@ -1876,6 +1889,7 @@ export class APIClient {
18761889
const responseText = await resp.text();
18771890
context.responseBody = responseText;
18781891
context.responseHeaders = resp.headers;
1892+
context.statusCode = resp.status;
18791893

18801894
if (Math.floor(resp.status / 100) !== 2) {
18811895
await this.callMiddleware(this.afterMiddleware, context);
@@ -1982,6 +1996,7 @@ export class APIClient {
19821996
const responseText = await resp.text();
19831997
context.responseBody = responseText;
19841998
context.responseHeaders = resp.headers;
1999+
context.statusCode = resp.status;
19852000

19862001
if (Math.floor(resp.status / 100) !== 2) {
19872002
await this.callMiddleware(this.afterMiddleware, context);
@@ -2074,6 +2089,7 @@ export class APIClient {
20742089
const responseText = await resp.text();
20752090
context.responseBody = responseText;
20762091
context.responseHeaders = resp.headers;
2092+
context.statusCode = resp.status;
20772093

20782094
if (Math.floor(resp.status / 100) !== 2) {
20792095
await this.callMiddleware(this.afterMiddleware, context);

0 commit comments

Comments
 (0)