-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [PBE-1710] make example app Firebase friendly * [PBE-1710] support reject.reason & show notification * fix ios, improve setup * support pronto-staging * write openapi script + generate new API
- Loading branch information
Showing
49 changed files
with
1,728 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
OPENAPI_SPEC_PATH="https://raw.githubusercontent.com/GetStream/protocol/main/openapi/video-openapi-clientside.yaml" | ||
|
||
OUTPUT_DIR="./lib/open_api/video/coordinator" | ||
TEMP_OUTPUT_DIR="./lib/open_api/video/coordinator_temp" | ||
|
||
# Clean previous output | ||
rm -rf $TEMP_OUTPUT_DIR | ||
rm -rf $OUTPUT_DIR | ||
|
||
# NOTE: https://openapi-generator.tech/docs/generators/dart/ | ||
# Generate the Coordinator API models | ||
docker pull openapitools/openapi-generator-cli | ||
docker run --rm \ | ||
-v "${TEMP_OUTPUT_DIR}:/local" openapitools/openapi-generator-cli generate \ | ||
-i "$OPENAPI_SPEC_PATH" \ | ||
-g dart \ | ||
-o /local | ||
|
||
|
||
# Copy the generated code to the correct location | ||
cp -r $TEMP_OUTPUT_DIR/lib $OUTPUT_DIR | ||
|
||
# Write the API version to a file | ||
README_FILE="$TEMP_OUTPUT_DIR/README.md" | ||
API_VERSION=$(grep -i "API version" "$README_FILE" | awk -F ': ' '{print $2}') | ||
OUTPUT_FILE="$OUTPUT_DIR/.api_version" | ||
echo "$API_VERSION" > "$OUTPUT_FILE" | ||
|
||
# Remove the generated API client, just keep the models | ||
rm -rf $TEMP_OUTPUT_DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
OPENAPI_SPEC_PATH="https://raw.githubusercontent.com/GetStream/protocol/main/openapi/video-openapi-clientside.yaml" | ||
|
||
OUTPUT_DIR="./lib/open_api/video/coordinator" | ||
TEMP_OUTPUT_DIR="./lib/open_api/video/coordinator_temp" | ||
|
||
# Clean previous output | ||
rm -rf $TEMP_OUTPUT_DIR | ||
rm -rf $OUTPUT_DIR | ||
|
||
# NOTE: https://openapi-generator.tech/docs/generators/dart/ | ||
# Generate the Coordinator API models | ||
docker pull ghcr.io/getstream/openapi-generator:master | ||
docker run --rm \ | ||
-v "${TEMP_OUTPUT_DIR}:/local" ghcr.io/getstream/openapi-generator:master generate \ | ||
-i "$OPENAPI_SPEC_PATH" \ | ||
-g dart \ | ||
-o /local | ||
|
||
|
||
# Copy the generated code to the correct location | ||
cp -r $TEMP_OUTPUT_DIR/lib $OUTPUT_DIR | ||
|
||
# Write the API version to a file | ||
README_FILE="$TEMP_OUTPUT_DIR/README.md" | ||
API_VERSION=$(grep -i "API version" "$README_FILE" | awk -F ': ' '{print $2}') | ||
OUTPUT_FILE="$OUTPUT_DIR/.api_version" | ||
echo "$API_VERSION" > "$OUTPUT_FILE" | ||
|
||
# Remove the generated API client, just keep the models | ||
rm -rf $TEMP_OUTPUT_DIR |
1 change: 1 addition & 0 deletions
1
packages/stream_video/lib/open_api/video/coordinator/.api_version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v116.0.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
160 changes: 160 additions & 0 deletions
160
packages/stream_video/lib/open_api/video/coordinator/model/call_missed_event.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
// | ||
// AUTO-GENERATED FILE, DO NOT MODIFY! | ||
// | ||
// @dart=2.18 | ||
|
||
// 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 CallMissedEvent { | ||
/// Returns a new [CallMissedEvent] instance. | ||
CallMissedEvent({ | ||
required this.call, | ||
required this.callCid, | ||
required this.createdAt, | ||
this.members = const [], | ||
required this.sessionId, | ||
this.type = 'call.missed', | ||
required this.user, | ||
}); | ||
|
||
CallResponse call; | ||
|
||
String callCid; | ||
|
||
DateTime createdAt; | ||
|
||
/// List of members who missed the call | ||
List<MemberResponse> members; | ||
|
||
/// Call session ID | ||
String sessionId; | ||
|
||
/// The type of event: \"call.notification\" in this case | ||
String type; | ||
|
||
UserResponse user; | ||
|
||
@override | ||
bool operator ==(Object other) => identical(this, other) || other is CallMissedEvent && | ||
other.call == call && | ||
other.callCid == callCid && | ||
other.createdAt == createdAt && | ||
_deepEquality.equals(other.members, members) && | ||
other.sessionId == sessionId && | ||
other.type == type && | ||
other.user == user; | ||
|
||
@override | ||
int get hashCode => | ||
// ignore: unnecessary_parenthesis | ||
(call.hashCode) + | ||
(callCid.hashCode) + | ||
(createdAt.hashCode) + | ||
(members.hashCode) + | ||
(sessionId.hashCode) + | ||
(type.hashCode) + | ||
(user.hashCode); | ||
|
||
@override | ||
String toString() => 'CallMissedEvent[call=$call, callCid=$callCid, createdAt=$createdAt, members=$members, sessionId=$sessionId, 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'members'] = this.members; | ||
json[r'session_id'] = this.sessionId; | ||
json[r'type'] = this.type; | ||
json[r'user'] = this.user; | ||
return json; | ||
} | ||
|
||
/// Returns a new [CallMissedEvent] instance and imports its values from | ||
/// [value] if it's a [Map], null otherwise. | ||
// ignore: prefer_constructors_over_static_methods | ||
static CallMissedEvent? 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 "CallMissedEvent[$key]" is missing from JSON.'); | ||
assert(json[key] != null, 'Required key "CallMissedEvent[$key]" has a null value in JSON.'); | ||
}); | ||
return true; | ||
}()); | ||
|
||
return CallMissedEvent( | ||
call: CallResponse.fromJson(json[r'call'])!, | ||
callCid: mapValueOfType<String>(json, r'call_cid')!, | ||
createdAt: mapDateTime(json, r'created_at', r'')!, | ||
members: MemberResponse.listFromJson(json[r'members']), | ||
sessionId: mapValueOfType<String>(json, r'session_id')!, | ||
type: mapValueOfType<String>(json, r'type')!, | ||
user: UserResponse.fromJson(json[r'user'])!, | ||
); | ||
} | ||
return null; | ||
} | ||
|
||
static List<CallMissedEvent> listFromJson(dynamic json, {bool growable = false,}) { | ||
final result = <CallMissedEvent>[]; | ||
if (json is List && json.isNotEmpty) { | ||
for (final row in json) { | ||
final value = CallMissedEvent.fromJson(row); | ||
if (value != null) { | ||
result.add(value); | ||
} | ||
} | ||
} | ||
return result.toList(growable: growable); | ||
} | ||
|
||
static Map<String, CallMissedEvent> mapFromJson(dynamic json) { | ||
final map = <String, CallMissedEvent>{}; | ||
if (json is Map && json.isNotEmpty) { | ||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments | ||
for (final entry in json.entries) { | ||
final value = CallMissedEvent.fromJson(entry.value); | ||
if (value != null) { | ||
map[entry.key] = value; | ||
} | ||
} | ||
} | ||
return map; | ||
} | ||
|
||
// maps a json object with a list of CallMissedEvent-objects as value to a dart map | ||
static Map<String, List<CallMissedEvent>> mapListFromJson(dynamic json, {bool growable = false,}) { | ||
final map = <String, List<CallMissedEvent>>{}; | ||
if (json is Map && json.isNotEmpty) { | ||
// ignore: parameter_assignments | ||
json = json.cast<String, dynamic>(); | ||
for (final entry in json.entries) { | ||
map[entry.key] = CallMissedEvent.listFromJson(entry.value, growable: growable,); | ||
} | ||
} | ||
return map; | ||
} | ||
|
||
/// The list of required keys that must be present in a JSON. | ||
static const requiredKeys = <String>{ | ||
'call', | ||
'call_cid', | ||
'created_at', | ||
'members', | ||
'session_id', | ||
'type', | ||
'user', | ||
}; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.