Skip to content

Commit

Permalink
Upgrade to OpenAPI 88.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kanat committed Sep 22, 2023
1 parent 63c5701 commit 4283186
Show file tree
Hide file tree
Showing 18 changed files with 487 additions and 59 deletions.
3 changes: 3 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 @@ -58,6 +58,8 @@ part 'model/call_notification_event.dart';
part 'model/call_participant_response.dart';
part 'model/call_reaction_event.dart';
part 'model/call_recording.dart';
part 'model/call_recording_failed_event.dart';
part 'model/call_recording_ready_event.dart';
part 'model/call_recording_started_event.dart';
part 'model/call_recording_stopped_event.dart';
part 'model/call_rejected_event.dart';
Expand All @@ -74,6 +76,7 @@ part 'model/call_settings_response.dart';
part 'model/call_state_response_fields.dart';
part 'model/call_type_response.dart';
part 'model/call_updated_event.dart';
part 'model/call_user_muted.dart';
part 'model/connect_user_details_request.dart';
part 'model/connected_event.dart';
part 'model/connection_error_event.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ class ApiClient {
return CallReactionEvent.fromJson(value);
case 'CallRecording':
return CallRecording.fromJson(value);
case 'CallRecordingFailedEvent':
return CallRecordingFailedEvent.fromJson(value);
case 'CallRecordingReadyEvent':
return CallRecordingReadyEvent.fromJson(value);
case 'CallRecordingStartedEvent':
return CallRecordingStartedEvent.fromJson(value);
case 'CallRecordingStoppedEvent':
Expand Down Expand Up @@ -269,6 +273,8 @@ class ApiClient {
return CallTypeResponse.fromJson(value);
case 'CallUpdatedEvent':
return CallUpdatedEvent.fromJson(value);
case 'CallUserMuted':
return CallUserMuted.fromJson(value);
case 'ConnectUserDetailsRequest':
return ConnectUserDetailsRequest.fromJson(value);
case 'ConnectedEvent':
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
//
// 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 CallRecordingFailedEvent {
/// Returns a new [CallRecordingFailedEvent] instance.
CallRecordingFailedEvent({
required this.callCid,
required this.createdAt,
this.type = 'call.recording_failed',
});

String callCid;

DateTime createdAt;

/// The type of event: \"call.recording_failed\" in this case
String type;

@override
bool operator ==(Object other) => identical(this, other) || other is CallRecordingFailedEvent &&
other.callCid == callCid &&
other.createdAt == createdAt &&
other.type == type;

@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(callCid.hashCode) +
(createdAt.hashCode) +
(type.hashCode);

@override
String toString() => 'CallRecordingFailedEvent[callCid=$callCid, createdAt=$createdAt, type=$type]';

Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'call_cid'] = this.callCid;
json[r'created_at'] = this.createdAt.toUtc().toIso8601String();
json[r'type'] = this.type;
return json;
}

/// Returns a new [CallRecordingFailedEvent] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static CallRecordingFailedEvent? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();

// 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 "CallRecordingFailedEvent[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "CallRecordingFailedEvent[$key]" has a null value in JSON.');
});
return true;
}());

return CallRecordingFailedEvent(
callCid: mapValueOfType<String>(json, r'call_cid')!,
createdAt: mapDateTime(json, r'created_at', '')!,
type: mapValueOfType<String>(json, r'type')!,
);
}
return null;
}

static List<CallRecordingFailedEvent> listFromJson(dynamic json, {bool growable = false,}) {
final result = <CallRecordingFailedEvent>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = CallRecordingFailedEvent.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}

static Map<String, CallRecordingFailedEvent> mapFromJson(dynamic json) {
final map = <String, CallRecordingFailedEvent>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = CallRecordingFailedEvent.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}

// maps a json object with a list of CallRecordingFailedEvent-objects as value to a dart map
static Map<String, List<CallRecordingFailedEvent>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<CallRecordingFailedEvent>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = CallRecordingFailedEvent.listFromJson(entry.value, growable: growable,);
}
}
return map;
}

/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'call_cid',
'created_at',
'type',
};
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
//
// 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 CallRecordingReadyEvent {
/// Returns a new [CallRecordingReadyEvent] instance.
CallRecordingReadyEvent({
required this.callCid,
required this.callRecording,
required this.createdAt,
this.type = 'call.recording_ready',
});

