/* * Copyright 2015-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ using System.Collections; using System.Collections.Generic; using Amazon.MobileAnalytics.MobileAnalyticsManager.Internal; using System; namespace Amazon.MobileAnalytics.MobileAnalyticsManager { /// /// Interface for Mobile Analytics Event. /// public interface IEvent { #region attribute /// /// Adds the attribute. /// /// Attribute name. Max name length is 50. /// Attribute value. Max value length is 255. void AddAttribute(string attributeName, string attributeValue); /// /// Determines whether this instance has attribute the specified attributeName. /// /// true if this instance has attribute the specified attributeName; otherwise, false. /// Attribute name. bool HasAttribute(string attributeName); /// /// Gets the attribute. /// /// The attribute. Return null if the attribute doesn't exist. /// Attribute name. string GetAttribute(string attributeName); /// /// Gets all attributes. /// /// All the attributes. IDictionary AllAttributes { get; } #endregion #region metric /// /// Adds the metric. /// /// Metric name. Max length is 50. /// Metric value. void AddMetric(string metricName, double metricValue); /// /// Determines whether this instance has metric the specified metricName. /// /// true if this instance has metric the specified metricName; otherwise, false. /// Metric name. bool HasMetric(string metricName); /// /// Gets the metric. /// /// The metric. Return null if metric doesn't exist. /// Metric name. double? GetMetric(string metricName); /// /// Gets all metrics. /// /// All the metrics. IDictionary AllMetrics { get; } #endregion #region gloablattribute /// /// Adds the global attribute, which is valid for all events. /// /// Attribute name. Max length is 50. /// Attribute value. Max length is 255. void AddGlobalAttribute(string attributeName, string attributeValue); /// /// Adds the global attribute, which is valid to some specific event type. /// /// Event type. /// Attribute name. Max length is 50. /// Attribute value. Max length is 255. void AddGlobalAttribute(string eventType, string attributeName, string attributeValue); /// /// Removes the global attribute, which is valid for all events. /// /// Attribute name. void RemoveGlobalAttribute(string attributeName); /// /// Removes the global attribute, which is valid to some specific event type. /// /// Event type. /// Attribute name. void RemoveGlobalAttribute(string eventType, string attributeName); /// /// Gets the global attribute, which is valid for all events. /// /// The global attribute. Return null if attribute doesn't exist. /// Attribute name. string GetGlobalAttribute(string attributeName); /// /// Gets the global attribute, which is valid for some specific event type. /// /// The global attribute. Return null if attribute doesn't exist. /// Event type. /// Attribute name. string GetGlobalAttribute(string eventType, string attributeName); #endregion #region globalmetric /// /// Adds the global metric, which is valid for all events. /// /// Metric name. Max length is 50. /// Metric value. void AddGlobalMetric(string metricName, double metricValue); /// /// Adds the global metric, which is valid for some specific event type. /// /// Event type. /// Metric name. Max length is 50. /// Metric value. void AddGlobalMetric(string eventType, string metricName, double metricValue); /// /// Removes the global metric, which is valid for all events. /// /// Metric name. void RemoveGlobalMetric(string metricName); /// /// Removes the global metric, which is valid for some specific event type. /// /// Event type. /// Metric name. void RemoveGlobalMetric(string eventType,string metricName); /// /// Gets the global metric, which is valid for all events. /// /// The global metric.Return null if metric doesn't exist. /// Metric name. double? GetGlobalMetric(string metricName); /// /// Gets the global metric, which is valid for some specific event type. /// /// The global metric.Return null if metric doesn't exist. /// Event type. /// Metric name. double? GetGlobalMetric(string eventType, string metricName); #endregion } }