ApiAlerts.Common 1.0.0

dotnet add package ApiAlerts.Common --version 1.0.0
NuGet\Install-Package ApiAlerts.Common -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ApiAlerts.Common" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ApiAlerts.Common --version 1.0.0
#r "nuget: ApiAlerts.Common, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ApiAlerts.Common as a Cake Addin
#addin nuget:?package=ApiAlerts.Common&version=1.0.0

// Install ApiAlerts.Common as a Cake Tool
#tool nuget:?package=ApiAlerts.Common&version=1.0.0

ApiAlerts NuGet Package

Overview

The ApiAlerts NuGet package simplifies the process of setting up and managing alerts within your API projects. It provides functionalities to activate the package with an API key and offers methods for publishing alerts asynchronously and synchronously.

Installation

To install the ApiAlerts package, simply use NuGet Package Manager or the Package Manager Console:

PM> Install-Package ApiAlerts

Getting Started

1. Activation

Before utilizing any functionalities of the ApiAlerts package, you must activate it by providing the API key obtained from the Magpie Mobile App.

ApiAlerts.Activate(apiKey);

2. Publishing Alerts

To publish alerts, you'll utilize the IAlertService interface.

Synchronous Method

You can publish an alert synchronously using the PublishAlert method, which takes an ApiAlert object and an optional API key.

var alert = new ApiAlert { /* alert properties */ };
IAlertService alertService = new AlertService(); // Instantiate or inject IAlertService
alertService.PublishAlert(alert, optionalApiKey);
Asynchronous Method

Alternatively, you can publish an alert asynchronously using the PublishAlertAsync method, which also takes an ApiAlert object and an optional API key.

var alert = new ApiAlert { /* alert properties */ };
IAlertService alertService = new AlertService(); // Instantiate or inject IAlertService
await alertService.PublishAlertAsync(alert, optionalApiKey);

Contributing

Contributions to the ApiAlerts package are welcome! If you find any issues or have suggestions for improvements, please open an issue on the GitHub repository or submit a pull request.

License

This package is licensed under the MIT License. Feel free to use, modify, and distribute it as per the terms of the license.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 109 3/14/2024