feat: add optional organization id field to create app request (#2513)
This commit is contained in:
+8
-1
@@ -8,7 +8,10 @@ part 'create_app_request.g.dart';
|
||||
@JsonSerializable()
|
||||
class CreateAppRequest {
|
||||
/// {@macro create_app_request}
|
||||
const CreateAppRequest({required this.displayName});
|
||||
const CreateAppRequest({
|
||||
required this.displayName,
|
||||
this.organizationId,
|
||||
});
|
||||
|
||||
/// Converts a Map<String, dynamic> to a [CreateAppRequest]
|
||||
factory CreateAppRequest.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -19,4 +22,8 @@ class CreateAppRequest {
|
||||
|
||||
/// The display name of the app.
|
||||
final String displayName;
|
||||
|
||||
/// The id of organization that this app will belong to. If no id is provided,
|
||||
/// this app will belong to the user's personal organization.
|
||||
final int? organizationId;
|
||||
}
|
||||
|
||||
+7
-1
@@ -15,13 +15,19 @@ CreateAppRequest _$CreateAppRequestFromJson(Map<String, dynamic> json) =>
|
||||
($checkedConvert) {
|
||||
final val = CreateAppRequest(
|
||||
displayName: $checkedConvert('display_name', (v) => v as String),
|
||||
organizationId:
|
||||
$checkedConvert('organization_id', (v) => (v as num?)?.toInt()),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {'displayName': 'display_name'},
|
||||
fieldKeyMap: const {
|
||||
'displayName': 'display_name',
|
||||
'organizationId': 'organization_id'
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$CreateAppRequestToJson(CreateAppRequest instance) =>
|
||||
<String, dynamic>{
|
||||
'display_name': instance.displayName,
|
||||
'organization_id': instance.organizationId,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user