Skip to content

Commit

Permalink
Upgrade to OpenAPI 88.0.3 & SFU proto 1.9.0 (#461)
Browse files Browse the repository at this point in the history
* upgrade SFU to 1.9.0

* upgrade OpenAPI to 88.0.3

* fix compilation

---------

Co-authored-by: kanat <>
  • Loading branch information
kanat authored Aug 11, 2023
1 parent e66832b commit 8f516d2
Show file tree
Hide file tree
Showing 20 changed files with 1,042 additions and 38 deletions.
5 changes: 5 additions & 0 deletions packages/stream_video/lib/open_api/video/coordinator/api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand Down Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,20 +609,22 @@ class DefaultApi {
/// * [String] type (required):
///
/// * [String] id (required):
Future<Response> goLiveWithHttpInfo(String type, String id,) async {
///
/// * [GoLiveRequest] goLiveRequest (required):
Future<Response> 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 = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};

const contentTypes = <String>[];
const contentTypes = <String>['application/json'];


return apiClient.invokeAPI(
Expand All @@ -645,8 +647,10 @@ class DefaultApi {
/// * [String] type (required):
///
/// * [String] id (required):
Future<GoLiveResponse?> goLive(String type, String id,) async {
final response = await goLiveWithHttpInfo(type, id,);
///
/// * [GoLiveRequest] goLiveRequest (required):
Future<GoLiveResponse?> 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));
}
Expand Down Expand Up @@ -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<Response> 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 = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};

const contentTypes = <String>['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<PinResponse?> 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<Response> 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 = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};

const contentTypes = <String>['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<UnpinResponse?> 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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down Expand Up @@ -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':
Expand Down Expand Up @@ -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':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 &&
Expand All @@ -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<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'call'] = this.call;
json[r'call_cid'] = this.callCid;
json[r'created_at'] = this.createdAt.toUtc().toIso8601String();
json[r'type'] = this.type;
Expand Down Expand Up @@ -84,6 +90,7 @@ class CallEndedEvent {
}());

return CallEndedEvent(
call: CallResponse.fromJson(json[r'call'])!,
callCid: mapValueOfType<String>(json, r'call_cid')!,
createdAt: mapDateTime(json, r'created_at', '')!,
type: mapValueOfType<String>(json, r'type')!,
Expand Down Expand Up @@ -137,6 +144,7 @@ class CallEndedEvent {

/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'call',
'call_cid',
'created_at',
'type',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {},
Expand All @@ -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<CallParticipantResponse> participants;

Map<String, int> participantsCountByRole;
Expand All @@ -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 &&
Expand All @@ -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<String, dynamic> toJson() {
final json = <String, dynamic>{};
Expand All @@ -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;
Expand Down Expand Up @@ -114,6 +146,8 @@ class CallSessionResponse {
acceptedBy: mapCastOfType<String, DateTime>(json, r'accepted_by')!,
endedAt: mapDateTime(json, r'ended_at', ''),
id: mapValueOfType<String>(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<String, int>(json, r'participants_count_by_role')!,
rejectedBy: mapCastOfType<String, DateTime>(json, r'rejected_by')!,
Expand Down
Loading

0 comments on commit 8f516d2

Please sign in to comment.