/// <summary>
        /// Deserializes the specified dictionary.
        /// </summary>
        /// <param name="dictionary">The <see cref="IDictionary{String,Object}" />.</param>
        /// <param name="serializer">The <see cref="JavaScriptSerializer" />.</param>
        public void Deserialize(IDictionary <string, object> dictionary, JavaScriptSerializer serializer)
        {
            foreach (string key in dictionary.Keys)
            {
                switch (key)
                {
                case "error":
                    ApiUtil.ThrowIfError(dictionary, key, serializer);
                    break;

                case "forceStop":
                    ForceStop = (bool)dictionary[key];
                    break;

                case "metadata":
                    MetaData = (string)dictionary[key];
                    break;

                case "name":
                    Name = (string)dictionary[key];
                    break;

                case "time":
                    Time = Convert.ToInt64(dictionary[key]);
                    break;

                case "type":
                    // Strangely, unlike every single other place where the API specifies an enum value,
                    // we use integer values here instead of text.
                    int value = (int)dictionary[key];
                    Type = value == 0 ? CuePointType.Ad : CuePointType.Code;
                    break;

                case "videoId":
                    // Although the API docs say that this field is "A list of the ids of one or more videos that
                    // this cue point applies to", it appears that in practice this is actually only a single video
                    // ID, and not a comma-separated list.
                    VideoId = Convert.ToInt64(dictionary[key]);
                    break;

                default:
                    break;
                }
            }
        }
