obs_models.dart
1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import 'package:json_annotation/json_annotation.dart';
part 'obs_models.g.dart';
@JsonSerializable()
class ObsTokenRequest {
const ObsTokenRequest({
this.source = 'doublefeel',
required this.fileType,
required this.count,
required this.scene,
});
final String source;
@JsonKey(name: 'file_type')
final String fileType;
final int count;
final String scene;
factory ObsTokenRequest.fromJson(Map<String, dynamic> json) =>
_$ObsTokenRequestFromJson(json);
Map<String, dynamic> toJson() => _$ObsTokenRequestToJson(this);
}
@JsonSerializable()
class ObsTokenResponse {
const ObsTokenResponse({
this.keys,
this.token,
this.host,
this.endPoint,
this.bucket,
});
final List<String>? keys;
final ObsToken? token;
final String? host;
@JsonKey(name: 'endpoint')
final String? endPoint;
final String? bucket;
factory ObsTokenResponse.fromJson(Map<String, dynamic> json) =>
_$ObsTokenResponseFromJson(json);
Map<String, dynamic> toJson() => _$ObsTokenResponseToJson(this);
}
@JsonSerializable()
class ObsToken {
const ObsToken({
this.accessKey,
this.secretKey,
this.securityToken,
this.expiration,
});
@JsonKey(name: 'access_key')
final String? accessKey;
@JsonKey(name: 'secret_key')
final String? secretKey;
@JsonKey(name: 'security_token')
final String? securityToken;
final String? expiration;
factory ObsToken.fromJson(Map<String, dynamic> json) =>
_$ObsTokenFromJson(json);
Map<String, dynamic> toJson() => _$ObsTokenToJson(this);
}