@@ -1875,4 +1875,167 @@ public static ChannelMemberPartialUpdateRequest unarchive(
18751875 public static MarkDeliveredRequest markDelivered () {
18761876 return new MarkDeliveredRequest ();
18771877 }
1878+
1879+ /** Channel batch operation types */
1880+ public enum ChannelBatchOperation {
1881+ @ JsonProperty ("addMembers" )
1882+ ADD_MEMBERS ,
1883+ @ JsonProperty ("removeMembers" )
1884+ REMOVE_MEMBERS ,
1885+ @ JsonProperty ("inviteMembers" )
1886+ INVITE_MEMBERS ,
1887+ @ JsonProperty ("assignRoles" )
1888+ ASSIGN_ROLES ,
1889+ @ JsonProperty ("addModerators" )
1890+ ADD_MODERATORS ,
1891+ @ JsonProperty ("demoteModerators" )
1892+ DEMOTE_MODERATORS ,
1893+ @ JsonProperty ("hide" )
1894+ HIDE ,
1895+ @ JsonProperty ("show" )
1896+ SHOW ,
1897+ @ JsonProperty ("archive" )
1898+ ARCHIVE ,
1899+ @ JsonProperty ("unarchive" )
1900+ UNARCHIVE ,
1901+ @ JsonProperty ("updateData" )
1902+ UPDATE_DATA ,
1903+ @ JsonProperty ("addFilterTags" )
1904+ ADD_FILTER_TAGS ,
1905+ @ JsonProperty ("removeFilterTags" )
1906+ REMOVE_FILTER_TAGS
1907+ }
1908+
1909+ /** Represents a member in batch operations */
1910+ @ Data
1911+ @ NoArgsConstructor
1912+ @ AllArgsConstructor
1913+ public static class ChannelBatchMemberRequest {
1914+ @ NotNull
1915+ @ JsonProperty ("user_id" )
1916+ private String userId ;
1917+
1918+ @ Nullable
1919+ @ JsonProperty ("channel_role" )
1920+ private String channelRole ;
1921+ }
1922+
1923+ /** Represents data that can be updated on channels in batch */
1924+ @ Data
1925+ @ NoArgsConstructor
1926+ public static class ChannelDataUpdate {
1927+ @ Nullable
1928+ @ JsonProperty ("frozen" )
1929+ private Boolean frozen ;
1930+
1931+ @ Nullable
1932+ @ JsonProperty ("disabled" )
1933+ private Boolean disabled ;
1934+
1935+ @ Nullable
1936+ @ JsonProperty ("custom" )
1937+ private Map <String , Object > custom ;
1938+
1939+ @ Nullable
1940+ @ JsonProperty ("team" )
1941+ private String team ;
1942+
1943+ @ Nullable
1944+ @ JsonProperty ("config_overrides" )
1945+ private Map <String , Object > configOverrides ;
1946+
1947+ @ Nullable
1948+ @ JsonProperty ("auto_translation_enabled" )
1949+ private Boolean autoTranslationEnabled ;
1950+
1951+ @ Nullable
1952+ @ JsonProperty ("auto_translation_language" )
1953+ private String autoTranslationLanguage ;
1954+ }
1955+
1956+ /** Represents filters for batch channel updates */
1957+ @ Data
1958+ @ NoArgsConstructor
1959+ @ JsonInclude (JsonInclude .Include .NON_NULL )
1960+ public static class ChannelsBatchFilters {
1961+ @ Nullable
1962+ @ JsonProperty ("cids" )
1963+ private Object cids ;
1964+
1965+ @ Nullable
1966+ @ JsonProperty ("types" )
1967+ private Object types ;
1968+
1969+ @ Nullable
1970+ @ JsonProperty ("filter_tags" )
1971+ private Object filterTags ;
1972+ }
1973+
1974+ /** Represents options for batch channel updates */
1975+ @ Data
1976+ @ NoArgsConstructor
1977+ public static class ChannelsBatchOptions {
1978+ @ NotNull
1979+ @ JsonProperty ("operation" )
1980+ private ChannelBatchOperation operation ;
1981+
1982+ @ NotNull
1983+ @ JsonProperty ("filter" )
1984+ private ChannelsBatchFilters filter ;
1985+
1986+ @ Nullable
1987+ @ JsonProperty ("members" )
1988+ private List <ChannelBatchMemberRequest > members ;
1989+
1990+ @ Nullable
1991+ @ JsonProperty ("data" )
1992+ private ChannelDataUpdate data ;
1993+
1994+ @ Nullable
1995+ @ JsonProperty ("filter_tags_update" )
1996+ private List <String > filterTagsUpdate ;
1997+ }
1998+
1999+ @ Getter
2000+ @ EqualsAndHashCode
2001+ @ RequiredArgsConstructor
2002+ public static class ChannelsBatchUpdateRequest
2003+ extends StreamRequest <ChannelsBatchUpdateResponse > {
2004+ @ NotNull private ChannelsBatchOptions options ;
2005+
2006+ @ Override
2007+ protected Call <ChannelsBatchUpdateResponse > generateCall (Client client ) throws StreamException {
2008+ return client .create (ChannelService .class ).updateBatch (this .options );
2009+ }
2010+ }
2011+
2012+ @ Data
2013+ @ NoArgsConstructor
2014+ @ EqualsAndHashCode (callSuper = true )
2015+ public static class ChannelsBatchUpdateResponse extends StreamResponseObject {
2016+ @ NotNull
2017+ @ JsonProperty ("task_id" )
2018+ private String taskId ;
2019+ }
2020+
2021+ /**
2022+ * Creates a batch update request
2023+ *
2024+ * @param options the batch update options
2025+ * @return the created request
2026+ */
2027+ @ NotNull
2028+ public static ChannelsBatchUpdateRequest updateBatch (@ NotNull ChannelsBatchOptions options ) {
2029+ return new ChannelsBatchUpdateRequest (options );
2030+ }
2031+
2032+ /**
2033+ * Returns a ChannelBatchUpdater instance for batch channel operations.
2034+ *
2035+ * @return ChannelBatchUpdater instance
2036+ */
2037+ @ NotNull
2038+ public static ChannelBatchUpdater channelBatchUpdater () {
2039+ return new ChannelBatchUpdater ();
2040+ }
18782041}
0 commit comments