diff --git a/generator/src/main/resources/line-bot-sdk-nodejs-generator/api-single.pebble b/generator/src/main/resources/line-bot-sdk-nodejs-generator/api-single.pebble
index 0783156cc..08daeb585 100644
--- a/generator/src/main/resources/line-bot-sdk-nodejs-generator/api-single.pebble
+++ b/generator/src/main/resources/line-bot-sdk-nodejs-generator/api-single.pebble
@@ -73,7 +73,7 @@ export class {{operations.classname}} {
{% endif -%}
*/
public async {{op.nickname}}({% for param in op.allParams %}{{param.paramName}}{% if not param.required %}?{% endif %}: {{param.dataType}}, {% endfor %}) : Promise<{% if op.returnType %}{{ op.returnType }}{% else %}Types.MessageAPIResponseBase{% endif %}> {
- return (await this.{{op.nickname}}WithHttpInfo({% for param in op.allParams %}{{param.paramName}}, {% endfor %}))[1];
+ return (await this.{{op.nickname}}WithHttpInfo({% for param in op.allParams %}{{param.paramName}}, {% endfor %})).body;
}
/**
@@ -93,7 +93,7 @@ export class {{operations.classname}} {
* @see {{op.summary}} Documentation
{% endif -%}
*/
- public async {{op.nickname}}WithHttpInfo({% for param in op.allParams %}{{param.paramName}}{% if not param.required %}?{% endif %}: {{param.dataType}}, {% endfor %}) : Promise<[Response, {% if op.returnType %}{{ op.returnType }}{% else %}Types.MessageAPIResponseBase{% endif %}]> {
+ public async {{op.nickname}}WithHttpInfo({% for param in op.allParams %}{{param.paramName}}{% if not param.required %}?{% endif %}: {{param.dataType}}, {% endfor %}) : Promise> {
{% if op.isMultipart %}
{% include "./apiBody/multipart.pebble" %}
{% else %}
diff --git a/generator/src/main/resources/line-bot-sdk-nodejs-generator/apiBody/multipart.pebble b/generator/src/main/resources/line-bot-sdk-nodejs-generator/apiBody/multipart.pebble
index cfa33cb77..df550222f 100644
--- a/generator/src/main/resources/line-bot-sdk-nodejs-generator/apiBody/multipart.pebble
+++ b/generator/src/main/resources/line-bot-sdk-nodejs-generator/apiBody/multipart.pebble
@@ -14,4 +14,4 @@
{% endfor %},
form,
);
- return [res, await res.json()];
+ return {httpResponse: res, body: await res.json()};
diff --git a/generator/src/main/resources/line-bot-sdk-nodejs-generator/apiBody/normal.pebble b/generator/src/main/resources/line-bot-sdk-nodejs-generator/apiBody/normal.pebble
index d307ef093..19e4f9b2d 100644
--- a/generator/src/main/resources/line-bot-sdk-nodejs-generator/apiBody/normal.pebble
+++ b/generator/src/main/resources/line-bot-sdk-nodejs-generator/apiBody/normal.pebble
@@ -6,7 +6,7 @@
.replace('{' + "{{param.baseName}}" + '}', String({{param.paramName}}))
{% endfor %}
);
- return [response, convertResponseToReadable(response)];
+ return {httpResponse: response, body: convertResponseToReadable(response)};
{% else %}
{% if op.hasBodyParam %}const params = {{op.bodyParam.paramName}};
{% elseif op.hasFormParams %}const formParams = {
@@ -43,5 +43,5 @@
{% elseif op.hasQueryParams %}queryParams,{% endif %}
{% if op.hasHeaderParams %}{headers: headerParams},{% endif %}
);
- return [res, await res.json()];
+ return {httpResponse: res, body: await res.json()};
{% endif %}
diff --git a/lib/channel-access-token/api/channelAccessTokenClient.ts b/lib/channel-access-token/api/channelAccessTokenClient.ts
index 93acb525c..90f0371e6 100644
--- a/lib/channel-access-token/api/channelAccessTokenClient.ts
+++ b/lib/channel-access-token/api/channelAccessTokenClient.ts
@@ -75,7 +75,7 @@ export class ChannelAccessTokenClient {
clientAssertionType,
clientAssertion,
)
- )[1];
+ ).body;
}
/**
@@ -89,7 +89,7 @@ export class ChannelAccessTokenClient {
public async getsAllValidChannelAccessTokenKeyIdsWithHttpInfo(
clientAssertionType: string,
clientAssertion: string,
- ): Promise<[Response, ChannelAccessTokenKeyIdsResponse]> {
+ ): Promise> {
const queryParams = {
clientAssertionType: clientAssertionType,
clientAssertion: clientAssertion,
@@ -99,7 +99,7 @@ export class ChannelAccessTokenClient {
"/oauth2/v2.1/tokens/kid",
queryParams,
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Issue short-lived channel access token
@@ -120,7 +120,7 @@ export class ChannelAccessTokenClient {
clientId,
clientSecret,
)
- )[1];
+ ).body;
}
/**
@@ -136,7 +136,7 @@ export class ChannelAccessTokenClient {
grantType?: string,
clientId?: string,
clientSecret?: string,
- ): Promise<[Response, IssueShortLivedChannelAccessTokenResponse]> {
+ ): Promise> {
const formParams = {
grant_type: grantType,
client_id: clientId,
@@ -152,7 +152,7 @@ export class ChannelAccessTokenClient {
"/v2/oauth/accessToken",
formParams,
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Issues a channel access token that allows you to specify a desired expiration date. This method lets you use JWT assertion for authentication.
@@ -173,7 +173,7 @@ export class ChannelAccessTokenClient {
clientAssertionType,
clientAssertion,
)
- )[1];
+ ).body;
}
/**
@@ -189,7 +189,7 @@ export class ChannelAccessTokenClient {
grantType?: string,
clientAssertionType?: string,
clientAssertion?: string,
- ): Promise<[Response, IssueChannelAccessTokenResponse]> {
+ ): Promise> {
const formParams = {
grant_type: grantType,
client_assertion_type: clientAssertionType,
@@ -205,7 +205,7 @@ export class ChannelAccessTokenClient {
"/oauth2/v2.1/token",
formParams,
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Issues a new stateless channel access token, which doesn\'t have max active token limit unlike the other token types. The newly issued token is only valid for 15 minutes but can not be revoked until it naturally expires.
@@ -232,7 +232,7 @@ export class ChannelAccessTokenClient {
clientId,
clientSecret,
)
- )[1];
+ ).body;
}
/**
@@ -252,7 +252,7 @@ export class ChannelAccessTokenClient {
clientAssertion?: string,
clientId?: string,
clientSecret?: string,
- ): Promise<[Response, IssueStatelessChannelAccessTokenResponse]> {
+ ): Promise> {
const formParams = {
grant_type: grantType,
client_assertion_type: clientAssertionType,
@@ -267,7 +267,7 @@ export class ChannelAccessTokenClient {
});
const res = await this.httpClient.postForm("/oauth2/v3/token", formParams);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Revoke short-lived or long-lived channel access token
@@ -278,7 +278,7 @@ export class ChannelAccessTokenClient {
public async revokeChannelToken(
accessToken?: string,
): Promise {
- return (await this.revokeChannelTokenWithHttpInfo(accessToken))[1];
+ return (await this.revokeChannelTokenWithHttpInfo(accessToken)).body;
}
/**
@@ -290,7 +290,7 @@ export class ChannelAccessTokenClient {
*/
public async revokeChannelTokenWithHttpInfo(
accessToken?: string,
- ): Promise<[Response, Types.MessageAPIResponseBase]> {
+ ): Promise> {
const formParams = {
access_token: accessToken,
};
@@ -301,7 +301,7 @@ export class ChannelAccessTokenClient {
});
const res = await this.httpClient.postForm("/v2/oauth/revoke", formParams);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Revoke channel access token v2.1
@@ -322,7 +322,7 @@ export class ChannelAccessTokenClient {
clientSecret,
accessToken,
)
- )[1];
+ ).body;
}
/**
@@ -338,7 +338,7 @@ export class ChannelAccessTokenClient {
clientId?: string,
clientSecret?: string,
accessToken?: string,
- ): Promise<[Response, Types.MessageAPIResponseBase]> {
+ ): Promise> {
const formParams = {
client_id: clientId,
client_secret: clientSecret,
@@ -354,7 +354,7 @@ export class ChannelAccessTokenClient {
"/oauth2/v2.1/revoke",
formParams,
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Verify the validity of short-lived and long-lived channel access tokens
@@ -365,7 +365,7 @@ export class ChannelAccessTokenClient {
public async verifyChannelToken(
accessToken?: string,
): Promise {
- return (await this.verifyChannelTokenWithHttpInfo(accessToken))[1];
+ return (await this.verifyChannelTokenWithHttpInfo(accessToken)).body;
}
/**
@@ -377,7 +377,7 @@ export class ChannelAccessTokenClient {
*/
public async verifyChannelTokenWithHttpInfo(
accessToken?: string,
- ): Promise<[Response, VerifyChannelAccessTokenResponse]> {
+ ): Promise> {
const formParams = {
access_token: accessToken,
};
@@ -388,7 +388,7 @@ export class ChannelAccessTokenClient {
});
const res = await this.httpClient.postForm("/v2/oauth/verify", formParams);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* You can verify whether a Channel access token with a user-specified expiration (Channel Access Token v2.1) is valid.
@@ -399,7 +399,7 @@ export class ChannelAccessTokenClient {
public async verifyChannelTokenByJWT(
accessToken: string,
): Promise {
- return (await this.verifyChannelTokenByJWTWithHttpInfo(accessToken))[1];
+ return (await this.verifyChannelTokenByJWTWithHttpInfo(accessToken)).body;
}
/**
@@ -411,12 +411,12 @@ export class ChannelAccessTokenClient {
*/
public async verifyChannelTokenByJWTWithHttpInfo(
accessToken: string,
- ): Promise<[Response, VerifyChannelAccessTokenResponse]> {
+ ): Promise> {
const queryParams = {
accessToken: accessToken,
};
const res = await this.httpClient.get("/oauth2/v2.1/verify", queryParams);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
}
diff --git a/lib/insight/api/insightClient.ts b/lib/insight/api/insightClient.ts
index fd57157fb..e9de618ad 100644
--- a/lib/insight/api/insightClient.ts
+++ b/lib/insight/api/insightClient.ts
@@ -67,7 +67,7 @@ export class InsightClient {
* @see Documentation
*/
public async getFriendsDemographics(): Promise {
- return (await this.getFriendsDemographicsWithHttpInfo())[1];
+ return (await this.getFriendsDemographicsWithHttpInfo()).body;
}
/**
@@ -77,10 +77,10 @@ export class InsightClient {
* @see Documentation
*/
public async getFriendsDemographicsWithHttpInfo(): Promise<
- [Response, GetFriendsDemographicsResponse]
+ Types.ApiResponseType
> {
const res = await this.httpClient.get("/v2/bot/insight/demographic");
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account.
@@ -92,7 +92,7 @@ export class InsightClient {
public async getMessageEvent(
requestId: string,
): Promise {
- return (await this.getMessageEventWithHttpInfo(requestId))[1];
+ return (await this.getMessageEventWithHttpInfo(requestId)).body;
}
/**
@@ -105,7 +105,7 @@ export class InsightClient {
*/
public async getMessageEventWithHttpInfo(
requestId: string,
- ): Promise<[Response, GetMessageEventResponse]> {
+ ): Promise> {
const queryParams = {
requestId: requestId,
};
@@ -114,7 +114,7 @@ export class InsightClient {
"/v2/bot/insight/message/event",
queryParams,
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Returns the number of users who have added the LINE Official Account on or before a specified date.
@@ -126,7 +126,7 @@ export class InsightClient {
public async getNumberOfFollowers(
date?: string,
): Promise {
- return (await this.getNumberOfFollowersWithHttpInfo(date))[1];
+ return (await this.getNumberOfFollowersWithHttpInfo(date)).body;
}
/**
@@ -139,7 +139,7 @@ export class InsightClient {
*/
public async getNumberOfFollowersWithHttpInfo(
date?: string,
- ): Promise<[Response, GetNumberOfFollowersResponse]> {
+ ): Promise> {
const queryParams = {
date: date,
};
@@ -148,7 +148,7 @@ export class InsightClient {
"/v2/bot/insight/followers",
queryParams,
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Returns the number of messages sent from LINE Official Account on a specified day.
@@ -160,7 +160,7 @@ export class InsightClient {
public async getNumberOfMessageDeliveries(
date: string,
): Promise {
- return (await this.getNumberOfMessageDeliveriesWithHttpInfo(date))[1];
+ return (await this.getNumberOfMessageDeliveriesWithHttpInfo(date)).body;
}
/**
@@ -173,7 +173,7 @@ export class InsightClient {
*/
public async getNumberOfMessageDeliveriesWithHttpInfo(
date: string,
- ): Promise<[Response, GetNumberOfMessageDeliveriesResponse]> {
+ ): Promise> {
const queryParams = {
date: date,
};
@@ -182,7 +182,7 @@ export class InsightClient {
"/v2/bot/insight/message/delivery",
queryParams,
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account.
@@ -203,7 +203,7 @@ export class InsightClient {
from,
to,
)
- )[1];
+ ).body;
}
/**
@@ -219,7 +219,7 @@ export class InsightClient {
customAggregationUnit: string,
from: string,
to: string,
- ): Promise<[Response, GetStatisticsPerUnitResponse]> {
+ ): Promise> {
const queryParams = {
customAggregationUnit: customAggregationUnit,
from: from,
@@ -230,6 +230,6 @@ export class InsightClient {
"/v2/bot/insight/message/event/aggregation",
queryParams,
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
}
diff --git a/lib/liff/api/liffClient.ts b/lib/liff/api/liffClient.ts
index 8e809d37d..7cc3a777d 100644
--- a/lib/liff/api/liffClient.ts
+++ b/lib/liff/api/liffClient.ts
@@ -69,7 +69,7 @@ export class LiffClient {
public async addLIFFApp(
addLiffAppRequest: AddLiffAppRequest,
): Promise {
- return (await this.addLIFFAppWithHttpInfo(addLiffAppRequest))[1];
+ return (await this.addLIFFAppWithHttpInfo(addLiffAppRequest)).body;
}
/**
@@ -81,11 +81,11 @@ export class LiffClient {
*/
public async addLIFFAppWithHttpInfo(
addLiffAppRequest: AddLiffAppRequest,
- ): Promise<[Response, AddLiffAppResponse]> {
+ ): Promise> {
const params = addLiffAppRequest;
const res = await this.httpClient.post("/liff/v1/apps", params);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Deletes a LIFF app from a channel.
@@ -97,7 +97,7 @@ export class LiffClient {
public async deleteLIFFApp(
liffId: string,
): Promise {
- return (await this.deleteLIFFAppWithHttpInfo(liffId))[1];
+ return (await this.deleteLIFFAppWithHttpInfo(liffId)).body;
}
/**
@@ -110,11 +110,11 @@ export class LiffClient {
*/
public async deleteLIFFAppWithHttpInfo(
liffId: string,
- ): Promise<[Response, Types.MessageAPIResponseBase]> {
+ ): Promise> {
const res = await this.httpClient.delete(
"/liff/v1/apps/{liffId}".replace("{liffId}", String(liffId)),
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Gets information on all the LIFF apps added to the channel.
@@ -123,7 +123,7 @@ export class LiffClient {
* @see Get all LIFF apps Documentation
*/
public async getAllLIFFApps(): Promise {
- return (await this.getAllLIFFAppsWithHttpInfo())[1];
+ return (await this.getAllLIFFAppsWithHttpInfo()).body;
}
/**
@@ -134,10 +134,10 @@ export class LiffClient {
* @see Get all LIFF apps Documentation
*/
public async getAllLIFFAppsWithHttpInfo(): Promise<
- [Response, GetAllLiffAppsResponse]
+ Types.ApiResponseType
> {
const res = await this.httpClient.get("/liff/v1/apps");
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Update LIFF app settings
@@ -150,9 +150,8 @@ export class LiffClient {
liffId: string,
updateLiffAppRequest: UpdateLiffAppRequest,
): Promise {
- return (
- await this.updateLIFFAppWithHttpInfo(liffId, updateLiffAppRequest)
- )[1];
+ return (await this.updateLIFFAppWithHttpInfo(liffId, updateLiffAppRequest))
+ .body;
}
/**
@@ -166,13 +165,13 @@ export class LiffClient {
public async updateLIFFAppWithHttpInfo(
liffId: string,
updateLiffAppRequest: UpdateLiffAppRequest,
- ): Promise<[Response, Types.MessageAPIResponseBase]> {
+ ): Promise> {
const params = updateLiffAppRequest;
const res = await this.httpClient.put(
"/liff/v1/apps/{liffId}".replace("{liffId}", String(liffId)),
params,
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
}
diff --git a/lib/manage-audience/api/manageAudienceBlobClient.ts b/lib/manage-audience/api/manageAudienceBlobClient.ts
index 88442906a..28597832d 100644
--- a/lib/manage-audience/api/manageAudienceBlobClient.ts
+++ b/lib/manage-audience/api/manageAudienceBlobClient.ts
@@ -76,7 +76,7 @@ export class ManageAudienceBlobClient {
audienceGroupId,
uploadDescription,
)
- )[1];
+ ).body;
}
/**
@@ -92,7 +92,7 @@ export class ManageAudienceBlobClient {
file: Blob,
audienceGroupId?: number,
uploadDescription?: string,
- ): Promise<[Response, Types.MessageAPIResponseBase]> {
+ ): Promise> {
const form = new FormData();
form.append("audienceGroupId", String(audienceGroupId));
form.append("uploadDescription", String(uploadDescription));
@@ -102,7 +102,7 @@ export class ManageAudienceBlobClient {
"/v2/bot/audienceGroup/upload/byFile",
form,
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Create audience for uploading user IDs (by file).
@@ -126,7 +126,7 @@ export class ManageAudienceBlobClient {
isIfaAudience,
uploadDescription,
)
- )[1];
+ ).body;
}
/**
@@ -144,7 +144,7 @@ export class ManageAudienceBlobClient {
description?: string,
isIfaAudience?: boolean,
uploadDescription?: string,
- ): Promise<[Response, CreateAudienceGroupResponse]> {
+ ): Promise> {
const form = new FormData();
form.append("description", String(description));
form.append("isIfaAudience", String(isIfaAudience));
@@ -155,6 +155,6 @@ export class ManageAudienceBlobClient {
"/v2/bot/audienceGroup/upload/byFile",
form,
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
}
diff --git a/lib/manage-audience/api/manageAudienceClient.ts b/lib/manage-audience/api/manageAudienceClient.ts
index 5ab38fb12..e6f5e49c7 100644
--- a/lib/manage-audience/api/manageAudienceClient.ts
+++ b/lib/manage-audience/api/manageAudienceClient.ts
@@ -80,7 +80,7 @@ export class ManageAudienceClient {
public async activateAudienceGroup(
audienceGroupId: number,
): Promise {
- return (await this.activateAudienceGroupWithHttpInfo(audienceGroupId))[1];
+ return (await this.activateAudienceGroupWithHttpInfo(audienceGroupId)).body;
}
/**
@@ -92,14 +92,14 @@ export class ManageAudienceClient {
*/
public async activateAudienceGroupWithHttpInfo(
audienceGroupId: number,
- ): Promise<[Response, Types.MessageAPIResponseBase]> {
+ ): Promise> {
const res = await this.httpClient.put(
"/v2/bot/audienceGroup/{audienceGroupId}/activate".replace(
"{audienceGroupId}",
String(audienceGroupId),
),
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON)
@@ -114,7 +114,7 @@ export class ManageAudienceClient {
await this.addAudienceToAudienceGroupWithHttpInfo(
addAudienceToAudienceGroupRequest,
)
- )[1];
+ ).body;
}
/**
@@ -126,14 +126,14 @@ export class ManageAudienceClient {
*/
public async addAudienceToAudienceGroupWithHttpInfo(
addAudienceToAudienceGroupRequest: AddAudienceToAudienceGroupRequest,
- ): Promise<[Response, Types.MessageAPIResponseBase]> {
+ ): Promise> {
const params = addAudienceToAudienceGroupRequest;
const res = await this.httpClient.put(
"/v2/bot/audienceGroup/upload",
params,
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Create audience for uploading user IDs (by JSON)
@@ -146,7 +146,7 @@ export class ManageAudienceClient {
): Promise {
return (
await this.createAudienceGroupWithHttpInfo(createAudienceGroupRequest)
- )[1];
+ ).body;
}
/**
@@ -158,14 +158,14 @@ export class ManageAudienceClient {
*/
public async createAudienceGroupWithHttpInfo(
createAudienceGroupRequest: CreateAudienceGroupRequest,
- ): Promise<[Response, CreateAudienceGroupResponse]> {
+ ): Promise> {
const params = createAudienceGroupRequest;
const res = await this.httpClient.post(
"/v2/bot/audienceGroup/upload",
params,
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Create audience for click-based retargeting
@@ -180,7 +180,7 @@ export class ManageAudienceClient {
await this.createClickBasedAudienceGroupWithHttpInfo(
createClickBasedAudienceGroupRequest,
)
- )[1];
+ ).body;
}
/**
@@ -192,14 +192,14 @@ export class ManageAudienceClient {
*/
public async createClickBasedAudienceGroupWithHttpInfo(
createClickBasedAudienceGroupRequest: CreateClickBasedAudienceGroupRequest,
- ): Promise<[Response, CreateClickBasedAudienceGroupResponse]> {
+ ): Promise> {
const params = createClickBasedAudienceGroupRequest;
const res = await this.httpClient.post(
"/v2/bot/audienceGroup/click",
params,
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Create audience for impression-based retargeting
@@ -214,7 +214,7 @@ export class ManageAudienceClient {
await this.createImpBasedAudienceGroupWithHttpInfo(
createImpBasedAudienceGroupRequest,
)
- )[1];
+ ).body;
}
/**
@@ -226,11 +226,11 @@ export class ManageAudienceClient {
*/
public async createImpBasedAudienceGroupWithHttpInfo(
createImpBasedAudienceGroupRequest: CreateImpBasedAudienceGroupRequest,
- ): Promise<[Response, CreateImpBasedAudienceGroupResponse]> {
+ ): Promise> {
const params = createImpBasedAudienceGroupRequest;
const res = await this.httpClient.post("/v2/bot/audienceGroup/imp", params);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Delete audience
@@ -241,7 +241,7 @@ export class ManageAudienceClient {
public async deleteAudienceGroup(
audienceGroupId: number,
): Promise {
- return (await this.deleteAudienceGroupWithHttpInfo(audienceGroupId))[1];
+ return (await this.deleteAudienceGroupWithHttpInfo(audienceGroupId)).body;
}
/**
@@ -253,14 +253,14 @@ export class ManageAudienceClient {
*/
public async deleteAudienceGroupWithHttpInfo(
audienceGroupId: number,
- ): Promise<[Response, Types.MessageAPIResponseBase]> {
+ ): Promise> {
const res = await this.httpClient.delete(
"/v2/bot/audienceGroup/{audienceGroupId}".replace(
"{audienceGroupId}",
String(audienceGroupId),
),
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Gets audience data.
@@ -271,7 +271,7 @@ export class ManageAudienceClient {
public async getAudienceData(
audienceGroupId: number,
): Promise {
- return (await this.getAudienceDataWithHttpInfo(audienceGroupId))[1];
+ return (await this.getAudienceDataWithHttpInfo(audienceGroupId)).body;
}
/**
@@ -283,14 +283,14 @@ export class ManageAudienceClient {
*/
public async getAudienceDataWithHttpInfo(
audienceGroupId: number,
- ): Promise<[Response, GetAudienceDataResponse]> {
+ ): Promise> {
const res = await this.httpClient.get(
"/v2/bot/audienceGroup/{audienceGroupId}".replace(
"{audienceGroupId}",
String(audienceGroupId),
),
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Get the authority level of the audience
@@ -298,7 +298,7 @@ export class ManageAudienceClient {
* @see Documentation
*/
public async getAudienceGroupAuthorityLevel(): Promise {
- return (await this.getAudienceGroupAuthorityLevelWithHttpInfo())[1];
+ return (await this.getAudienceGroupAuthorityLevelWithHttpInfo()).body;
}
/**
@@ -308,12 +308,12 @@ export class ManageAudienceClient {
* @see Documentation
*/
public async getAudienceGroupAuthorityLevelWithHttpInfo(): Promise<
- [Response, GetAudienceGroupAuthorityLevelResponse]
+ Types.ApiResponseType
> {
const res = await this.httpClient.get(
"/v2/bot/audienceGroup/authorityLevel",
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Gets data for more than one audience.
@@ -343,7 +343,7 @@ export class ManageAudienceClient {
includesExternalPublicGroups,
createRoute,
)
- )[1];
+ ).body;
}
/**
@@ -365,7 +365,7 @@ export class ManageAudienceClient {
size?: number,
includesExternalPublicGroups?: boolean,
createRoute?: AudienceGroupCreateRoute,
- ): Promise<[Response, GetAudienceGroupsResponse]> {
+ ): Promise> {
const queryParams = {
page: page,
description: description,
@@ -379,7 +379,7 @@ export class ManageAudienceClient {
"/v2/bot/audienceGroup/list",
queryParams,
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Change the authority level of the audience
@@ -394,7 +394,7 @@ export class ManageAudienceClient {
await this.updateAudienceGroupAuthorityLevelWithHttpInfo(
updateAudienceGroupAuthorityLevelRequest,
)
- )[1];
+ ).body;
}
/**
@@ -406,14 +406,14 @@ export class ManageAudienceClient {
*/
public async updateAudienceGroupAuthorityLevelWithHttpInfo(
updateAudienceGroupAuthorityLevelRequest: UpdateAudienceGroupAuthorityLevelRequest,
- ): Promise<[Response, Types.MessageAPIResponseBase]> {
+ ): Promise> {
const params = updateAudienceGroupAuthorityLevelRequest;
const res = await this.httpClient.put(
"/v2/bot/audienceGroup/authorityLevel",
params,
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Renames an existing audience.
@@ -431,7 +431,7 @@ export class ManageAudienceClient {
audienceGroupId,
updateAudienceGroupDescriptionRequest,
)
- )[1];
+ ).body;
}
/**
@@ -445,7 +445,7 @@ export class ManageAudienceClient {
public async updateAudienceGroupDescriptionWithHttpInfo(
audienceGroupId: number,
updateAudienceGroupDescriptionRequest: UpdateAudienceGroupDescriptionRequest,
- ): Promise<[Response, Types.MessageAPIResponseBase]> {
+ ): Promise> {
const params = updateAudienceGroupDescriptionRequest;
const res = await this.httpClient.put(
@@ -455,6 +455,6 @@ export class ManageAudienceClient {
),
params,
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
}
diff --git a/lib/messaging-api/api/messagingApiBlobClient.ts b/lib/messaging-api/api/messagingApiBlobClient.ts
index 366c91206..d25338488 100644
--- a/lib/messaging-api/api/messagingApiBlobClient.ts
+++ b/lib/messaging-api/api/messagingApiBlobClient.ts
@@ -64,7 +64,7 @@ export class MessagingApiBlobClient {
* @see Documentation
*/
public async getMessageContent(messageId: string): Promise {
- return (await this.getMessageContentWithHttpInfo(messageId))[1];
+ return (await this.getMessageContentWithHttpInfo(messageId)).body;
}
/**
@@ -76,14 +76,17 @@ export class MessagingApiBlobClient {
*/
public async getMessageContentWithHttpInfo(
messageId: string,
- ): Promise<[Response, Readable]> {
+ ): Promise> {
const response = await this.httpClient.get(
"/v2/bot/message/{messageId}/content".replace(
"{" + "messageId" + "}",
String(messageId),
),
);
- return [response, convertResponseToReadable(response)];
+ return {
+ httpResponse: response,
+ body: convertResponseToReadable(response),
+ };
}
/**
* Get a preview image of the image or video
@@ -92,7 +95,7 @@ export class MessagingApiBlobClient {
* @see Documentation
*/
public async getMessageContentPreview(messageId: string): Promise {
- return (await this.getMessageContentPreviewWithHttpInfo(messageId))[1];
+ return (await this.getMessageContentPreviewWithHttpInfo(messageId)).body;
}
/**
@@ -104,14 +107,17 @@ export class MessagingApiBlobClient {
*/
public async getMessageContentPreviewWithHttpInfo(
messageId: string,
- ): Promise<[Response, Readable]> {
+ ): Promise> {
const response = await this.httpClient.get(
"/v2/bot/message/{messageId}/content/preview".replace(
"{" + "messageId" + "}",
String(messageId),
),
);
- return [response, convertResponseToReadable(response)];
+ return {
+ httpResponse: response,
+ body: convertResponseToReadable(response),
+ };
}
/**
* Verify the preparation status of a video or audio for getting
@@ -124,7 +130,7 @@ export class MessagingApiBlobClient {
): Promise {
return (
await this.getMessageContentTranscodingByMessageIdWithHttpInfo(messageId)
- )[1];
+ ).body;
}
/**
@@ -136,14 +142,14 @@ export class MessagingApiBlobClient {
*/
public async getMessageContentTranscodingByMessageIdWithHttpInfo(
messageId: string,
- ): Promise<[Response, GetMessageContentTranscodingResponse]> {
+ ): Promise> {
const res = await this.httpClient.get(
"/v2/bot/message/{messageId}/content/transcoding".replace(
"{messageId}",
String(messageId),
),
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Download rich menu image.
@@ -152,7 +158,7 @@ export class MessagingApiBlobClient {
* @see Documentation
*/
public async getRichMenuImage(richMenuId: string): Promise {
- return (await this.getRichMenuImageWithHttpInfo(richMenuId))[1];
+ return (await this.getRichMenuImageWithHttpInfo(richMenuId)).body;
}
/**
@@ -164,14 +170,17 @@ export class MessagingApiBlobClient {
*/
public async getRichMenuImageWithHttpInfo(
richMenuId: string,
- ): Promise<[Response, Readable]> {
+ ): Promise> {
const response = await this.httpClient.get(
"/v2/bot/richmenu/{richMenuId}/content".replace(
"{" + "richMenuId" + "}",
String(richMenuId),
),
);
- return [response, convertResponseToReadable(response)];
+ return {
+ httpResponse: response,
+ body: convertResponseToReadable(response),
+ };
}
/**
* Upload rich menu image
@@ -184,7 +193,7 @@ export class MessagingApiBlobClient {
richMenuId: string,
body?: Blob,
): Promise {
- return (await this.setRichMenuImageWithHttpInfo(richMenuId, body))[1];
+ return (await this.setRichMenuImageWithHttpInfo(richMenuId, body)).body;
}
/**
@@ -198,7 +207,7 @@ export class MessagingApiBlobClient {
public async setRichMenuImageWithHttpInfo(
richMenuId: string,
body?: Blob,
- ): Promise<[Response, Types.MessageAPIResponseBase]> {
+ ): Promise> {
const params = body;
const res = await this.httpClient.postBinaryContent(
@@ -208,6 +217,6 @@ export class MessagingApiBlobClient {
),
params,
);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
}
diff --git a/lib/messaging-api/api/messagingApiClient.ts b/lib/messaging-api/api/messagingApiClient.ts
index d1a1ae6fa..b3c21673b 100644
--- a/lib/messaging-api/api/messagingApiClient.ts
+++ b/lib/messaging-api/api/messagingApiClient.ts
@@ -109,9 +109,8 @@ export class MessagingApiClient {
public async audienceMatch(
audienceMatchMessagesRequest: AudienceMatchMessagesRequest,
): Promise {
- return (
- await this.audienceMatchWithHttpInfo(audienceMatchMessagesRequest)
- )[1];
+ return (await this.audienceMatchWithHttpInfo(audienceMatchMessagesRequest))
+ .body;
}
/**
@@ -123,11 +122,11 @@ export class MessagingApiClient {
*/
public async audienceMatchWithHttpInfo(
audienceMatchMessagesRequest: AudienceMatchMessagesRequest,
- ): Promise<[Response, Types.MessageAPIResponseBase]> {
+ ): Promise> {
const params = audienceMatchMessagesRequest;
const res = await this.httpClient.post("/bot/ad/multicast/phone", params);
- return [res, await res.json()];
+ return { httpResponse: res, body: await res.json() };
}
/**
* Sends a message to multiple users at any time.
@@ -140,9 +139,8 @@ export class MessagingApiClient {
broadcastRequest: BroadcastRequest,
xLineRetryKey?: string,
): Promise