URL and List Promoter (Converters/Promoter.cs)

twilio-csharp · src/Twilio/Converters/Promoter.cs · csharp · MIT
voice, dev-tools, ui, tag:utility, tag:conversion, tag:uri

Utility to convert string URLs to Uri objects and wrap single items into a list. Useful for normalizing inputs in Twilio SDKs.

// Source: https://github.com/twilio/twilio-csharp | License: MIT | Copyright 2023, Twilio, Inc. <https://www.twilio.com/help/contact>
// Provided via justclaw.it.com; keep this notice with the code.
using System;
using System.Collections.Generic;

namespace Twilio.Converters
{
    /// <summary>
    /// Promote objects
    /// </summary>
    public class Promoter
    {
        /// <summary>
        /// Convert a string URL to a Uri object
        /// </summary>
        /// <param name="url">URL to convert</param>
        /// <returns>Converted Uri</returns>
        public static Uri UriFromString(string url)
        {
            return new Uri(url);
        }

        /// <summary>
        /// Promote a single entry to a List of one
        /// </summary>
        /// <param name="one">si

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key