-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.4.0 Add analytics (https://yandex.ru/dev/dialogs/alice/doc/appmetri…
- Loading branch information
Showing
4 changed files
with
60 additions
and
3 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,24 @@ | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Serialization; | ||
|
||
namespace Yandex.Dialogs.Models.Analytics | ||
{ | ||
[JsonObject(NamingStrategyType = typeof(SnakeCaseNamingStrategy))] | ||
public class Analytics | ||
{ | ||
public Analytics() | ||
{ | ||
Events = new List<Event>(); | ||
} | ||
|
||
public ICollection<Event> Events { get; set; } | ||
|
||
public void AddEvent(string name, IDictionary<string, object> value) | ||
{ | ||
var @event = new Event(name, value); | ||
|
||
Events.Add(@event); | ||
} | ||
} | ||
} |
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,20 @@ | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Serialization; | ||
|
||
namespace Yandex.Dialogs.Models.Analytics | ||
{ | ||
[JsonObject(NamingStrategyType = typeof(SnakeCaseNamingStrategy))] | ||
public class Event | ||
{ | ||
public Event(string name, IDictionary<string, object> value) | ||
{ | ||
Name = name; | ||
Value = value; | ||
} | ||
|
||
public string Name { get; set; } | ||
|
||
public IDictionary<string, object> Value { get; set; } | ||
} | ||
} |
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
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