Example #2
0
 public CuePointBaseFilter(JToken node) : base(node)
 {
     if (node["idEqual"] != null)
     {
         this._IdEqual = node["idEqual"].Value <string>();
     }
     if (node["idIn"] != null)
     {
         this._IdIn = node["idIn"].Value <string>();
     }
     if (node["cuePointTypeEqual"] != null)
     {
         this._CuePointTypeEqual = (CuePointType)StringEnum.Parse(typeof(CuePointType), node["cuePointTypeEqual"].Value <string>());
     }
     if (node["cuePointTypeIn"] != null)
     {
         this._CuePointTypeIn = node["cuePointTypeIn"].Value <string>();
     }
     if (node["statusEqual"] != null)
     {
         this._StatusEqual = (CuePointStatus)ParseEnum(typeof(CuePointStatus), node["statusEqual"].Value <string>());
     }
     if (node["statusIn"] != null)
     {
         this._StatusIn = node["statusIn"].Value <string>();
     }
     if (node["entryIdEqual"] != null)
     {
         this._EntryIdEqual = node["entryIdEqual"].Value <string>();
     }
     if (node["entryIdIn"] != null)
     {
         this._EntryIdIn = node["entryIdIn"].Value <string>();
     }
     if (node["createdAtGreaterThanOrEqual"] != null)
     {
         this._CreatedAtGreaterThanOrEqual = ParseInt(node["createdAtGreaterThanOrEqual"].Value <string>());
     }
     if (node["createdAtLessThanOrEqual"] != null)
     {
         this._CreatedAtLessThanOrEqual = ParseInt(node["createdAtLessThanOrEqual"].Value <string>());
     }
     if (node["updatedAtGreaterThanOrEqual"] != null)
     {
         this._UpdatedAtGreaterThanOrEqual = ParseInt(node["updatedAtGreaterThanOrEqual"].Value <string>());
     }
     if (node["updatedAtLessThanOrEqual"] != null)
     {
         this._UpdatedAtLessThanOrEqual = ParseInt(node["updatedAtLessThanOrEqual"].Value <string>());
     }
     if (node["triggeredAtGreaterThanOrEqual"] != null)
     {
         this._TriggeredAtGreaterThanOrEqual = ParseInt(node["triggeredAtGreaterThanOrEqual"].Value <string>());
     }
     if (node["triggeredAtLessThanOrEqual"] != null)
     {
         this._TriggeredAtLessThanOrEqual = ParseInt(node["triggeredAtLessThanOrEqual"].Value <string>());
     }
     if (node["tagsLike"] != null)
     {
         this._TagsLike = node["tagsLike"].Value <string>();
     }
     if (node["tagsMultiLikeOr"] != null)
     {
         this._TagsMultiLikeOr = node["tagsMultiLikeOr"].Value <string>();
     }
     if (node["tagsMultiLikeAnd"] != null)
     {
         this._TagsMultiLikeAnd = node["tagsMultiLikeAnd"].Value <string>();
     }
     if (node["startTimeGreaterThanOrEqual"] != null)
     {
         this._StartTimeGreaterThanOrEqual = ParseInt(node["startTimeGreaterThanOrEqual"].Value <string>());
     }
     if (node["startTimeLessThanOrEqual"] != null)
     {
         this._StartTimeLessThanOrEqual = ParseInt(node["startTimeLessThanOrEqual"].Value <string>());
     }
     if (node["userIdEqual"] != null)
     {
         this._UserIdEqual = node["userIdEqual"].Value <string>();
     }
     if (node["userIdIn"] != null)
     {
         this._UserIdIn = node["userIdIn"].Value <string>();
     }
     if (node["partnerSortValueEqual"] != null)
     {
         this._PartnerSortValueEqual = ParseInt(node["partnerSortValueEqual"].Value <string>());
     }
     if (node["partnerSortValueIn"] != null)
     {
         this._PartnerSortValueIn = node["partnerSortValueIn"].Value <string>();
     }
     if (node["partnerSortValueGreaterThanOrEqual"] != null)
     {
         this._PartnerSortValueGreaterThanOrEqual = ParseInt(node["partnerSortValueGreaterThanOrEqual"].Value <string>());
     }
     if (node["partnerSortValueLessThanOrEqual"] != null)
     {
         this._PartnerSortValueLessThanOrEqual = ParseInt(node["partnerSortValueLessThanOrEqual"].Value <string>());
     }
     if (node["forceStopEqual"] != null)
     {
         this._ForceStopEqual = (NullableBoolean)ParseEnum(typeof(NullableBoolean), node["forceStopEqual"].Value <string>());
     }
     if (node["systemNameEqual"] != null)
     {
         this._SystemNameEqual = node["systemNameEqual"].Value <string>();
     }
     if (node["systemNameIn"] != null)
     {
         this._SystemNameIn = node["systemNameIn"].Value <string>();
     }
 }
 public CuePoint(JToken node) : base(node)
 {
     if (node["id"] != null)
     {
         this._Id = node["id"].Value <string>();
     }
     if (node["intId"] != null)
     {
         this._IntId = ParseInt(node["intId"].Value <string>());
     }
     if (node["cuePointType"] != null)
     {
         this._CuePointType = (CuePointType)StringEnum.Parse(typeof(CuePointType), node["cuePointType"].Value <string>());
     }
     if (node["status"] != null)
     {
         this._Status = (CuePointStatus)ParseEnum(typeof(CuePointStatus), node["status"].Value <string>());
     }
     if (node["entryId"] != null)
     {
         this._EntryId = node["entryId"].Value <string>();
     }
     if (node["partnerId"] != null)
     {
         this._PartnerId = ParseInt(node["partnerId"].Value <string>());
     }
     if (node["createdAt"] != null)
     {
         this._CreatedAt = ParseInt(node["createdAt"].Value <string>());
     }
     if (node["updatedAt"] != null)
     {
         this._UpdatedAt = ParseInt(node["updatedAt"].Value <string>());
     }
     if (node["triggeredAt"] != null)
     {
         this._TriggeredAt = ParseInt(node["triggeredAt"].Value <string>());
     }
     if (node["tags"] != null)
     {
         this._Tags = node["tags"].Value <string>();
     }
     if (node["startTime"] != null)
     {
         this._StartTime = ParseInt(node["startTime"].Value <string>());
     }
     if (node["userId"] != null)
     {
         this._UserId = node["userId"].Value <string>();
     }
     if (node["partnerData"] != null)
     {
         this._PartnerData = node["partnerData"].Value <string>();
     }
     if (node["partnerSortValue"] != null)
     {
         this._PartnerSortValue = ParseInt(node["partnerSortValue"].Value <string>());
     }
     if (node["forceStop"] != null)
     {
         this._ForceStop = (NullableBoolean)ParseEnum(typeof(NullableBoolean), node["forceStop"].Value <string>());
     }
     if (node["thumbOffset"] != null)
     {
         this._ThumbOffset = ParseInt(node["thumbOffset"].Value <string>());
     }
     if (node["systemName"] != null)
     {
         this._SystemName = node["systemName"].Value <string>();
     }
     if (node["isMomentary"] != null)
     {
         this._IsMomentary = ParseBool(node["isMomentary"].Value <string>());
     }
     if (node["copiedFrom"] != null)
     {
         this._CopiedFrom = node["copiedFrom"].Value <string>();
     }
 }
        public CuePoint(XmlElement node) : base(node)
        {
            foreach (XmlElement propertyNode in node.ChildNodes)
            {
                switch (propertyNode.Name)
                {
                case "id":
                    this._Id = propertyNode.InnerText;
                    continue;

                case "cuePointType":
                    this._CuePointType = (CuePointType)StringEnum.Parse(typeof(CuePointType), propertyNode.InnerText);
                    continue;

                case "status":
                    this._Status = (CuePointStatus)ParseEnum(typeof(CuePointStatus), propertyNode.InnerText);
                    continue;

                case "entryId":
                    this._EntryId = propertyNode.InnerText;
                    continue;

                case "partnerId":
                    this._PartnerId = ParseInt(propertyNode.InnerText);
                    continue;

                case "createdAt":
                    this._CreatedAt = ParseInt(propertyNode.InnerText);
                    continue;

                case "updatedAt":
                    this._UpdatedAt = ParseInt(propertyNode.InnerText);
                    continue;

                case "triggeredAt":
                    this._TriggeredAt = ParseInt(propertyNode.InnerText);
                    continue;

                case "tags":
                    this._Tags = propertyNode.InnerText;
                    continue;

                case "startTime":
                    this._StartTime = ParseInt(propertyNode.InnerText);
                    continue;

                case "userId":
                    this._UserId = propertyNode.InnerText;
                    continue;

                case "partnerData":
                    this._PartnerData = propertyNode.InnerText;
                    continue;

                case "partnerSortValue":
                    this._PartnerSortValue = ParseInt(propertyNode.InnerText);
                    continue;

                case "forceStop":
                    this._ForceStop = (NullableBoolean)ParseEnum(typeof(NullableBoolean), propertyNode.InnerText);
                    continue;

                case "thumbOffset":
                    this._ThumbOffset = ParseInt(propertyNode.InnerText);
                    continue;

                case "systemName":
                    this._SystemName = propertyNode.InnerText;
                    continue;
                }
            }
        }
 /// <summary>
 /// Constructor.
 /// </summary>
 public BrightcoveCuePoint()
 {
     Type = CuePointType.Code;
 }
