diff --git a/yavscModel/Google/Messaging/MessageWithPayLoad.cs b/yavscModel/Google/Messaging/MessageWithPayLoad.cs new file mode 100644 index 00000000..e77ae938 --- /dev/null +++ b/yavscModel/Google/Messaging/MessageWithPayLoad.cs @@ -0,0 +1,97 @@ +// +// MessageWithPayLoad.cs +// +// Author: +// paul <> +// +// Copyright (c) 2015 paul +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +using System; +using System.Web.Mvc; + +namespace Yavsc.Model.Google +{ + // https://gcm-http.googleapis.com/gcm/send + /// + /// Message with payload. + /// + public class MessageWithPayload { + /// + /// To. + /// + public string to; + /// + /// The registration identifiers. + /// + public string [] registration_ids; + /// + /// The data. + /// + public T[] data ; + /// + /// The notification. + /// + public Notification notification; + /// + /// The collapse key. + /// + public string collapse_key; // in order to collapse ... + /// + /// The priority. + /// + public int priority; // between 0 and 10, 10 is the lowest! + /// + /// The content available. + /// + public bool content_available; + /// + /// The delay while idle. + /// + public bool delay_while_idle; + /// + /// The time to live. + /// + public int time_to_live; // seconds + /// + /// The name of the restricted package. + /// + public string restricted_package_name; + /// + /// The dry run. + /// + public bool dry_run; + /// + /// Validate the specified modelState. + /// + /// Model state. + public void Validate(ModelStateDictionary modelState) { + if (to==null && registration_ids == null) { + modelState.AddModelError ("to", "One of \"to\" or \"registration_ids\" parameters must be specified"); + modelState.AddModelError ("registration_ids", "*"); + } + if (notification == null && data == null) { + modelState.AddModelError ("notification", "At least one of \"notification\" or \"data\" parameters must be specified"); + modelState.AddModelError ("data", "*"); + } + if (notification != null) { + if (notification.icon == null) + modelState.AddModelError ("notification.icon", "please, specify an icon resoure name"); + if (notification.title == null) + modelState.AddModelError ("notification.title", "please, specify a title"); + } + } + } +} + diff --git a/yavscModel/Google/Messaging/MessageWithPayloadResponse.cs b/yavscModel/Google/Messaging/MessageWithPayloadResponse.cs new file mode 100644 index 00000000..5472a8ac --- /dev/null +++ b/yavscModel/Google/Messaging/MessageWithPayloadResponse.cs @@ -0,0 +1,71 @@ +// +// MessageWithPayloadResponse.cs +// +// Author: +// paul +// +// Copyright (c) 2015 paul +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . + +using System; + +namespace Yavsc.Model.Google +{ + // https://gcm-http.googleapis.com/gcm/send + + /// + /// Message with payload response. + /// + public class MessageWithPayloadResponse { + /// + /// The multicast identifier. + /// + public int multicast_id; + /// + /// The success count. + /// + public int success; + /// + /// The failure count. + /// + public int failure; + /// + /// The canonical identifiers... ?!? + /// + public int canonical_ids; + /// + /// Detailled result. + /// + public class Result { + /// + /// The message identifier. + /// + public string message_id; + /// + /// The registration identifier. + /// + public string registration_id; + /// + /// The error. + /// + public string error; + } + + /// + /// The results. + /// + public Result [] results; + } +} diff --git a/yavscModel/Google/Messaging/Notification.cs b/yavscModel/Google/Messaging/Notification.cs new file mode 100644 index 00000000..00cf182e --- /dev/null +++ b/yavscModel/Google/Messaging/Notification.cs @@ -0,0 +1,62 @@ +// +// Notification.cs +// +// Author: +// paul <> +// +// Copyright (c) 2015 paul +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . + +using System; + +namespace Yavsc.Model.Google +{ + /// + /// Notification. + /// + public class Notification { + /// + /// The title. + /// + public string title; + /// + /// The body. + /// + public string body; + /// + /// The icon. + /// + public string icon; + /// + /// The sound. + /// + public string sound; + /// + /// The tag. + /// + public string tag; + /// + /// The color. + /// + public string color; + /// + /// The click action. + /// + public string click_action; + + } + // https://gcm-http.googleapis.com/gcm/send + +} diff --git a/yavscModel/LocalizedText.fr.Designer.cs b/yavscModel/LocalizedText.fr.Designer.cs new file mode 100644 index 00000000..1677af10 --- /dev/null +++ b/yavscModel/LocalizedText.fr.Designer.cs @@ -0,0 +1,319 @@ +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Mono Runtime Version: 4.0.30319.17020 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ + +namespace Yavsc.Model { + using System; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class LocalizedText_fr { + + private static System.Resources.ResourceManager resourceMan; + + private static System.Globalization.CultureInfo resourceCulture; + + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal LocalizedText_fr() { + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + public static System.Resources.ResourceManager ResourceManager { + get { + if (object.Equals(null, resourceMan)) { + System.Resources.ResourceManager temp = new System.Resources.ResourceManager("Yavsc.Model.LocalizedText_fr", typeof(LocalizedText_fr).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + public static System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + public static string Tex_version { + get { + return ResourceManager.GetString("Tex_version", resourceCulture); + } + } + + public static string Message_sent { + get { + return ResourceManager.GetString("Message_sent", resourceCulture); + } + } + + public static string Count { + get { + return ResourceManager.GetString("Count", resourceCulture); + } + } + + public static string was_added_to_the_role { + get { + return ResourceManager.GetString("was_added_to_the_role", resourceCulture); + } + } + + public static string Description { + get { + return ResourceManager.GetString("Description", resourceCulture); + } + } + + public static string was_added_to_the_empty_role { + get { + return ResourceManager.GetString("was_added_to_the_empty_role", resourceCulture); + } + } + + public static string My_Estimates { + get { + return ResourceManager.GetString("My_Estimates", resourceCulture); + } + } + + public static string Google_error { + get { + return ResourceManager.GetString("Google_error", resourceCulture); + } + } + + public static string StartDate { + get { + return ResourceManager.GetString("StartDate", resourceCulture); + } + } + + public static string DocTemplateException { + get { + return ResourceManager.GetString("DocTemplateException", resourceCulture); + } + } + + public static string Ciffer { + get { + return ResourceManager.GetString("Ciffer", resourceCulture); + } + } + + public static string Title { + get { + return ResourceManager.GetString("Title", resourceCulture); + } + } + + public static string MaxDate { + get { + return ResourceManager.GetString("MaxDate", resourceCulture); + } + } + + public static string younotadmin { + get { + return ResourceManager.GetString("younotadmin", resourceCulture); + } + } + + public static string ProviderName { + get { + return ResourceManager.GetString("ProviderName", resourceCulture); + } + } + + public static string Date_search { + get { + return ResourceManager.GetString("Date_search", resourceCulture); + } + } + + public static string User_name { + get { + return ResourceManager.GetString("User_name", resourceCulture); + } + } + + public static string Preview { + get { + return ResourceManager.GetString("Preview", resourceCulture); + } + } + + public static string Register { + get { + return ResourceManager.GetString("Register", resourceCulture); + } + } + + public static string access_denied { + get { + return ResourceManager.GetString("access_denied", resourceCulture); + } + } + + public static string Welcome { + get { + return ResourceManager.GetString("Welcome", resourceCulture); + } + } + + public static string Product_reference { + get { + return ResourceManager.GetString("Product_reference", resourceCulture); + } + } + + public static string EndDate { + get { + return ResourceManager.GetString("EndDate", resourceCulture); + } + } + + public static string Google_calendar { + get { + return ResourceManager.GetString("Google_calendar", resourceCulture); + } + } + + public static string UserName { + get { + return ResourceManager.GetString("UserName", resourceCulture); + } + } + + public static string Remember_me { + get { + return ResourceManager.GetString("Remember_me", resourceCulture); + } + } + + public static string ImgLocator { + get { + return ResourceManager.GetString("ImgLocator", resourceCulture); + } + } + + public static string Home { + get { + return ResourceManager.GetString("Home", resourceCulture); + } + } + + public static string Pdf_version { + get { + return ResourceManager.GetString("Pdf_version", resourceCulture); + } + } + + public static string Unitary_cost { + get { + return ResourceManager.GetString("Unitary_cost", resourceCulture); + } + } + + public static string Circles { + get { + return ResourceManager.GetString("Circles", resourceCulture); + } + } + + public static string Location { + get { + return ResourceManager.GetString("Location", resourceCulture); + } + } + + public static string Remove { + get { + return ResourceManager.GetString("Remove", resourceCulture); + } + } + + public static string Estimate_not_found { + get { + return ResourceManager.GetString("Estimate_not_found", resourceCulture); + } + } + + public static string ProviderId { + get { + return ResourceManager.GetString("ProviderId", resourceCulture); + } + } + + public static string Online { + get { + return ResourceManager.GetString("Online", resourceCulture); + } + } + + public static string Not_Approuved { + get { + return ResourceManager.GetString("Not Approuved", resourceCulture); + } + } + + public static string Offline { + get { + return ResourceManager.GetString("Offline", resourceCulture); + } + } + + public static string MinDate { + get { + return ResourceManager.GetString("MinDate", resourceCulture); + } + } + + public static string Comment { + get { + return ResourceManager.GetString("Comment", resourceCulture); + } + } + + public static string role_created { + get { + return ResourceManager.GetString("role_created", resourceCulture); + } + } + + public static string User_List { + get { + return ResourceManager.GetString("User List", resourceCulture); + } + } + + public static string EventWebPage { + get { + return ResourceManager.GetString("EventWebPage", resourceCulture); + } + } + + public static string Item_added_to_basket { + get { + return ResourceManager.GetString("Item_added_to_basket", resourceCulture); + } + } + + public static string Consultant { + get { + return ResourceManager.GetString("Consultant", resourceCulture); + } + } + } +}