## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / # # frozen_string_literal: true module Twilio module REST class Messaging < Domain class V1 < Version class DeactivationsList < ListResource ## # Initialize the DeactivationsList # @param [Version] version Version that contains the resource # @return [DeactivationsList] DeactivationsList def initialize(version) super(version) # Path Solution @solution = {} end ## # Provide a user friendly representation def to_s '#' end end class DeactivationsPage < Page ## # Initialize the DeactivationsPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [DeactivationsPage] DeactivationsPage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of DeactivationsInstance # @param [Hash] payload Payload response from the API # @return [DeactivationsInstance] DeactivationsInstance def get_instance(payload) DeactivationsInstance.new(@version, payload, ) end ## # Provide a user friendly representation def to_s '' end end class DeactivationsContext < InstanceContext ## # Initialize the DeactivationsContext # @param [Version] version Version that contains the resource # @return [DeactivationsContext] DeactivationsContext def initialize(version) super(version) # Path Solution @solution = {} @uri = "/Deactivations" end ## # Fetch the DeactivationsInstance # @param [Date] date The request will return a list of all United States Phone # Numbers that were deactivated on the day specified by this parameter. This date # should be specified in YYYY-MM-DD format. # @return [DeactivationsInstance] Fetched DeactivationsInstance def fetch(date: :unset) params = Twilio::Values.of({'Date' => Twilio.serialize_iso8601_date(date), }) payload = @version.fetch('GET', @uri, params: params) DeactivationsInstance.new(@version, payload, ) end ## # Provide a user friendly representation def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#" end ## # Provide a detailed, user friendly representation def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#" end end class DeactivationsInstance < InstanceResource ## # Initialize the DeactivationsInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @return [DeactivationsInstance] DeactivationsInstance def initialize(version, payload) super(version) # Marshaled Properties @properties = {'redirect_to' => payload['redirect_to'], } # Context @instance_context = nil @params = {} end ## # Generate an instance context for the instance, the context is capable of # performing various actions. All instance actions are proxied to the context # @return [DeactivationsContext] DeactivationsContext for this DeactivationsInstance def context unless @instance_context @instance_context = DeactivationsContext.new(@version, ) end @instance_context end ## # @return [String] Redirect url to the list of deactivated numbers. def redirect_to @properties['redirect_to'] end ## # Fetch the DeactivationsInstance # @param [Date] date The request will return a list of all United States Phone # Numbers that were deactivated on the day specified by this parameter. This date # should be specified in YYYY-MM-DD format. # @return [DeactivationsInstance] Fetched DeactivationsInstance def fetch(date: :unset) context.fetch(date: date, ) end ## # Provide a user friendly representation def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "" end ## # Provide a detailed, user friendly representation def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "" end end end end end end