Example #6
0
        public CuePointBaseFilter(XmlElement node) : base(node)
        {
            foreach (XmlElement propertyNode in node.ChildNodes)
            {
                switch (propertyNode.Name)
                {
                case "idEqual":
                    this._IdEqual = propertyNode.InnerText;
                    continue;

                case "idIn":
                    this._IdIn = propertyNode.InnerText;
                    continue;

                case "cuePointTypeEqual":
                    this._CuePointTypeEqual = (CuePointType)StringEnum.Parse(typeof(CuePointType), propertyNode.InnerText);
                    continue;

                case "cuePointTypeIn":
                    this._CuePointTypeIn = propertyNode.InnerText;
                    continue;

                case "statusEqual":
                    this._StatusEqual = (CuePointStatus)ParseEnum(typeof(CuePointStatus), propertyNode.InnerText);
                    continue;

                case "statusIn":
                    this._StatusIn = propertyNode.InnerText;
                    continue;

                case "entryIdEqual":
                    this._EntryIdEqual = propertyNode.InnerText;
                    continue;

                case "entryIdIn":
                    this._EntryIdIn = propertyNode.InnerText;
                    continue;

                case "createdAtGreaterThanOrEqual":
                    this._CreatedAtGreaterThanOrEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "createdAtLessThanOrEqual":
                    this._CreatedAtLessThanOrEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "updatedAtGreaterThanOrEqual":
                    this._UpdatedAtGreaterThanOrEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "updatedAtLessThanOrEqual":
                    this._UpdatedAtLessThanOrEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "triggeredAtGreaterThanOrEqual":
                    this._TriggeredAtGreaterThanOrEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "triggeredAtLessThanOrEqual":
                    this._TriggeredAtLessThanOrEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "tagsLike":
                    this._TagsLike = propertyNode.InnerText;
                    continue;

                case "tagsMultiLikeOr":
                    this._TagsMultiLikeOr = propertyNode.InnerText;
                    continue;

                case "tagsMultiLikeAnd":
                    this._TagsMultiLikeAnd = propertyNode.InnerText;
                    continue;

                case "startTimeGreaterThanOrEqual":
                    this._StartTimeGreaterThanOrEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "startTimeLessThanOrEqual":
                    this._StartTimeLessThanOrEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "userIdEqual":
                    this._UserIdEqual = propertyNode.InnerText;
                    continue;

                case "userIdIn":
                    this._UserIdIn = propertyNode.InnerText;
                    continue;

                case "partnerSortValueEqual":
                    this._PartnerSortValueEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "partnerSortValueIn":
                    this._PartnerSortValueIn = propertyNode.InnerText;
                    continue;

                case "partnerSortValueGreaterThanOrEqual":
                    this._PartnerSortValueGreaterThanOrEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "partnerSortValueLessThanOrEqual":
                    this._PartnerSortValueLessThanOrEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "forceStopEqual":
                    this._ForceStopEqual = (NullableBoolean)ParseEnum(typeof(NullableBoolean), propertyNode.InnerText);
                    continue;

                case "systemNameEqual":
                    this._SystemNameEqual = propertyNode.InnerText;
                    continue;

                case "systemNameIn":
                    this._SystemNameIn = propertyNode.InnerText;
                    continue;
                }
            }
        }
		/// <summary>
		/// Constructor.
		/// </summary>
		public BrightcoveCuePoint()
		{
			Type = CuePointType.Code;
		}
		/// <summary>
		/// Deserializes the specified dictionary.
		/// </summary>
		/// <param name="dictionary">The <see cref="IDictionary{String,Object}" />.</param>
		/// <param name="serializer">The <see cref="JavaScriptSerializer" />.</param>
		public void Deserialize(IDictionary<string, object> dictionary, JavaScriptSerializer serializer)
		{
			foreach (string key in dictionary.Keys)
			{
				switch (key)
				{
					case "error":
						ApiUtil.ThrowIfError(dictionary, key, serializer);
						break;

					case "forceStop":
						ForceStop = (bool)dictionary[key];
						break;

					case "metadata":
						MetaData = (string) dictionary[key];
						break;

					case "name":
						Name = (string)dictionary[key];
						break;

					case "time":
						Time = Convert.ToInt64(dictionary[key]);
						break;

					case "type":
						// Strangely, unlike every single other place where the API specifies an enum value,
						// we use integer values here instead of text.
						int value = (int) dictionary[key];
						Type = value == 0 ? CuePointType.Ad : CuePointType.Code;
						break; 

					case "videoId":
						// Although the API docs say that this field is "A list of the ids of one or more videos that 
						// this cue point applies to", it appears that in practice this is actually only a single video
						// ID, and not a comma-separated list.
						VideoId = Convert.ToInt64(dictionary[key]);
						break;

					default:
						break;
				}
			}
		}