Skip to content

Commit 40a65d2

Browse files
authored
feat: add method and request/response for new endpoint (#126)
1 parent 9df1cfc commit 40a65d2

File tree

4 files changed

+436
-17
lines changed

4 files changed

+436
-17
lines changed

src/gen/common/CommonApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ export class CommonApi {
132132
sqs_key: request?.sqs_key,
133133
sqs_secret: request?.sqs_secret,
134134
sqs_url: request?.sqs_url,
135+
user_response_time_enabled: request?.user_response_time_enabled,
135136
webhook_url: request?.webhook_url,
136137
allowed_flag_reasons: request?.allowed_flag_reasons,
137138
event_hooks: request?.event_hooks,
@@ -1379,7 +1380,6 @@ export class CommonApi {
13791380
user_id: request?.user_id,
13801381
};
13811382
const body = {
1382-
created_by_device_id: request?.created_by_device_id,
13831383
message_id: request?.message_id,
13841384
end_at: request?.end_at,
13851385
latitude: request?.latitude,

src/gen/feeds/FeedsApi.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ import {
4747
GetFollowSuggestionsResponse,
4848
GetOrCreateFeedRequest,
4949
GetOrCreateFeedResponse,
50+
GetOrCreateFeedViewRequest,
51+
GetOrCreateFeedViewResponse,
5052
ListFeedGroupsResponse,
5153
ListFeedViewsResponse,
5254
MarkActivityRequest,
@@ -1183,6 +1185,7 @@ export class FeedsApi {
11831185
mark_all_seen: request?.mark_all_seen,
11841186
user_id: request?.user_id,
11851187
mark_read: request?.mark_read,
1188+
mark_seen: request?.mark_seen,
11861189
mark_watched: request?.mark_watched,
11871190
user: request?.user,
11881191
};
@@ -1487,6 +1490,35 @@ export class FeedsApi {
14871490
return { ...response.body, metadata: response.metadata };
14881491
}
14891492

1493+
async getOrCreateFeedView(
1494+
request: GetOrCreateFeedViewRequest & { view_id: string },
1495+
): Promise<StreamResponse<GetOrCreateFeedViewResponse>> {
1496+
const pathParams = {
1497+
view_id: request?.view_id,
1498+
};
1499+
const body = {
1500+
activity_processors: request?.activity_processors,
1501+
activity_selectors: request?.activity_selectors,
1502+
aggregation: request?.aggregation,
1503+
ranking: request?.ranking,
1504+
};
1505+
1506+
const response = await this.apiClient.sendRequest<
1507+
StreamResponse<GetOrCreateFeedViewResponse>
1508+
>(
1509+
'POST',
1510+
'/api/v2/feeds/feed_views/{view_id}',
1511+
pathParams,
1512+
undefined,
1513+
body,
1514+
'application/json',
1515+
);
1516+
1517+
decoders.GetOrCreateFeedViewResponse?.(response.body);
1518+
1519+
return { ...response.body, metadata: response.metadata };
1520+
}
1521+
14901522
async updateFeedView(
14911523
request: UpdateFeedViewRequest & { view_id: string },
14921524
): Promise<StreamResponse<UpdateFeedViewResponse>> {

src/gen/model-decoders/decoders.ts

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,15 @@ decoders.CallSessionEndedEvent = (input?: Record<string, any>) => {
917917
return decode(typeMappings, input);
918918
};
919919

920+
decoders.CallSessionParticipantCountsUpdatedEvent = (
921+
input?: Record<string, any>,
922+
) => {
923+
const typeMappings: TypeMapping = {
924+
created_at: { type: 'DatetimeType', isSingle: true },
925+
};
926+
return decode(typeMappings, input);
927+
};
928+
920929
decoders.CallSessionParticipantJoinedEvent = (input?: Record<string, any>) => {
921930
const typeMappings: TypeMapping = {
922931
created_at: { type: 'DatetimeType', isSingle: true },
@@ -1944,6 +1953,8 @@ decoders.FeedResponse = (input?: Record<string, any>) => {
19441953
created_by: { type: 'UserResponse', isSingle: true },
19451954

19461955
deleted_at: { type: 'DatetimeType', isSingle: true },
1956+
1957+
own_follows: { type: 'FollowResponse', isSingle: false },
19471958
};
19481959
return decode(typeMappings, input);
19491960
};
@@ -2290,6 +2301,13 @@ decoders.GetOrCreateFeedResponse = (input?: Record<string, any>) => {
22902301
return decode(typeMappings, input);
22912302
};
22922303

2304+
decoders.GetOrCreateFeedViewResponse = (input?: Record<string, any>) => {
2305+
const typeMappings: TypeMapping = {
2306+
feed_view: { type: 'FeedViewResponse', isSingle: true },
2307+
};
2308+
return decode(typeMappings, input);
2309+
};
2310+
22932311
decoders.GetPushTemplatesResponse = (input?: Record<string, any>) => {
22942312
const typeMappings: TypeMapping = {
22952313
templates: { type: 'PushTemplate', isSingle: false },
@@ -2860,6 +2878,24 @@ decoders.MuteResponse = (input?: Record<string, any>) => {
28602878
return decode(typeMappings, input);
28612879
};
28622880

2881+
decoders.NotificationFeedUpdatedEvent = (input?: Record<string, any>) => {
2882+
const typeMappings: TypeMapping = {
2883+
created_at: { type: 'DatetimeType', isSingle: true },
2884+
2885+
received_at: { type: 'DatetimeType', isSingle: true },
2886+
2887+
aggregated_activities: {
2888+
type: 'AggregatedActivityResponse',
2889+
isSingle: false,
2890+
},
2891+
2892+
notification_status: { type: 'NotificationStatusResponse', isSingle: true },
2893+
2894+
user: { type: 'UserResponseCommonFields', isSingle: true },
2895+
};
2896+
return decode(typeMappings, input);
2897+
};
2898+
28632899
decoders.NotificationMarkUnreadEvent = (input?: Record<string, any>) => {
28642900
const typeMappings: TypeMapping = {
28652901
created_at: { type: 'DatetimeType', isSingle: true },
@@ -2875,6 +2911,8 @@ decoders.NotificationMarkUnreadEvent = (input?: Record<string, any>) => {
28752911

28762912
decoders.NotificationStatusResponse = (input?: Record<string, any>) => {
28772913
const typeMappings: TypeMapping = {
2914+
last_read_at: { type: 'DatetimeType', isSingle: true },
2915+
28782916
last_seen_at: { type: 'DatetimeType', isSingle: true },
28792917
};
28802918
return decode(typeMappings, input);
@@ -3451,6 +3489,39 @@ decoders.RejectFollowResponse = (input?: Record<string, any>) => {
34513489
return decode(typeMappings, input);
34523490
};
34533491

3492+
decoders.ReminderCreatedEvent = (input?: Record<string, any>) => {
3493+
const typeMappings: TypeMapping = {
3494+
created_at: { type: 'DatetimeType', isSingle: true },
3495+
3496+
received_at: { type: 'DatetimeType', isSingle: true },
3497+
3498+
reminder: { type: 'ReminderResponseData', isSingle: true },
3499+
};
3500+
return decode(typeMappings, input);
3501+
};
3502+
3503+
decoders.ReminderDeletedEvent = (input?: Record<string, any>) => {
3504+
const typeMappings: TypeMapping = {
3505+
created_at: { type: 'DatetimeType', isSingle: true },
3506+
3507+
received_at: { type: 'DatetimeType', isSingle: true },
3508+
3509+
reminder: { type: 'ReminderResponseData', isSingle: true },
3510+
};
3511+
return decode(typeMappings, input);
3512+
};
3513+
3514+
decoders.ReminderNotificationEvent = (input?: Record<string, any>) => {
3515+
const typeMappings: TypeMapping = {
3516+
created_at: { type: 'DatetimeType', isSingle: true },
3517+
3518+
received_at: { type: 'DatetimeType', isSingle: true },
3519+
3520+
reminder: { type: 'ReminderResponseData', isSingle: true },
3521+
};
3522+
return decode(typeMappings, input);
3523+
};
3524+
34543525
decoders.ReminderResponseData = (input?: Record<string, any>) => {
34553526
const typeMappings: TypeMapping = {
34563527
created_at: { type: 'DatetimeType', isSingle: true },
@@ -3468,6 +3539,17 @@ decoders.ReminderResponseData = (input?: Record<string, any>) => {
34683539
return decode(typeMappings, input);
34693540
};
34703541

3542+
decoders.ReminderUpdatedEvent = (input?: Record<string, any>) => {
3543+
const typeMappings: TypeMapping = {
3544+
created_at: { type: 'DatetimeType', isSingle: true },
3545+
3546+
received_at: { type: 'DatetimeType', isSingle: true },
3547+
3548+
reminder: { type: 'ReminderResponseData', isSingle: true },
3549+
};
3550+
return decode(typeMappings, input);
3551+
};
3552+
34713553
decoders.ReviewQueueItemNewEvent = (input?: Record<string, any>) => {
34723554
const typeMappings: TypeMapping = {
34733555
created_at: { type: 'DatetimeType', isSingle: true },
@@ -3818,6 +3900,20 @@ decoders.UnblockedUserEvent = (input?: Record<string, any>) => {
38183900
return decode(typeMappings, input);
38193901
};
38203902

3903+
decoders.UnfollowBatchResponse = (input?: Record<string, any>) => {
3904+
const typeMappings: TypeMapping = {
3905+
follows: { type: 'FollowResponse', isSingle: false },
3906+
};
3907+
return decode(typeMappings, input);
3908+
};
3909+
3910+
decoders.UnfollowResponse = (input?: Record<string, any>) => {
3911+
const typeMappings: TypeMapping = {
3912+
follow: { type: 'FollowResponse', isSingle: true },
3913+
};
3914+
return decode(typeMappings, input);
3915+
};
3916+
38213917
decoders.UnpinActivityResponse = (input?: Record<string, any>) => {
38223918
const typeMappings: TypeMapping = {
38233919
activity: { type: 'ActivityResponse', isSingle: true },

0 commit comments

Comments
 (0)