String callCid;

CallRecording callRecording;

DateTime createdAt;

/// The type of event: \"call.recording_ready\" in this case
String type;

@override
bool operator ==(Object other) => identical(this, other) || other is CallRecordingReadyEvent &&
other.callCid == callCid &&
other.callRecording == callRecording &&
other.createdAt == createdAt &&
other.type == type;

@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(callCid.hashCode) +
(callRecording.hashCode) +
(createdAt.hashCode) +
(type.hashCode);

@override
String toString() => 'CallRecordingReadyEvent[callCid=$callCid, callRecording=$callRecording, createdAt=$createdAt, type=$type]';

Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'call_cid'] = this.callCid;
json[r'call_recording'] = this.callRecording;
json[r'created_at'] = this.createdAt.toUtc().toIso8601String();
json[r'type'] = this.type;
return json;
}

/// Returns a new [CallRecordingReadyEvent] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static CallRecordingReadyEvent? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();

// 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 "CallRecordingReadyEvent[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "CallRecordingReadyEvent[$key]" has a null value in JSON.');
});
return true;
}());

return CallRecordingReadyEvent(
callCid: mapValueOfType<String>(json, r'call_cid')!,
callRecording: CallRecording.fromJson(json[r'call_recording'])!,
createdAt: mapDateTime(json, r'created_at', '')!,
type: mapValueOfType<String>(json, r'type')!,
);
}
return null;
}

static List<CallRecordingReadyEvent> listFromJson(dynamic json, {bool growable = false,}) {
final result = <CallRecordingReadyEvent>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = CallRecordingReadyEvent.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}

static Map<String, CallRecordingReadyEvent> mapFromJson(dynamic json) {
final map = <String, CallRecordingReadyEvent>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = CallRecordingReadyEvent.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}

// maps a json object with a list of CallRecordingReadyEvent-objects as value to a dart map
static Map<String, List<CallRecordingReadyEvent>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<CallRecordingReadyEvent>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = CallRecordingReadyEvent.listFromJson(entry.value, growable: growable,);
}
}
return map;
}

/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'call_cid',
'call_recording',
'created_at',
'type',
};
}

Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@ part of openapi.api;
class CallStateResponseFields {
/// Returns a new [CallStateResponseFields] instance.
CallStateResponseFields({
this.blockedUsers = const [],
required this.call,
this.members = const [],
this.membership,
this.ownCapabilities = const [],
});

List<UserResponse> blockedUsers;

CallResponse call;

/// List of call members
Expand All @@ -39,7 +36,6 @@ class CallStateResponseFields {

@override
bool operator ==(Object other) => identical(this, other) || other is CallStateResponseFields &&
other.blockedUsers == blockedUsers &&
other.call == call &&
other.members == members &&
other.membership == membership &&
Expand All @@ -48,18 +44,16 @@ class CallStateResponseFields {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(blockedUsers.hashCode) +
(call.hashCode) +
(members.hashCode) +
(membership == null ? 0 : membership!.hashCode) +
(ownCapabilities.hashCode);

@override
String toString() => 'CallStateResponseFields[blockedUsers=$blockedUsers, call=$call, members=$members, membership=$membership, ownCapabilities=$ownCapabilities]';
String toString() => 'CallStateResponseFields[call=$call, members=$members, membership=$membership, ownCapabilities=$ownCapabilities]';

Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'blocked_users'] = this.blockedUsers;
json[r'call'] = this.call;
json[r'members'] = this.members;
if (this.membership != null) {
Expand Down Expand Up @@ -90,7 +84,6 @@ class CallStateResponseFields {
}());

return CallStateResponseFields(
blockedUsers: UserResponse.listFromJson(json[r'blocked_users']),
call: CallResponse.fromJson(json[r'call'])!,
members: MemberResponse.listFromJson(json[r'members']),
membership: MemberResponse.fromJson(json[r'membership']),
Expand Down Expand Up @@ -142,7 +135,6 @@ class CallStateResponseFields {

/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'blocked_users',
'call',
'members',
'own_capabilities',
Expand Down
Loading

0 comments on commit 4283186

Please sign in to comment.