Lean  $LEAN_TAG$
Messages.Notifications.cs
1 /*
2  * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
3  * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14 */
15 
16 using System.Runtime.CompilerServices;
17 using Newtonsoft.Json;
18 using Newtonsoft.Json.Linq;
19 
20 namespace QuantConnect
21 {
22  /// <summary>
23  /// Provides user-facing message construction methods and static messages for the <see cref="Notifications"/> namespace
24  /// </summary>
25  public static partial class Messages
26  {
27  /// <summary>
28  /// Provides user-facing messages for the <see cref="Notifications.NotificationEmail"/> class and its consumers or related classes
29  /// </summary>
30  public static class NotificationEmail
31  {
32  /// <summary>
33  /// Returns a string message saying the given email is invalid
34  /// </summary>
35  [MethodImpl(MethodImplOptions.AggressiveInlining)]
36  public static string InvalidEmailAddress(string email)
37  {
38  return $"Invalid email address: {email}";
39  }
40  }
41 
42  /// <summary>
43  /// Provides user-facing messages for the <see cref="Notifications.NotificationFtp"/> class and its consumers or related classes
44  /// </summary>
45  public static class NotificationFtp
46  {
47  /// <summary>
48  /// String message saying the SSH key is missing
49  /// </summary>
50  public static string MissingSSHKey = "FTP SSH key missing for SFTP notification.";
51 
52  /// <summary>
53  /// String message saying the password is missing
54  /// </summary>
55  public static string MissingPassword = "FTP password is missing for unsecure FTP notification.";
56  }
57 
58  /// <summary>
59  /// Provides user-facing messages for the <see cref="Notifications.NotificationJsonConverter"/> class and its consumers or related classes
60  /// </summary>
61  public static class NotificationJsonConverter
62  {
63  /// <summary>
64  /// String message saying the write method has not been implemented and should not be called
65  /// </summary>
66  public static string WriteNotImplemented = "Not implemented, should not be called";
67 
68  /// <summary>
69  /// String message saying the given object is unexpected
70  /// </summary>
71  [MethodImpl(MethodImplOptions.AggressiveInlining)]
72  public static string UnexpectedJsonObject(JObject jObject)
73  {
74  return $"Unexpected json object: '{jObject.ToString(Formatting.None)}'";
75  }
76  }
77  }
78 }