@@ -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
@@ -147,6 +155,7 @@ export class FeedsApi {
147155 visibility : request ?. visibility ,
148156 visibility_tag : request ?. visibility_tag ,
149157 attachments : request ?. attachments ,
158+ collection_refs : request ?. collection_refs ,
150159 filter_tags : request ?. filter_tags ,
151160 interest_tags : request ?. interest_tags ,
152161 mentioned_user_ids : request ?. mentioned_user_ids ,
@@ -594,6 +603,7 @@ export class FeedsApi {
594603 user_id : request ?. user_id ,
595604 visibility : request ?. visibility ,
596605 attachments : request ?. attachments ,
606+ collection_refs : request ?. collection_refs ,
597607 feeds : request ?. feeds ,
598608 filter_tags : request ?. filter_tags ,
599609 interest_tags : request ?. interest_tags ,
@@ -722,6 +732,113 @@ export class FeedsApi {
722732 return { ...response . body , metadata : response . metadata } ;
723733 }
724734
735+ async deleteCollections ( request : {
736+ collection_refs : string [ ] ;
737+ } ) : Promise < StreamResponse < DeleteCollectionsResponse > > {
738+ const queryParams = {
739+ collection_refs : request ?. collection_refs ,
740+ } ;
741+
742+ const response = await this . apiClient . sendRequest <
743+ StreamResponse < DeleteCollectionsResponse >
744+ > ( 'DELETE' , '/api/v2/feeds/collections' , undefined , queryParams ) ;
745+
746+ decoders . DeleteCollectionsResponse ?.( response . body ) ;
747+
748+ return { ...response . body , metadata : response . metadata } ;
749+ }
750+
751+ async readCollections ( request : {
752+ collection_refs : string [ ] ;
753+ user_id ?: string ;
754+ } ) : Promise < StreamResponse < ReadCollectionsResponse > > {
755+ const queryParams = {
756+ collection_refs : request ?. collection_refs ,
757+ user_id : request ?. user_id ,
758+ } ;
759+
760+ const response = await this . apiClient . sendRequest <
761+ StreamResponse < ReadCollectionsResponse >
762+ > ( 'GET' , '/api/v2/feeds/collections' , undefined , queryParams ) ;
763+
764+ decoders . ReadCollectionsResponse ?.( response . body ) ;
765+
766+ return { ...response . body , metadata : response . metadata } ;
767+ }
768+
769+ async updateCollections (
770+ request : UpdateCollectionsRequest ,
771+ ) : Promise < StreamResponse < UpdateCollectionsResponse > > {
772+ const body = {
773+ collections : request ?. collections ,
774+ user_id : request ?. user_id ,
775+ user : request ?. user ,
776+ } ;
777+
778+ const response = await this . apiClient . sendRequest <
779+ StreamResponse < UpdateCollectionsResponse >
780+ > (
781+ 'PATCH' ,
782+ '/api/v2/feeds/collections' ,
783+ undefined ,
784+ undefined ,
785+ body ,
786+ 'application/json' ,
787+ ) ;
788+
789+ decoders . UpdateCollectionsResponse ?.( response . body ) ;
790+
791+ return { ...response . body , metadata : response . metadata } ;
792+ }
793+
794+ async createCollections (
795+ request : CreateCollectionsRequest ,
796+ ) : Promise < StreamResponse < CreateCollectionsResponse > > {
797+ const body = {
798+ collections : request ?. collections ,
799+ user_id : request ?. user_id ,
800+ user : request ?. user ,
801+ } ;
802+
803+ const response = await this . apiClient . sendRequest <
804+ StreamResponse < CreateCollectionsResponse >
805+ > (
806+ 'POST' ,
807+ '/api/v2/feeds/collections' ,
808+ undefined ,
809+ undefined ,
810+ body ,
811+ 'application/json' ,
812+ ) ;
813+
814+ decoders . CreateCollectionsResponse ?.( response . body ) ;
815+
816+ return { ...response . body , metadata : response . metadata } ;
817+ }
818+
819+ async upsertCollections (
820+ request : UpsertCollectionsRequest ,
821+ ) : Promise < StreamResponse < UpsertCollectionsResponse > > {
822+ const body = {
823+ collections : request ?. collections ,
824+ } ;
825+
826+ const response = await this . apiClient . sendRequest <
827+ StreamResponse < UpsertCollectionsResponse >
828+ > (
829+ 'PUT' ,
830+ '/api/v2/feeds/collections' ,
831+ undefined ,
832+ undefined ,
833+ body ,
834+ 'application/json' ,
835+ ) ;
836+
837+ decoders . UpsertCollectionsResponse ?.( response . body ) ;
838+
839+ return { ...response . body , metadata : response . metadata } ;
840+ }
841+
725842 async getComments ( request : {
726843 object_id : string ;
727844 object_type : string ;
0 commit comments