diff --git a/packages/stream_video/lib/open_api/video/coordinator/api.dart b/packages/stream_video/lib/open_api/video/coordinator/api.dart index 1b8751010..e5e4e69ab 100644 --- a/packages/stream_video/lib/open_api/video/coordinator/api.dart +++ b/packages/stream_video/lib/open_api/video/coordinator/api.dart @@ -99,6 +99,7 @@ part 'model/get_call_type_response.dart'; part 'model/get_edges_response.dart'; part 'model/get_or_create_call_request.dart'; part 'model/get_or_create_call_response.dart'; +part 'model/go_live_request.dart'; part 'model/go_live_response.dart'; part 'model/hls_settings.dart'; part 'model/hls_settings_request.dart'; @@ -118,6 +119,8 @@ part 'model/notification_settings_request.dart'; part 'model/own_capability.dart'; part 'model/own_user_response.dart'; part 'model/permission_request_event.dart'; +part 'model/pin_request.dart'; +part 'model/pin_response.dart'; part 'model/query_calls_request.dart'; part 'model/query_calls_response.dart'; part 'model/query_members_request.dart'; @@ -154,6 +157,8 @@ part 'model/transcription_settings_request.dart'; part 'model/unblock_user_request.dart'; part 'model/unblock_user_response.dart'; part 'model/unblocked_user_event.dart'; +part 'model/unpin_request.dart'; +part 'model/unpin_response.dart'; part 'model/update_call_members_request.dart'; part 'model/update_call_members_response.dart'; part 'model/update_call_request.dart'; diff --git a/packages/stream_video/lib/open_api/video/coordinator/api/default_api.dart b/packages/stream_video/lib/open_api/video/coordinator/api/default_api.dart index db96a865f..cb1bd9188 100644 --- a/packages/stream_video/lib/open_api/video/coordinator/api/default_api.dart +++ b/packages/stream_video/lib/open_api/video/coordinator/api/default_api.dart @@ -609,20 +609,22 @@ class DefaultApi { /// * [String] type (required): /// /// * [String] id (required): - Future goLiveWithHttpInfo(String type, String id,) async { + /// + /// * [GoLiveRequest] goLiveRequest (required): + Future goLiveWithHttpInfo(String type, String id, GoLiveRequest goLiveRequest,) async { // ignore: prefer_const_declarations final path = r'/call/{type}/{id}/go_live' .replaceAll('{type}', type) .replaceAll('{id}', id); // ignore: prefer_final_locals - Object? postBody; + Object? postBody = goLiveRequest; final queryParams = []; final headerParams = {}; final formParams = {}; - const contentTypes = []; + const contentTypes = ['application/json']; return apiClient.invokeAPI( @@ -645,8 +647,10 @@ class DefaultApi { /// * [String] type (required): /// /// * [String] id (required): - Future goLive(String type, String id,) async { - final response = await goLiveWithHttpInfo(type, id,); + /// + /// * [GoLiveRequest] goLiveRequest (required): + Future goLive(String type, String id, GoLiveRequest goLiveRequest,) async { + final response = await goLiveWithHttpInfo(type, id, goLiveRequest,); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } @@ -2114,4 +2118,136 @@ class DefaultApi { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } } + + /// Pin + /// + /// Pins a track for all users in the call. Required permissions: - PinCallTrack + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] type (required): + /// + /// * [String] id (required): + /// + /// * [PinRequest] pinRequest (required): + Future videoPinWithHttpInfo(String type, String id, PinRequest pinRequest,) async { + // ignore: prefer_const_declarations + final path = r'/call/{type}/{id}/pin' + .replaceAll('{type}', type) + .replaceAll('{id}', id); + + // ignore: prefer_final_locals + Object? postBody = pinRequest; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = ['application/json']; + + + return apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Pin + /// + /// Pins a track for all users in the call. Required permissions: - PinCallTrack + /// + /// Parameters: + /// + /// * [String] type (required): + /// + /// * [String] id (required): + /// + /// * [PinRequest] pinRequest (required): + Future videoPin(String type, String id, PinRequest pinRequest,) async { + final response = await videoPinWithHttpInfo(type, id, pinRequest,); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PinResponse',) as PinResponse; + + } + return null; + } + + /// Unpin + /// + /// Unpins a track for all users in the call. Required permissions: - PinCallTrack + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] type (required): + /// + /// * [String] id (required): + /// + /// * [UnpinRequest] unpinRequest (required): + Future videoUnpinWithHttpInfo(String type, String id, UnpinRequest unpinRequest,) async { + // ignore: prefer_const_declarations + final path = r'/call/{type}/{id}/unpin' + .replaceAll('{type}', type) + .replaceAll('{id}', id); + + // ignore: prefer_final_locals + Object? postBody = unpinRequest; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = ['application/json']; + + + return apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Unpin + /// + /// Unpins a track for all users in the call. Required permissions: - PinCallTrack + /// + /// Parameters: + /// + /// * [String] type (required): + /// + /// * [String] id (required): + /// + /// * [UnpinRequest] unpinRequest (required): + Future videoUnpin(String type, String id, UnpinRequest unpinRequest,) async { + final response = await videoUnpinWithHttpInfo(type, id, unpinRequest,); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UnpinResponse',) as UnpinResponse; + + } + return null; + } } diff --git a/packages/stream_video/lib/open_api/video/coordinator/api_client.dart b/packages/stream_video/lib/open_api/video/coordinator/api_client.dart index 97228c7f5..8f4df8b9e 100644 --- a/packages/stream_video/lib/open_api/video/coordinator/api_client.dart +++ b/packages/stream_video/lib/open_api/video/coordinator/api_client.dart @@ -319,6 +319,8 @@ class ApiClient { return GetOrCreateCallRequest.fromJson(value); case 'GetOrCreateCallResponse': return GetOrCreateCallResponse.fromJson(value); + case 'GoLiveRequest': + return GoLiveRequest.fromJson(value); case 'GoLiveResponse': return GoLiveResponse.fromJson(value); case 'HLSSettings': @@ -357,6 +359,10 @@ class ApiClient { return OwnUserResponse.fromJson(value); case 'PermissionRequestEvent': return PermissionRequestEvent.fromJson(value); + case 'PinRequest': + return PinRequest.fromJson(value); + case 'PinResponse': + return PinResponse.fromJson(value); case 'QueryCallsRequest': return QueryCallsRequest.fromJson(value); case 'QueryCallsResponse': @@ -429,6 +435,10 @@ class ApiClient { return UnblockUserResponse.fromJson(value); case 'UnblockedUserEvent': return UnblockedUserEvent.fromJson(value); + case 'UnpinRequest': + return UnpinRequest.fromJson(value); + case 'UnpinResponse': + return UnpinResponse.fromJson(value); case 'UpdateCallMembersRequest': return UpdateCallMembersRequest.fromJson(value); case 'UpdateCallMembersResponse': diff --git a/packages/stream_video/lib/open_api/video/coordinator/model/call_ended_event.dart b/packages/stream_video/lib/open_api/video/coordinator/model/call_ended_event.dart index c4b9e5a87..bbefcb85c 100644 --- a/packages/stream_video/lib/open_api/video/coordinator/model/call_ended_event.dart +++ b/packages/stream_video/lib/open_api/video/coordinator/model/call_ended_event.dart @@ -13,12 +13,15 @@ part of openapi.api; class CallEndedEvent { /// Returns a new [CallEndedEvent] instance. CallEndedEvent({ + required this.call, required this.callCid, required this.createdAt, this.type = 'call.ended', this.user, }); + CallResponse call; + String callCid; DateTime createdAt; @@ -36,6 +39,7 @@ class CallEndedEvent { @override bool operator ==(Object other) => identical(this, other) || other is CallEndedEvent && + other.call == call && other.callCid == callCid && other.createdAt == createdAt && other.type == type && @@ -44,16 +48,18 @@ class CallEndedEvent { @override int get hashCode => // ignore: unnecessary_parenthesis + (call.hashCode) + (callCid.hashCode) + (createdAt.hashCode) + (type.hashCode) + (user == null ? 0 : user!.hashCode); @override - String toString() => 'CallEndedEvent[callCid=$callCid, createdAt=$createdAt, type=$type, user=$user]'; + String toString() => 'CallEndedEvent[call=$call, callCid=$callCid, createdAt=$createdAt, type=$type, user=$user]'; Map toJson() { final json = {}; + json[r'call'] = this.call; json[r'call_cid'] = this.callCid; json[r'created_at'] = this.createdAt.toUtc().toIso8601String(); json[r'type'] = this.type; @@ -84,6 +90,7 @@ class CallEndedEvent { }()); return CallEndedEvent( + call: CallResponse.fromJson(json[r'call'])!, callCid: mapValueOfType(json, r'call_cid')!, createdAt: mapDateTime(json, r'created_at', '')!, type: mapValueOfType(json, r'type')!, @@ -137,6 +144,7 @@ class CallEndedEvent { /// The list of required keys that must be present in a JSON. static const requiredKeys = { + 'call', 'call_cid', 'created_at', 'type', diff --git a/packages/stream_video/lib/open_api/video/coordinator/model/call_session_response.dart b/packages/stream_video/lib/open_api/video/coordinator/model/call_session_response.dart index 196212014..e75b3217d 100644 --- a/packages/stream_video/lib/open_api/video/coordinator/model/call_session_response.dart +++ b/packages/stream_video/lib/open_api/video/coordinator/model/call_session_response.dart @@ -16,6 +16,8 @@ class CallSessionResponse { this.acceptedBy = const {}, this.endedAt, required this.id, + this.liveEndedAt, + this.liveStartedAt, this.participants = const [], this.participantsCountByRole = const {}, this.rejectedBy = const {}, @@ -34,6 +36,22 @@ class CallSessionResponse { String id; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + DateTime? liveEndedAt; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + DateTime? liveStartedAt; + List participants; Map participantsCountByRole; @@ -53,6 +71,8 @@ class CallSessionResponse { other.acceptedBy == acceptedBy && other.endedAt == endedAt && other.id == id && + other.liveEndedAt == liveEndedAt && + other.liveStartedAt == liveStartedAt && other.participants == participants && other.participantsCountByRole == participantsCountByRole && other.rejectedBy == rejectedBy && @@ -64,13 +84,15 @@ class CallSessionResponse { (acceptedBy.hashCode) + (endedAt == null ? 0 : endedAt!.hashCode) + (id.hashCode) + + (liveEndedAt == null ? 0 : liveEndedAt!.hashCode) + + (liveStartedAt == null ? 0 : liveStartedAt!.hashCode) + (participants.hashCode) + (participantsCountByRole.hashCode) + (rejectedBy.hashCode) + (startedAt == null ? 0 : startedAt!.hashCode); @override - String toString() => 'CallSessionResponse[acceptedBy=$acceptedBy, endedAt=$endedAt, id=$id, participants=$participants, participantsCountByRole=$participantsCountByRole, rejectedBy=$rejectedBy, startedAt=$startedAt]'; + String toString() => 'CallSessionResponse[acceptedBy=$acceptedBy, endedAt=$endedAt, id=$id, liveEndedAt=$liveEndedAt, liveStartedAt=$liveStartedAt, participants=$participants, participantsCountByRole=$participantsCountByRole, rejectedBy=$rejectedBy, startedAt=$startedAt]'; Map toJson() { final json = {}; @@ -81,6 +103,16 @@ class CallSessionResponse { json[r'ended_at'] = null; } json[r'id'] = this.id; + if (this.liveEndedAt != null) { + json[r'live_ended_at'] = this.liveEndedAt!.toUtc().toIso8601String(); + } else { + json[r'live_ended_at'] = null; + } + if (this.liveStartedAt != null) { + json[r'live_started_at'] = this.liveStartedAt!.toUtc().toIso8601String(); + } else { + json[r'live_started_at'] = null; + } json[r'participants'] = this.participants; json[r'participants_count_by_role'] = this.participantsCountByRole; json[r'rejected_by'] = this.rejectedBy; @@ -114,6 +146,8 @@ class CallSessionResponse { acceptedBy: mapCastOfType(json, r'accepted_by')!, endedAt: mapDateTime(json, r'ended_at', ''), id: mapValueOfType(json, r'id')!, + liveEndedAt: mapDateTime(json, r'live_ended_at', ''), + liveStartedAt: mapDateTime(json, r'live_started_at', ''), participants: CallParticipantResponse.listFromJson(json[r'participants'])!, participantsCountByRole: mapCastOfType(json, r'participants_count_by_role')!, rejectedBy: mapCastOfType(json, r'rejected_by')!, diff --git a/packages/stream_video/lib/open_api/video/coordinator/model/go_live_request.dart b/packages/stream_video/lib/open_api/video/coordinator/model/go_live_request.dart new file mode 100644 index 000000000..c1e932296 --- /dev/null +++ b/packages/stream_video/lib/open_api/video/coordinator/model/go_live_request.dart @@ -0,0 +1,154 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class GoLiveRequest { + /// Returns a new [GoLiveRequest] instance. + GoLiveRequest({ + this.startHls, + this.startRecording, + this.startTranscription, + }); + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? startHls; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? startRecording; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? startTranscription; + + @override + bool operator ==(Object other) => identical(this, other) || other is GoLiveRequest && + other.startHls == startHls && + other.startRecording == startRecording && + other.startTranscription == startTranscription; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (startHls == null ? 0 : startHls!.hashCode) + + (startRecording == null ? 0 : startRecording!.hashCode) + + (startTranscription == null ? 0 : startTranscription!.hashCode); + + @override + String toString() => 'GoLiveRequest[startHls=$startHls, startRecording=$startRecording, startTranscription=$startTranscription]'; + + Map toJson() { + final json = {}; + if (this.startHls != null) { + json[r'start_hls'] = this.startHls; + } else { + json[r'start_hls'] = null; + } + if (this.startRecording != null) { + json[r'start_recording'] = this.startRecording; + } else { + json[r'start_recording'] = null; + } + if (this.startTranscription != null) { + json[r'start_transcription'] = this.startTranscription; + } else { + json[r'start_transcription'] = null; + } + return json; + } + + /// Returns a new [GoLiveRequest] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GoLiveRequest? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "GoLiveRequest[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GoLiveRequest[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GoLiveRequest( + startHls: mapValueOfType(json, r'start_hls'), + startRecording: mapValueOfType(json, r'start_recording'), + startTranscription: mapValueOfType(json, r'start_transcription'), + ); + } + return null; + } + + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = GoLiveRequest.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GoLiveRequest.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GoLiveRequest-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GoLiveRequest.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/packages/stream_video/lib/open_api/video/coordinator/model/own_capability.dart b/packages/stream_video/lib/open_api/video/coordinator/model/own_capability.dart index 16438b768..55c1f0cfb 100644 --- a/packages/stream_video/lib/open_api/video/coordinator/model/own_capability.dart +++ b/packages/stream_video/lib/open_api/video/coordinator/model/own_capability.dart @@ -31,6 +31,7 @@ class OwnCapability { static const joinCall = OwnCapability._(r'join-call'); static const joinEndedCall = OwnCapability._(r'join-ended-call'); static const muteUsers = OwnCapability._(r'mute-users'); + static const pinForEveryone = OwnCapability._(r'pin-for-everyone'); static const readCall = OwnCapability._(r'read-call'); static const removeCallMember = OwnCapability._(r'remove-call-member'); static const screenshare = OwnCapability._(r'screenshare'); @@ -57,6 +58,7 @@ class OwnCapability { joinCall, joinEndedCall, muteUsers, + pinForEveryone, readCall, removeCallMember, screenshare, @@ -118,6 +120,7 @@ class OwnCapabilityTypeTransformer { case r'join-call': return OwnCapability.joinCall; case r'join-ended-call': return OwnCapability.joinEndedCall; case r'mute-users': return OwnCapability.muteUsers; + case r'pin-for-everyone': return OwnCapability.pinForEveryone; case r'read-call': return OwnCapability.readCall; case r'remove-call-member': return OwnCapability.removeCallMember; case r'screenshare': return OwnCapability.screenshare; diff --git a/packages/stream_video/lib/open_api/video/coordinator/model/pin_request.dart b/packages/stream_video/lib/open_api/video/coordinator/model/pin_request.dart new file mode 100644 index 000000000..963b64c8d --- /dev/null +++ b/packages/stream_video/lib/open_api/video/coordinator/model/pin_request.dart @@ -0,0 +1,119 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class PinRequest { + /// Returns a new [PinRequest] instance. + PinRequest({ + required this.sessionId, + required this.userId, + }); + + String sessionId; + + String userId; + + @override + bool operator ==(Object other) => identical(this, other) || other is PinRequest && + other.sessionId == sessionId && + other.userId == userId; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (sessionId.hashCode) + + (userId.hashCode); + + @override + String toString() => 'PinRequest[sessionId=$sessionId, userId=$userId]'; + + Map toJson() { + final json = {}; + json[r'session_id'] = this.sessionId; + json[r'user_id'] = this.userId; + return json; + } + + /// Returns a new [PinRequest] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static PinRequest? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "PinRequest[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "PinRequest[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return PinRequest( + sessionId: mapValueOfType(json, r'session_id')!, + userId: mapValueOfType(json, r'user_id')!, + ); + } + return null; + } + + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = PinRequest.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = PinRequest.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of PinRequest-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = PinRequest.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'session_id', + 'user_id', + }; +} + diff --git a/packages/stream_video/lib/open_api/video/coordinator/model/pin_response.dart b/packages/stream_video/lib/open_api/video/coordinator/model/pin_response.dart new file mode 100644 index 000000000..cd4d918da --- /dev/null +++ b/packages/stream_video/lib/open_api/video/coordinator/model/pin_response.dart @@ -0,0 +1,112 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class PinResponse { + /// Returns a new [PinResponse] instance. + PinResponse({ + required this.duration, + }); + + /// Duration of the request in human-readable format + String duration; + + @override + bool operator ==(Object other) => identical(this, other) || other is PinResponse && + other.duration == duration; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (duration.hashCode); + + @override + String toString() => 'PinResponse[duration=$duration]'; + + Map toJson() { + final json = {}; + json[r'duration'] = this.duration; + return json; + } + + /// Returns a new [PinResponse] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static PinResponse? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "PinResponse[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "PinResponse[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return PinResponse( + duration: mapValueOfType(json, r'duration')!, + ); + } + return null; + } + + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = PinResponse.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = PinResponse.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of PinResponse-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = PinResponse.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'duration', + }; +} + diff --git a/packages/stream_video/lib/open_api/video/coordinator/model/unpin_request.dart b/packages/stream_video/lib/open_api/video/coordinator/model/unpin_request.dart new file mode 100644 index 000000000..db3577f61 --- /dev/null +++ b/packages/stream_video/lib/open_api/video/coordinator/model/unpin_request.dart @@ -0,0 +1,119 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class UnpinRequest { + /// Returns a new [UnpinRequest] instance. + UnpinRequest({ + required this.sessionId, + required this.userId, + }); + + String sessionId; + + String userId; + + @override + bool operator ==(Object other) => identical(this, other) || other is UnpinRequest && + other.sessionId == sessionId && + other.userId == userId; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (sessionId.hashCode) + + (userId.hashCode); + + @override + String toString() => 'UnpinRequest[sessionId=$sessionId, userId=$userId]'; + + Map toJson() { + final json = {}; + json[r'session_id'] = this.sessionId; + json[r'user_id'] = this.userId; + return json; + } + + /// Returns a new [UnpinRequest] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static UnpinRequest? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "UnpinRequest[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "UnpinRequest[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return UnpinRequest( + sessionId: mapValueOfType(json, r'session_id')!, + userId: mapValueOfType(json, r'user_id')!, + ); + } + return null; + } + + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = UnpinRequest.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = UnpinRequest.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of UnpinRequest-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = UnpinRequest.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'session_id', + 'user_id', + }; +} + diff --git a/packages/stream_video/lib/open_api/video/coordinator/model/unpin_response.dart b/packages/stream_video/lib/open_api/video/coordinator/model/unpin_response.dart new file mode 100644 index 000000000..4fdb39d29 --- /dev/null +++ b/packages/stream_video/lib/open_api/video/coordinator/model/unpin_response.dart @@ -0,0 +1,112 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class UnpinResponse { + /// Returns a new [UnpinResponse] instance. + UnpinResponse({ + required this.duration, + }); + + /// Duration of the request in human-readable format + String duration; + + @override + bool operator ==(Object other) => identical(this, other) || other is UnpinResponse && + other.duration == duration; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (duration.hashCode); + + @override + String toString() => 'UnpinResponse[duration=$duration]'; + + Map toJson() { + final json = {}; + json[r'duration'] = this.duration; + return json; + } + + /// Returns a new [UnpinResponse] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static UnpinResponse? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "UnpinResponse[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "UnpinResponse[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return UnpinResponse( + duration: mapValueOfType(json, r'duration')!, + ); + } + return null; + } + + static List? listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = UnpinResponse.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = UnpinResponse.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of UnpinResponse-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = UnpinResponse.listFromJson(entry.value, growable: growable,); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'duration', + }; +} + diff --git a/packages/stream_video/lib/protobuf/video/sfu/event/events.pb.dart b/packages/stream_video/lib/protobuf/video/sfu/event/events.pb.dart index eeae770a6..99178a501 100644 --- a/packages/stream_video/lib/protobuf/video/sfu/event/events.pb.dart +++ b/packages/stream_video/lib/protobuf/video/sfu/event/events.pb.dart @@ -35,6 +35,7 @@ enum SfuEvent_EventPayload { callGrantsUpdated, goAway, iceRestart, + pinsUpdated, notSet } @@ -57,10 +58,11 @@ class SfuEvent extends $pb.GeneratedMessage { 19 : SfuEvent_EventPayload.callGrantsUpdated, 20 : SfuEvent_EventPayload.goAway, 21 : SfuEvent_EventPayload.iceRestart, + 22 : SfuEvent_EventPayload.pinsUpdated, 0 : SfuEvent_EventPayload.notSet }; static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SfuEvent', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'stream.video.sfu.event'), createEmptyInstance: create) - ..oo(0, [1, 2, 3, 4, 5, 6, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21]) + ..oo(0, [1, 2, 3, 4, 5, 6, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22]) ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'subscriberOffer', subBuilder: SubscriberOffer.create) ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'publisherAnswer', subBuilder: PublisherAnswer.create) ..aOM(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'connectionQualityChanged', subBuilder: ConnectionQualityChanged.create) @@ -78,6 +80,7 @@ class SfuEvent extends $pb.GeneratedMessage { ..aOM(19, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'callGrantsUpdated', subBuilder: CallGrantsUpdated.create) ..aOM(20, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'goAway', subBuilder: GoAway.create) ..aOM(21, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'iceRestart', subBuilder: ICERestart.create) + ..aOM(22, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pinsUpdated', subBuilder: PinsChanged.create) ..hasRequiredFields = false ; @@ -100,6 +103,7 @@ class SfuEvent extends $pb.GeneratedMessage { CallGrantsUpdated? callGrantsUpdated, GoAway? goAway, ICERestart? iceRestart, + PinsChanged? pinsUpdated, }) { final _result = create(); if (subscriberOffer != null) { @@ -153,6 +157,9 @@ class SfuEvent extends $pb.GeneratedMessage { if (iceRestart != null) { _result.iceRestart = iceRestart; } + if (pinsUpdated != null) { + _result.pinsUpdated = pinsUpdated; + } return _result; } factory SfuEvent.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); @@ -365,6 +372,58 @@ class SfuEvent extends $pb.GeneratedMessage { void clearIceRestart() => clearField(21); @$pb.TagNumber(21) ICERestart ensureIceRestart() => $_ensure(16); + + @$pb.TagNumber(22) + PinsChanged get pinsUpdated => $_getN(17); + @$pb.TagNumber(22) + set pinsUpdated(PinsChanged v) { setField(22, v); } + @$pb.TagNumber(22) + $core.bool hasPinsUpdated() => $_has(17); + @$pb.TagNumber(22) + void clearPinsUpdated() => clearField(22); + @$pb.TagNumber(22) + PinsChanged ensurePinsUpdated() => $_ensure(17); +} + +class PinsChanged extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'PinsChanged', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'stream.video.sfu.event'), createEmptyInstance: create) + ..pc<$0.Pin>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pins', $pb.PbFieldType.PM, subBuilder: $0.Pin.create) + ..hasRequiredFields = false + ; + + PinsChanged._() : super(); + factory PinsChanged({ + $core.Iterable<$0.Pin>? pins, + }) { + final _result = create(); + if (pins != null) { + _result.pins.addAll(pins); + } + return _result; + } + factory PinsChanged.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory PinsChanged.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + PinsChanged clone() => PinsChanged()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + PinsChanged copyWith(void Function(PinsChanged) updates) => super.copyWith((message) => updates(message as PinsChanged)) as PinsChanged; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static PinsChanged create() => PinsChanged._(); + PinsChanged createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static PinsChanged getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static PinsChanged? _defaultInstance; + + @$pb.TagNumber(1) + $core.List<$0.Pin> get pins => $_getList(0); } class Error extends $pb.GeneratedMessage { diff --git a/packages/stream_video/lib/protobuf/video/sfu/event/events.pbjson.dart b/packages/stream_video/lib/protobuf/video/sfu/event/events.pbjson.dart index bcf2ddd56..9239c6480 100644 --- a/packages/stream_video/lib/protobuf/video/sfu/event/events.pbjson.dart +++ b/packages/stream_video/lib/protobuf/video/sfu/event/events.pbjson.dart @@ -29,6 +29,7 @@ const SfuEvent$json = const { const {'1': 'call_grants_updated', '3': 19, '4': 1, '5': 11, '6': '.stream.video.sfu.event.CallGrantsUpdated', '9': 0, '10': 'callGrantsUpdated'}, const {'1': 'go_away', '3': 20, '4': 1, '5': 11, '6': '.stream.video.sfu.event.GoAway', '9': 0, '10': 'goAway'}, const {'1': 'ice_restart', '3': 21, '4': 1, '5': 11, '6': '.stream.video.sfu.event.ICERestart', '9': 0, '10': 'iceRestart'}, + const {'1': 'pins_updated', '3': 22, '4': 1, '5': 11, '6': '.stream.video.sfu.event.PinsChanged', '9': 0, '10': 'pinsUpdated'}, ], '8': const [ const {'1': 'event_payload'}, @@ -36,7 +37,17 @@ const SfuEvent$json = const { }; /// Descriptor for `SfuEvent`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List sfuEventDescriptor = $convert.base64Decode('CghTZnVFdmVudBJUChBzdWJzY3JpYmVyX29mZmVyGAEgASgLMicuc3RyZWFtLnZpZGVvLnNmdS5ldmVudC5TdWJzY3JpYmVyT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X2NoZWNrX3Jlc3BvbnNlGA4gASgLMisuc3RyZWFtLnZpZGVvLnNmdS5ldmVudC5IZWFsdGhDaGVja1Jlc3BvbnNlSABSE2hlYWx0aENoZWNrUmVzcG9uc2USUQoPdHJhY2tfcHVibGlzaGVkGBAgASgLMiYuc3RyZWFtLnZpZGVvLnNmdS5ldmVudC5UcmFja1B1Ymxpc2hlZEgAUg50cmFja1B1Ymxpc2hlZBJXChF0cmFja191bnB1Ymxpc2hlZBgRIAEoCzIoLnN0cmVhbS52aWRlby5zZnUuZXZlbnQuVHJhY2tVbnB1Ymxpc2hlZEgAUhB0cmFja1VucHVibGlzaGVkEjUKBWVycm9yGBIgASgLMh0uc3RyZWFtLnZpZGVvLnNmdS5ldmVudC5FcnJvckgAUgVlcnJvchJbChNjYWxsX2dyYW50c191cGRhdGVkGBMgASgLMikuc3RyZWFtLnZpZGVvLnNmdS5ldmVudC5DYWxsR3JhbnRzVXBkYXRlZEgAUhFjYWxsR3JhbnRzVXBkYXRlZBI5Cgdnb19hd2F5GBQgASgLMh4uc3RyZWFtLnZpZGVvLnNmdS5ldmVudC5Hb0F3YXlIAFIGZ29Bd2F5EkUKC2ljZV9yZXN0YXJ0GBUgASgLMiIuc3RyZWFtLnZpZGVvLnNmdS5ldmVudC5JQ0VSZXN0YXJ0SABSCmljZVJlc3RhcnQSSAoMcGluc191cGRhdGVkGBYgASgLMiMuc3RyZWFtLnZpZGVvLnNmdS5ldmVudC5QaW5zQ2hhbmdlZEgAUgtwaW5zVXBkYXRlZEIPCg1ldmVudF9wYXlsb2Fk'); +@$core.Deprecated('Use pinsChangedDescriptor instead') +const PinsChanged$json = const { + '1': 'PinsChanged', + '2': const [ + const {'1': 'pins', '3': 1, '4': 3, '5': 11, '6': '.stream.video.sfu.models.Pin', '10': 'pins'}, + ], +}; + +/// Descriptor for `PinsChanged`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List pinsChangedDescriptor = $convert.base64Decode('CgtQaW5zQ2hhbmdlZBIwCgRwaW5zGAEgAygLMhwuc3RyZWFtLnZpZGVvLnNmdS5tb2RlbHMuUGluUgRwaW5z'); @$core.Deprecated('Use errorDescriptor instead') const Error$json = const { '1': 'Error', diff --git a/packages/stream_video/lib/protobuf/video/sfu/models/models.pb.dart b/packages/stream_video/lib/protobuf/video/sfu/models/models.pb.dart index 670b7fc67..08221e752 100644 --- a/packages/stream_video/lib/protobuf/video/sfu/models/models.pb.dart +++ b/packages/stream_video/lib/protobuf/video/sfu/models/models.pb.dart @@ -21,6 +21,7 @@ class CallState extends $pb.GeneratedMessage { ..pc(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'participants', $pb.PbFieldType.PM, subBuilder: Participant.create) ..aOM<$0.Timestamp>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'startedAt', subBuilder: $0.Timestamp.create) ..aOM(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'participantCount', subBuilder: ParticipantCount.create) + ..pc(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pins', $pb.PbFieldType.PM, subBuilder: Pin.create) ..hasRequiredFields = false ; @@ -29,6 +30,7 @@ class CallState extends $pb.GeneratedMessage { $core.Iterable? participants, $0.Timestamp? startedAt, ParticipantCount? participantCount, + $core.Iterable? pins, }) { final _result = create(); if (participants != null) { @@ -40,6 +42,9 @@ class CallState extends $pb.GeneratedMessage { if (participantCount != null) { _result.participantCount = participantCount; } + if (pins != null) { + _result.pins.addAll(pins); + } return _result; } factory CallState.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); @@ -87,6 +92,9 @@ class CallState extends $pb.GeneratedMessage { void clearParticipantCount() => clearField(3); @$pb.TagNumber(3) ParticipantCount ensureParticipantCount() => $_ensure(2); + + @$pb.TagNumber(4) + $core.List get pins => $_getList(3); } class ParticipantCount extends $pb.GeneratedMessage { @@ -150,6 +158,67 @@ class ParticipantCount extends $pb.GeneratedMessage { void clearAnonymous() => clearField(2); } +class Pin extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Pin', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'stream.video.sfu.models'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'userId') + ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sessionId') + ..hasRequiredFields = false + ; + + Pin._() : super(); + factory Pin({ + $core.String? userId, + $core.String? sessionId, + }) { + final _result = create(); + if (userId != null) { + _result.userId = userId; + } + if (sessionId != null) { + _result.sessionId = sessionId; + } + return _result; + } + factory Pin.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory Pin.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + Pin clone() => Pin()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Pin copyWith(void Function(Pin) updates) => super.copyWith((message) => updates(message as Pin)) as Pin; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static Pin create() => Pin._(); + Pin createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static Pin getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Pin? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get userId => $_getSZ(0); + @$pb.TagNumber(1) + set userId($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasUserId() => $_has(0); + @$pb.TagNumber(1) + void clearUserId() => clearField(1); + + @$pb.TagNumber(2) + $core.String get sessionId => $_getSZ(1); + @$pb.TagNumber(2) + set sessionId($core.String v) { $_setString(1, v); } + @$pb.TagNumber(2) + $core.bool hasSessionId() => $_has(1); + @$pb.TagNumber(2) + void clearSessionId() => clearField(2); +} + class Participant extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'Participant', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'stream.video.sfu.models'), createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'userId') diff --git a/packages/stream_video/lib/protobuf/video/sfu/models/models.pbenum.dart b/packages/stream_video/lib/protobuf/video/sfu/models/models.pbenum.dart index 9f0c18c5d..702f3e856 100644 --- a/packages/stream_video/lib/protobuf/video/sfu/models/models.pbenum.dart +++ b/packages/stream_video/lib/protobuf/video/sfu/models/models.pbenum.dart @@ -140,6 +140,7 @@ class SdkType extends $pb.ProtobufEnum { static const SdkType SDK_TYPE_IOS = SdkType._(4, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SDK_TYPE_IOS'); static const SdkType SDK_TYPE_FLUTTER = SdkType._(5, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SDK_TYPE_FLUTTER'); static const SdkType SDK_TYPE_REACT_NATIVE = SdkType._(6, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SDK_TYPE_REACT_NATIVE'); + static const SdkType SDK_TYPE_UNITY = SdkType._(7, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SDK_TYPE_UNITY'); static const $core.List values = [ SDK_TYPE_UNSPECIFIED, @@ -149,6 +150,7 @@ class SdkType extends $pb.ProtobufEnum { SDK_TYPE_IOS, SDK_TYPE_FLUTTER, SDK_TYPE_REACT_NATIVE, + SDK_TYPE_UNITY, ]; static final $core.Map<$core.int, SdkType> _byValue = $pb.ProtobufEnum.initByValue(values); diff --git a/packages/stream_video/lib/protobuf/video/sfu/models/models.pbjson.dart b/packages/stream_video/lib/protobuf/video/sfu/models/models.pbjson.dart index 88bfe1eb8..3c7fba6a3 100644 --- a/packages/stream_video/lib/protobuf/video/sfu/models/models.pbjson.dart +++ b/packages/stream_video/lib/protobuf/video/sfu/models/models.pbjson.dart @@ -98,11 +98,12 @@ const SdkType$json = const { const {'1': 'SDK_TYPE_IOS', '2': 4}, const {'1': 'SDK_TYPE_FLUTTER', '2': 5}, const {'1': 'SDK_TYPE_REACT_NATIVE', '2': 6}, + const {'1': 'SDK_TYPE_UNITY', '2': 7}, ], }; /// Descriptor for `SdkType`. Decode as a `google.protobuf.EnumDescriptorProto`. -final $typed_data.Uint8List sdkTypeDescriptor = $convert.base64Decode('CgdTZGtUeXBlEhgKFFNES19UWVBFX1VOU1BFQ0lGSUVEEAASEgoOU0RLX1RZUEVfUkVBQ1QQARIUChBTREtfVFlQRV9BTkdVTEFSEAISFAoQU0RLX1RZUEVfQU5EUk9JRBADEhAKDFNES19UWVBFX0lPUxAEEhQKEFNES19UWVBFX0ZMVVRURVIQBRIZChVTREtfVFlQRV9SRUFDVF9OQVRJVkUQBg=='); +final $typed_data.Uint8List sdkTypeDescriptor = $convert.base64Decode('CgdTZGtUeXBlEhgKFFNES19UWVBFX1VOU1BFQ0lGSUVEEAASEgoOU0RLX1RZUEVfUkVBQ1QQARIUChBTREtfVFlQRV9BTkdVTEFSEAISFAoQU0RLX1RZUEVfQU5EUk9JRBADEhAKDFNES19UWVBFX0lPUxAEEhQKEFNES19UWVBFX0ZMVVRURVIQBRIZChVTREtfVFlQRV9SRUFDVF9OQVRJVkUQBhISCg5TREtfVFlQRV9VTklUWRAH'); @$core.Deprecated('Use trackUnpublishReasonDescriptor instead') const TrackUnpublishReason$json = const { '1': 'TrackUnpublishReason', @@ -135,11 +136,12 @@ const CallState$json = const { const {'1': 'participants', '3': 1, '4': 3, '5': 11, '6': '.stream.video.sfu.models.Participant', '10': 'participants'}, const {'1': 'started_at', '3': 2, '4': 1, '5': 11, '6': '.google.protobuf.Timestamp', '10': 'startedAt'}, const {'1': 'participant_count', '3': 3, '4': 1, '5': 11, '6': '.stream.video.sfu.models.ParticipantCount', '10': 'participantCount'}, + const {'1': 'pins', '3': 4, '4': 3, '5': 11, '6': '.stream.video.sfu.models.Pin', '10': 'pins'}, ], }; /// Descriptor for `CallState`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List callStateDescriptor = $convert.base64Decode('CglDYWxsU3RhdGUSSAoMcGFydGljaXBhbnRzGAEgAygLMiQuc3RyZWFtLnZpZGVvLnNmdS5tb2RlbHMuUGFydGljaXBhbnRSDHBhcnRpY2lwYW50cxI5CgpzdGFydGVkX2F0GAIgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcFIJc3RhcnRlZEF0ElYKEXBhcnRpY2lwYW50X2NvdW50GAMgASgLMikuc3RyZWFtLnZpZGVvLnNmdS5tb2RlbHMuUGFydGljaXBhbnRDb3VudFIQcGFydGljaXBhbnRDb3VudA=='); +final $typed_data.Uint8List callStateDescriptor = $convert.base64Decode('CglDYWxsU3RhdGUSSAoMcGFydGljaXBhbnRzGAEgAygLMiQuc3RyZWFtLnZpZGVvLnNmdS5tb2RlbHMuUGFydGljaXBhbnRSDHBhcnRpY2lwYW50cxI5CgpzdGFydGVkX2F0GAIgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcFIJc3RhcnRlZEF0ElYKEXBhcnRpY2lwYW50X2NvdW50GAMgASgLMikuc3RyZWFtLnZpZGVvLnNmdS5tb2RlbHMuUGFydGljaXBhbnRDb3VudFIQcGFydGljaXBhbnRDb3VudBIwCgRwaW5zGAQgAygLMhwuc3RyZWFtLnZpZGVvLnNmdS5tb2RlbHMuUGluUgRwaW5z'); @$core.Deprecated('Use participantCountDescriptor instead') const ParticipantCount$json = const { '1': 'ParticipantCount', @@ -151,6 +153,17 @@ const ParticipantCount$json = const { /// Descriptor for `ParticipantCount`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List participantCountDescriptor = $convert.base64Decode('ChBQYXJ0aWNpcGFudENvdW50EhQKBXRvdGFsGAEgASgNUgV0b3RhbBIcCglhbm9ueW1vdXMYAiABKA1SCWFub255bW91cw=='); +@$core.Deprecated('Use pinDescriptor instead') +const Pin$json = const { + '1': 'Pin', + '2': const [ + const {'1': 'user_id', '3': 1, '4': 1, '5': 9, '10': 'userId'}, + const {'1': 'session_id', '3': 2, '4': 1, '5': 9, '10': 'sessionId'}, + ], +}; + +/// Descriptor for `Pin`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List pinDescriptor = $convert.base64Decode('CgNQaW4SFwoHdXNlcl9pZBgBIAEoCVIGdXNlcklkEh0KCnNlc3Npb25faWQYAiABKAlSCXNlc3Npb25JZA=='); @$core.Deprecated('Use participantDescriptor instead') const Participant$json = const { '1': 'Participant', diff --git a/packages/stream_video/lib/src/call/call.dart b/packages/stream_video/lib/src/call/call.dart index 91a14899f..ef3e3a244 100644 --- a/packages/stream_video/lib/src/call/call.dart +++ b/packages/stream_video/lib/src/call/call.dart @@ -1106,8 +1106,17 @@ class Call { return result; } - Future> goLive() async { - final result = await _coordinatorClient.goLive(callCid); + Future> goLive({ + bool? startHls, + bool? startRecording, + bool? startTranscription, + }) async { + final result = await _coordinatorClient.goLive( + callCid: callCid, + startHls: startHls, + startRecording: startRecording, + startTranscription: startTranscription, + ); if (result.isSuccess) { _stateManager.setCallLive(isLive: true); diff --git a/packages/stream_video/lib/src/coordinator/coordinator_client.dart b/packages/stream_video/lib/src/coordinator/coordinator_client.dart index 2e978cd76..900e0c4c2 100644 --- a/packages/stream_video/lib/src/coordinator/coordinator_client.dart +++ b/packages/stream_video/lib/src/coordinator/coordinator_client.dart @@ -164,7 +164,12 @@ abstract class CoordinatorClient { /// joined the call. Future> endCall(StreamCallCid callCid); - Future> goLive(StreamCallCid callCid); + Future> goLive({ + required StreamCallCid callCid, + bool? startHls, + bool? startRecording, + bool? startTranscription, + }); Future> stopLive(StreamCallCid callCid); diff --git a/packages/stream_video/lib/src/coordinator/open_api/coordinator_client_open_api.dart b/packages/stream_video/lib/src/coordinator/open_api/coordinator_client_open_api.dart index 77aaeed86..9f920dfba 100644 --- a/packages/stream_video/lib/src/coordinator/open_api/coordinator_client_open_api.dart +++ b/packages/stream_video/lib/src/coordinator/open_api/coordinator_client_open_api.dart @@ -45,10 +45,10 @@ class CoordinatorClientOpenApi extends CoordinatorClient { required this.latencyService, required this.retryPolicy, }) : _apiClient = open.ApiClient( - basePath: rpcUrl, - authentication: - _Authentication(apiKey: apiKey, tokenManager: tokenManager), - ); + basePath: rpcUrl, + authentication: + _Authentication(apiKey: apiKey, tokenManager: tokenManager), + ); final _logger = taggedLogger(tag: 'SV:CoordClient'); final String apiKey; @@ -244,8 +244,8 @@ class CoordinatorClientOpenApi extends CoordinatorClient { }) async { try { _logger.d( - () => - '[getOrCreateCall] cid: $callCid, ringing: $ringing, members: $members', + () => + '[getOrCreateCall] cid: $callCid, ringing: $ringing, members: $members', ); final result = await defaultApi.getOrCreateCall( callCid.type, @@ -289,8 +289,8 @@ class CoordinatorClientOpenApi extends CoordinatorClient { }) async { try { _logger.d( - () => - '[joinCall] cid: $callCid, dataCenterId: $datacenterId, ringing: $ringing, create: $create', + () => + '[joinCall] cid: $callCid, dataCenterId: $datacenterId, ringing: $ringing, create: $create', ); final location = await locationService.getLocation(); _logger.v(() => '[joinCall] location: $location'); @@ -333,8 +333,8 @@ class CoordinatorClientOpenApi extends CoordinatorClient { }) async { try { _logger.d( - () => - '[sendCustomEvent] cid: $callCid, eventType: $eventType, custom: $custom', + () => + '[sendCustomEvent] cid: $callCid, eventType: $eventType, custom: $custom', ); final result = await defaultApi.sendEvent( callCid.type, @@ -363,8 +363,8 @@ class CoordinatorClientOpenApi extends CoordinatorClient { }) async { try { _logger.d( - () => - '[inviteUsers] cid: $callCid, members: $members, ringing: $ringing', + () => + '[inviteUsers] cid: $callCid, members: $members, ringing: $ringing', ); final result = await defaultApi.updateCallMembers( callCid.type, @@ -442,8 +442,10 @@ class CoordinatorClientOpenApi extends CoordinatorClient { } @override - Future>> listRecordings(StreamCallCid callCid, - String sessionId,) async { + Future>> listRecordings( + StreamCallCid callCid, + String sessionId, + ) async { try { final result = await defaultApi.listRecordingsTypeIdSession1( callCid.type, @@ -625,9 +627,22 @@ class CoordinatorClientOpenApi extends CoordinatorClient { } @override - Future> goLive(StreamCallCid callCid) async { + Future> goLive({ + required StreamCallCid callCid, + bool? startHls, + bool? startRecording, + bool? startTranscription, + }) async { try { - final result = await defaultApi.goLive(callCid.type, callCid.id); + final result = await defaultApi.goLive( + callCid.type, + callCid.id, + open.GoLiveRequest( + startHls: startHls, + startRecording: startRecording, + startTranscription: startTranscription, + ), + ); if (result == null) { return Result.error('goLive result is null'); } @@ -796,8 +811,10 @@ class _Authentication extends open.Authentication { final TokenManager tokenManager; @override - Future applyToParams(List queryParams, - Map headerParams,) async { + Future applyToParams( + List queryParams, + Map headerParams, + ) async { final tokenResult = await tokenManager.getToken(); if (tokenResult is! Success) { throw (tokenResult as Failure).error; @@ -805,10 +822,7 @@ class _Authentication extends open.Authentication { queryParams.add(open.QueryParam('api_key', apiKey)); headerParams['Authorization'] = tokenResult.getDataOrNull()!.rawValue; headerParams['stream-auth-type'] = - tokenResult - .getDataOrNull()! - .authType - .name; + tokenResult.getDataOrNull()!.authType.name; headerParams['X-Stream-Client'] = streamClientVersion; headerParams['x-client-request-id'] = const Uuid().v4(); } diff --git a/packages/stream_video/lib/src/coordinator/retry/coordinator_client_retry.dart b/packages/stream_video/lib/src/coordinator/retry/coordinator_client_retry.dart index dc2edee8a..4a6c87d73 100644 --- a/packages/stream_video/lib/src/coordinator/retry/coordinator_client_retry.dart +++ b/packages/stream_video/lib/src/coordinator/retry/coordinator_client_retry.dart @@ -132,9 +132,19 @@ class CoordinatorClientRetry extends CoordinatorClient { } @override - Future> goLive(StreamCallCid callCid) { + Future> goLive({ + required StreamCallCid callCid, + bool? startHls, + bool? startRecording, + bool? startTranscription, + }) { return _retryManager.execute( - () => _delegate.goLive(callCid), + () => _delegate.goLive( + callCid: callCid, + startHls: startHls, + startRecording: startRecording, + startTranscription: startTranscription, + ), (error, nextAttemptDelay) async { _logRetry('goLive', error, nextAttemptDelay); },