public Verb(string s) { var sArr = s.Split('\''); suffixes = new List <Suffix>(); try { word = (VerbEnum)Enum.Parse(typeof(VerbEnum), sArr[0]); foreach (string suffix in sArr.Skip(1)) { suffixes.Add((Suffix)Enum.Parse(typeof(Suffix), suffix)); } } catch { word = VerbEnum.Fizzle; } }
/// <summary> /// Initializes a new instance of the <see cref="NewWebhook" /> class. /// </summary> /// <param name="applicationIds">The IDs of the applications that are related to this entity. (required).</param> /// <param name="title">Friendly title for this webhook (required).</param> /// <param name="verb">API method for this webhook (required).</param> /// <param name="url">API url (supports templating using parameters) for this webhook (required).</param> /// <param name="headers">List of API HTTP headers for this webhook (required).</param> /// <param name="payload">API payload (supports templating using parameters) for this webhook.</param> /// <param name="_params">Array of template argument definitions (required).</param> /// <param name="enabled">Enables or disables webhook from showing in rule builder (required).</param> public NewWebhook(List <int> applicationIds = default(List <int>), string title = default(string), VerbEnum verb = default(VerbEnum), string url = default(string), List <string> headers = default(List <string>), string payload = default(string), List <TemplateArgDef> _params = default(List <TemplateArgDef>), bool enabled = default(bool)) { // to ensure "applicationIds" is required (not null) if (applicationIds == null) { throw new InvalidDataException("applicationIds is a required property for NewWebhook and cannot be null"); } else { this.ApplicationIds = applicationIds; } // to ensure "title" is required (not null) if (title == null) { throw new InvalidDataException("title is a required property for NewWebhook and cannot be null"); } else { this.Title = title; } // to ensure "verb" is required (not null) if (verb == null) { throw new InvalidDataException("verb is a required property for NewWebhook and cannot be null"); } else { this.Verb = verb; } // to ensure "url" is required (not null) if (url == null) { throw new InvalidDataException("url is a required property for NewWebhook and cannot be null"); } else { this.Url = url; } // to ensure "headers" is required (not null) if (headers == null) { throw new InvalidDataException("headers is a required property for NewWebhook and cannot be null"); } else { this.Headers = headers; } // to ensure "_params" is required (not null) if (_params == null) { throw new InvalidDataException("_params is a required property for NewWebhook and cannot be null"); } else { this.Params = _params; } // to ensure "enabled" is required (not null) if (enabled == null) { throw new InvalidDataException("enabled is a required property for NewWebhook and cannot be null"); } else { this.Enabled = enabled; } this.Payload = payload; }