コード例 #1
0
ファイル: Events.cs プロジェクト: mrockmann/twilio-dotnet
 private void AddEventListOptions(EventListRequest options, RestRequest request)
 {
     if (options.StartDate.HasValue) {
         request.AddParameter("StartDate", options.StartDate.Value.ToString("yyyy-MM-ddTHH:mm:ssK"));
     }
     if (options.EndDate.HasValue) {
         request.AddParameter("EndDate", options.EndDate.Value.ToString("yyyy-MM-ddTHH:mm:ssK"));
     }
     if (options.ActorSid.HasValue()) {
         request.AddParameter("ActorSid", options.ActorSid);
     }
     if (options.SourceIpAddress.HasValue()) {
         request.AddParameter("SourceIpAddress", options.SourceIpAddress);
     }
     if (options.ResourceSid.HasValue()) {
         request.AddParameter("ResourceSid", options.ResourceSid);
     }
     if (options.EventType.HasValue()) {
         request.AddParameter("EventType", options.EventType);
     }
     if (options.PageToken.HasValue()) {
         request.AddParameter("PageToken", options.PageToken);
     }
     if (options.Count.HasValue) {
         request.AddParameter("PageSize", options.Count.Value);
     }
 }
コード例 #2
0
ファイル: Events.cs プロジェクト: sorianojr/twilio-csharp
 private void AddEventListOptions(EventListRequest options, RestRequest request)
 {
     if (options.StartDate.HasValue)
     {
         request.AddParameter("StartDate", options.StartDate.Value.ToString("yyyy-MM-ddTHH:mm:ssK"));
     }
     if (options.EndDate.HasValue)
     {
         request.AddParameter("EndDate", options.EndDate.Value.ToString("yyyy-MM-ddTHH:mm:ssK"));
     }
     if (options.ActorSid.HasValue())
     {
         request.AddParameter("ActorSid", options.ActorSid);
     }
     if (options.SourceIpAddress.HasValue())
     {
         request.AddParameter("SourceIpAddress", options.SourceIpAddress);
     }
     if (options.ResourceSid.HasValue())
     {
         request.AddParameter("ResourceSid", options.ResourceSid);
     }
     if (options.EventType.HasValue())
     {
         request.AddParameter("EventType", options.EventType);
     }
     if (options.PageToken.HasValue())
     {
         request.AddParameter("PageToken", options.PageToken);
     }
     if (options.Count.HasValue)
     {
         request.AddParameter("PageSize", options.Count.Value);
     }
 }
コード例 #3
0
ファイル: Events.Async.cs プロジェクト: nkerkin/twilio-csharp
        /// <summary>
        /// Lists the events.
        /// </summary>
        public virtual void ListEvents(EventListRequest options, Action<EventResult> callback)
        {
            var request = new RestRequest();
            request.Resource = "Events";

            AddEventListOptions(options, request);

            ExecuteAsync<EventResult>(request, callback);
        }
コード例 #4
0
ファイル: Events.cs プロジェクト: mrockmann/twilio-dotnet
        /// <summary>
        /// Lists the events.
        /// </summary>
        /// <param name="options">Options.</param>
        public virtual EventResult ListEvents(EventListRequest options)
        {
            var request = new RestRequest();
            request.Resource = "Events";

            AddEventListOptions(options, request);

            return Execute<EventResult>(request);
        }
コード例 #5
0
        /// <summary>
        /// Lists the events.
        /// </summary>
        /// <param name="options">Options.</param>
        public virtual async Task<EventResult> ListEventsAsync(EventListRequest options)
        {
            var request = new RestRequest();
            request.Resource = "Events";

            AddEventListOptions(options, request);

            return await Execute<EventResult>(request);
        }
コード例 #6
0
        /// <summary>
        /// Lists the events.
        /// </summary>
        public virtual void ListEvents(EventListRequest options, Action <EventResult> callback)
        {
            var request = new RestRequest();

            request.Resource = "Events";

            AddEventListOptions(options, request);

            ExecuteAsync <EventResult>(request, callback);
        }
コード例 #7
0
ファイル: Events.cs プロジェクト: sorianojr/twilio-csharp
        /// <summary>
        /// Lists the events.
        /// </summary>
        /// <param name="options">Options.</param>
        public virtual EventResult ListEvents(EventListRequest options)
        {
            var request = new RestRequest();

            request.Resource = "Events";

            AddEventListOptions(options, request);

            return(Execute <EventResult>(request));
        }
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/user/account
        string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        string AuthToken = "your_auth_token";
        var monitor = new MonitorClient(AccountSid, AuthToken);

        var options = new EventListRequest();
        options.ResourceSid = "PN4aa51b930717ea83c91971b86d99018f";
        var events = monitor.ListEvents(options);
        foreach (var e in events.Events)
        {
          Console.WriteLine(e.Description);
        }
    }
コード例 #9
0
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/user/account
        string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        string AuthToken = "your_auth_token";
        var monitor = new MonitorClient(AccountSid, AuthToken);

        var options = new EventListRequest();
        options.StartDate = new DateTime(2015, 3, 1);
        options.EndDate = new DateTime(2015, 4, 1);
        var events = monitor.ListEvents(options);
        foreach (var e in events.Events)
        {
          Console.WriteLine(e.Description);
        }
    }