Commit 7b255715 authored by Andreas Müller's avatar Andreas Müller
Browse files

Message property is not required anymore (empty message possible)

parent a2c23dae
......@@ -28,15 +28,12 @@ namespace AMWD.Net.Api.PowerAlarm.Utils
if (string.IsNullOrWhiteSpace(request.GroupId))
throw new ArgumentNullException(nameof(request.GroupId), "The group is required");
if (string.IsNullOrWhiteSpace(request.Message))
throw new ArgumentNullException(nameof(request.Message), "The message text is required");
var jObj = new JObject
{
["apikey"] = apikey,
["action"] = "triggergroupalarm",
["kuerzel"] = request.GroupId.Trim(),
["text"] = request.Message.Trim()
["text"] = request.Message?.Trim() ?? ""
};
if (request.Latitude.HasValue)
......@@ -96,9 +93,6 @@ namespace AMWD.Net.Api.PowerAlarm.Utils
private static JObject ConvertToJObject(this CreateContactsAlarmRequest request, string apikey)
{
if (string.IsNullOrWhiteSpace(request.Message))
throw new ArgumentNullException(nameof(request.Message), "The message text is required");
if (request.Contacts?.Any() != true)
throw new ArgumentNullException(nameof(request.Contacts), "At least one contact is required");
......@@ -106,7 +100,7 @@ namespace AMWD.Net.Api.PowerAlarm.Utils
{
["apikey"] = apikey,
["action"] = "triggeralarm",
["text"] = request.Message.Trim()
["text"] = request.Message?.Trim() ?? ""
};
var contacts = new JArray();
......
......@@ -4,10 +4,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased](https://git.am-wd.de/andreasmueller/poweralarm-api/compare/v1.0.0...main) - 0000-00-00
## [Unreleased](https://git.am-wd.de/andreasmueller/poweralarm-api/compare/v1.0.1...main) - 0000-00-00
_nothing for now_
## [v1.0.1](https://git.am-wd.de/andreasmueller/poweralarm-api/compare/v1.0.0...v1.0.1) - 2022-01-10
### Added
- Changelog
### Fixed
- The `Message` for group and contact alarm can now be empty
## [v1.0.0](https://git.am-wd.de/andreasmueller/poweralarm-api/commits/v1.0.0) - 2022-01-09
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment