Sha256: 7d049144529b548dd9c37dc31ce1dd992179bdbd92d2a2b3733ec5b688894b75

Contents?: true

Size: 1.57 KB

Versions: 1

Compression:

Stored size: 1.57 KB

Contents

##
# This code was generated by
# \ / _    _  _|   _  _
#  | (_)\/(_)(_|\/| |(/_  v1.0.0
#       /       /
#
# frozen_string_literal: true

module Twilio
  module REST
    class Events
      class V1 < Version
        ##
        # Initialize the V1 version of Events
        def initialize(domain)
          super
          @version = 'v1'
          @sinks = nil
          @subscriptions = nil
        end

        ##
        # @param [String] sid A 34 character string that uniquely identifies this Sink.
        # @return [Twilio::REST::Events::V1::SinkContext] if sid was passed.
        # @return [Twilio::REST::Events::V1::SinkList]
        def sinks(sid=:unset)
          if sid.nil?
            raise ArgumentError, 'sid cannot be nil'
          elsif sid == :unset
            @sinks ||= SinkList.new self
          else
            SinkContext.new(self, sid)
          end
        end

        ##
        # @param [String] sid A 34 character string that uniquely identifies this
        #   Subscription.
        # @return [Twilio::REST::Events::V1::SubscriptionContext] if sid was passed.
        # @return [Twilio::REST::Events::V1::SubscriptionList]
        def subscriptions(sid=:unset)
          if sid.nil?
            raise ArgumentError, 'sid cannot be nil'
          elsif sid == :unset
            @subscriptions ||= SubscriptionList.new self
          else
            SubscriptionContext.new(self, sid)
          end
        end

        ##
        # Provide a user friendly representation
        def to_s
          '<Twilio::REST::Events::V1>'
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
twilio-ruby-5.40.1 lib/twilio-ruby/rest/events/v1.rb