lib/twilio-ruby/rest/messaging/v1/service.rb in twilio-ruby-6.0.0.pre.rc.1 vs lib/twilio-ruby/rest/messaging/v1/service.rb in twilio-ruby-6.0.0.pre.rc.2

- old
+ new

@@ -203,14 +203,14 @@ @solution = { sid: sid, } @uri = "/Services/#{@solution[:sid]}" # Dependents @us_app_to_person_usecases = nil - @alpha_senders = nil @short_codes = nil @us_app_to_person = nil @phone_numbers = nil + @alpha_senders = nil end ## # Delete the ServiceInstance # @return [Boolean] True if delete succeeds, false otherwise def delete @@ -310,32 +310,10 @@ end @us_app_to_person_usecases end ## - # Access the alpha_senders - # @return [AlphaSenderList] - # @return [AlphaSenderContext] if sid was passed. - def alpha_senders(sid=:unset) - - raise ArgumentError, 'sid cannot be nil' if sid.nil? - - if sid != :unset - return AlphaSenderContext.new(@version, @solution[:sid],sid ) - end - - unless @alpha_senders - @alpha_senders = AlphaSenderList.new( - @version, - service_sid: @solution[:sid] - - ) - end - - @alpha_senders - end - ## # Access the short_codes # @return [ShortCodeList] # @return [ShortCodeContext] if sid was passed. def short_codes(sid=:unset) @@ -397,11 +375,33 @@ ) end @phone_numbers end + ## + # Access the alpha_senders + # @return [AlphaSenderList] + # @return [AlphaSenderContext] if sid was passed. + def alpha_senders(sid=:unset) + raise ArgumentError, 'sid cannot be nil' if sid.nil? + + if sid != :unset + return AlphaSenderContext.new(@version, @solution[:sid],sid ) + end + + unless @alpha_senders + @alpha_senders = AlphaSenderList.new( + @version, + service_sid: @solution[:sid] + + ) + end + + @alpha_senders + end + ## # Provide a user friendly representation def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Messaging.V1.ServiceContext #{context}>" @@ -717,17 +717,10 @@ def us_app_to_person_usecases context.us_app_to_person_usecases end ## - # Access the alpha_senders - # @return [alpha_senders] alpha_senders - def alpha_senders - context.alpha_senders - end - - ## # Access the short_codes # @return [short_codes] short_codes def short_codes context.short_codes end @@ -742,9 +735,16 @@ ## # Access the phone_numbers # @return [phone_numbers] phone_numbers def phone_numbers context.phone_numbers + end + + ## + # Access the alpha_senders + # @return [alpha_senders] alpha_senders + def alpha_senders + context.alpha_senders end ## # Provide a user friendly representation def to_s