@@ -19,6 +19,8 @@ import {
1919 AddReactionRequest ,
2020 AddReactionResponse ,
2121 CastPollVoteRequest ,
22+ CreateCollectionsRequest ,
23+ CreateCollectionsResponse ,
2224 CreateFeedGroupRequest ,
2325 CreateFeedGroupResponse ,
2426 CreateFeedViewRequest ,
@@ -33,6 +35,7 @@ import {
3335 DeleteActivityResponse ,
3436 DeleteBookmarkFolderResponse ,
3537 DeleteBookmarkResponse ,
38+ DeleteCollectionsResponse ,
3639 DeleteCommentReactionResponse ,
3740 DeleteCommentResponse ,
3841 DeleteFeedGroupResponse ,
@@ -89,6 +92,7 @@ import {
8992 QueryFollowsResponse ,
9093 QueryMembershipLevelsRequest ,
9194 QueryMembershipLevelsResponse ,
95+ ReadCollectionsResponse ,
9296 RejectFeedMemberInviteRequest ,
9397 RejectFeedMemberInviteResponse ,
9498 RejectFollowRequest ,
@@ -107,6 +111,8 @@ import {
107111 UpdateBookmarkFolderResponse ,
108112 UpdateBookmarkRequest ,
109113 UpdateBookmarkResponse ,
114+ UpdateCollectionsRequest ,
115+ UpdateCollectionsResponse ,
110116 UpdateCommentRequest ,
111117 UpdateCommentResponse ,
112118 UpdateFeedGroupRequest ,
@@ -125,6 +131,8 @@ import {
125131 UpdateMembershipLevelResponse ,
126132 UpsertActivitiesRequest ,
127133 UpsertActivitiesResponse ,
134+ UpsertCollectionsRequest ,
135+ UpsertCollectionsResponse ,
128136} from '../models' ;
129137import { decoders } from '../model-decoders/decoders' ;
130138
@@ -146,6 +154,7 @@ export class FeedsApi {
146154 visibility : request ?. visibility ,
147155 visibility_tag : request ?. visibility_tag ,
148156 attachments : request ?. attachments ,
157+ collection_refs : request ?. collection_refs ,
149158 filter_tags : request ?. filter_tags ,
150159 interest_tags : request ?. interest_tags ,
151160 mentioned_user_ids : request ?. mentioned_user_ids ,
@@ -592,6 +601,7 @@ export class FeedsApi {
592601 user_id : request ?. user_id ,
593602 visibility : request ?. visibility ,
594603 attachments : request ?. attachments ,
604+ collection_refs : request ?. collection_refs ,
595605 feeds : request ?. feeds ,
596606 filter_tags : request ?. filter_tags ,
597607 interest_tags : request ?. interest_tags ,
@@ -720,6 +730,113 @@ export class FeedsApi {
720730 return { ...response . body , metadata : response . metadata } ;
721731 }
722732
733+ async deleteCollections ( request : {
734+ collection_refs : string [ ] ;
735+ } ) : Promise < StreamResponse < DeleteCollectionsResponse > > {
736+ const queryParams = {
737+ collection_refs : request ?. collection_refs ,
738+ } ;
739+
740+ const response = await this . apiClient . sendRequest <
741+ StreamResponse < DeleteCollectionsResponse >
742+ > ( 'DELETE' , '/api/v2/feeds/collections' , undefined , queryParams ) ;
743+
744+ decoders . DeleteCollectionsResponse ?.( response . body ) ;
745+
746+ return { ...response . body , metadata : response . metadata } ;
747+ }
748+
749+ async readCollections ( request : {
750+ collection_refs : string [ ] ;
751+ user_id ?: string ;
752+ } ) : Promise < StreamResponse < ReadCollectionsResponse > > {
753+ const queryParams = {
754+ collection_refs : request ?. collection_refs ,
755+ user_id : request ?. user_id ,
756+ } ;
757+
758+ const response = await this . apiClient . sendRequest <
759+ StreamResponse < ReadCollectionsResponse >
760+ > ( 'GET' , '/api/v2/feeds/collections' , undefined , queryParams ) ;
761+
762+ decoders . ReadCollectionsResponse ?.( response . body ) ;
763+
764+ return { ...response . body , metadata : response . metadata } ;
765+ }
766+
767+ async updateCollections (
768+ request : UpdateCollectionsRequest ,
769+ ) : Promise < StreamResponse < UpdateCollectionsResponse > > {
770+ const body = {
771+ collections : request ?. collections ,
772+ user_id : request ?. user_id ,
773+ user : request ?. user ,
774+ } ;
775+
776+ const response = await this . apiClient . sendRequest <
777+ StreamResponse < UpdateCollectionsResponse >
778+ > (
779+ 'PATCH' ,
780+ '/api/v2/feeds/collections' ,
781+ undefined ,
782+ undefined ,
783+ body ,
784+ 'application/json' ,
785+ ) ;
786+
787+ decoders . UpdateCollectionsResponse ?.( response . body ) ;
788+
789+ return { ...response . body , metadata : response . metadata } ;
790+ }
791+
792+ async createCollections (
793+ request : CreateCollectionsRequest ,
794+ ) : Promise < StreamResponse < CreateCollectionsResponse > > {
795+ const body = {
796+ collections : request ?. collections ,
797+ user_id : request ?. user_id ,
798+ user : request ?. user ,
799+ } ;
800+
801+ const response = await this . apiClient . sendRequest <
802+ StreamResponse < CreateCollectionsResponse >
803+ > (
804+ 'POST' ,
805+ '/api/v2/feeds/collections' ,
806+ undefined ,
807+ undefined ,
808+ body ,
809+ 'application/json' ,
810+ ) ;
811+
812+ decoders . CreateCollectionsResponse ?.( response . body ) ;
813+
814+ return { ...response . body , metadata : response . metadata } ;
815+ }
816+
817+ async upsertCollections (
818+ request : UpsertCollectionsRequest ,
819+ ) : Promise < StreamResponse < UpsertCollectionsResponse > > {
820+ const body = {
821+ collections : request ?. collections ,
822+ } ;
823+
824+ const response = await this . apiClient . sendRequest <
825+ StreamResponse < UpsertCollectionsResponse >
826+ > (
827+ 'PUT' ,
828+ '/api/v2/feeds/collections' ,
829+ undefined ,
830+ undefined ,
831+ body ,
832+ 'application/json' ,
833+ ) ;
834+
835+ decoders . UpsertCollectionsResponse ?.( response . body ) ;
836+
837+ return { ...response . body , metadata : response . metadata } ;
838+ }
839+
723840 async getComments ( request : {
724841 object_id : string ;
725842 object_type : string ;
0 commit comments