This repository has been archived by the owner on Feb 10, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
64 additions
and
0 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,38 @@ | ||
// Copyright (c) 2022. Heusala Group Oy <info@heusalagroup.fi>. All rights reserved. | ||
|
||
import { | ||
hasNoOtherKeysInDevelopment, | ||
isRegularObject, | ||
isStringOrUndefined | ||
} from "../../../../core/modules/lodash"; | ||
|
||
export interface MatrixLeaveRoomRequestDTO { | ||
readonly reason ?: string; | ||
} | ||
|
||
export function createMatrixLeaveRoomRequestDTO ( | ||
reason : string | undefined | ||
): MatrixLeaveRoomRequestDTO { | ||
return { | ||
reason | ||
}; | ||
} | ||
|
||
export function isMatrixLeaveRoomRequestDTO (value: any): value is MatrixLeaveRoomRequestDTO { | ||
return ( | ||
isRegularObject(value) | ||
&& hasNoOtherKeysInDevelopment(value, [ | ||
'reason' | ||
]) | ||
&& isStringOrUndefined(value?.reason) | ||
); | ||
} | ||
|
||
export function stringifyMatrixLeaveRoomRequestDTO (value: MatrixLeaveRoomRequestDTO): string { | ||
return `MatrixLeaveRoomRequestDTO(${value})`; | ||
} | ||
|
||
export function parseMatrixLeaveRoomRequestDTO (value: any): MatrixLeaveRoomRequestDTO | undefined { | ||
if ( isMatrixLeaveRoomRequestDTO(value) ) return value; | ||
return undefined; | ||
} |
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,26 @@ | ||
// Copyright (c) 2022. Heusala Group Oy <info@heusalagroup.fi>. All rights reserved. | ||
|
||
import { hasNoOtherKeysInDevelopment, isRegularObject } from "../../../../core/modules/lodash"; | ||
|
||
export interface MatrixLeaveRoomResponseDTO { | ||
} | ||
|
||
export function createMatrixLeaveRoomResponseDTO (): MatrixLeaveRoomResponseDTO { | ||
return {}; | ||
} | ||
|
||
export function isMatrixLeaveRoomResponseDTO (value: any): value is MatrixLeaveRoomResponseDTO { | ||
return ( | ||
isRegularObject(value) | ||
&& hasNoOtherKeysInDevelopment(value, []) | ||
); | ||
} | ||
|
||
export function stringifyMatrixLeaveRoomResponseDTO (value: MatrixLeaveRoomResponseDTO): string { | ||
return `MatrixLeaveRoomResponseDTO(${value})`; | ||
} | ||
|
||
export function parseMatrixLeaveRoomResponseDTO (value: any): MatrixLeaveRoomResponseDTO | undefined { | ||
if ( isMatrixLeaveRoomResponseDTO(value) ) return value; | ||
return undefined; | ||
} |