Sha256: 783b5cfbaae365ddaa64caa0d8c5b33b2d07045c9981b35966f61a57dbd09f85

Contents?: true

Size: 1.81 KB

Versions: 1

Compression:

Stored size: 1.81 KB

Contents

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

module Twilio
  module REST
    class Messaging
      class V1 < Version
        ##
        # Initialize the V1 version of Messaging
        def initialize(domain)
          super
          @version = 'v1'
          @brand_registrations = nil
          @deactivations = nil
          @services = nil
        end

        ##
        # @param [String] sid The SID of the Brand Registration resource to fetch.
        # @return [Twilio::REST::Messaging::V1::BrandRegistrationContext] if sid was passed.
        # @return [Twilio::REST::Messaging::V1::BrandRegistrationList]
        def brand_registrations(sid=:unset)
          if sid.nil?
            raise ArgumentError, 'sid cannot be nil'
          elsif sid == :unset
            @brand_registrations ||= BrandRegistrationList.new self
          else
            BrandRegistrationContext.new(self, sid)
          end
        end

        ##
        # @return [Twilio::REST::Messaging::V1::DeactivationsContext]
        def deactivations
          @deactivations ||= DeactivationsContext.new self
        end

        ##
        # @param [String] sid The SID of the Service resource to fetch.
        # @return [Twilio::REST::Messaging::V1::ServiceContext] if sid was passed.
        # @return [Twilio::REST::Messaging::V1::ServiceList]
        def services(sid=:unset)
          if sid.nil?
            raise ArgumentError, 'sid cannot be nil'
          elsif sid == :unset
            @services ||= ServiceList.new self
          else
            ServiceContext.new(self, sid)
          end
        end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
twilio-ruby-5.48.0 lib/twilio-ruby/rest/messaging/v1.rb