## # This code was generated by # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ # # Twilio - Messaging # This is the public Twilio REST API. # # NOTE: This class is auto generated by OpenAPI Generator. # https://openapi-generator.tech # Do not edit the class manually. # module Twilio module REST class Messaging < MessagingBase class V1 < Version class LinkshorteningMessagingServiceDomainAssociationList < ListResource ## # Initialize the LinkshorteningMessagingServiceDomainAssociationList # @param [Version] version Version that contains the resource # @return [LinkshorteningMessagingServiceDomainAssociationList] LinkshorteningMessagingServiceDomainAssociationList def initialize(version) super(version) # Path Solution @solution = { } end # Provide a user friendly representation def to_s '#' end end class LinkshorteningMessagingServiceDomainAssociationContext < InstanceContext ## # Initialize the LinkshorteningMessagingServiceDomainAssociationContext # @param [Version] version Version that contains the resource # @param [String] messaging_service_sid Unique string used to identify the Messaging service that this domain should be associated with. # @return [LinkshorteningMessagingServiceDomainAssociationContext] LinkshorteningMessagingServiceDomainAssociationContext def initialize(version, messaging_service_sid) super(version) # Path Solution @solution = { messaging_service_sid: messaging_service_sid, } @uri = "/LinkShortening/MessagingServices/#{@solution[:messaging_service_sid]}/Domain" end ## # Fetch the LinkshorteningMessagingServiceDomainAssociationInstance # @return [LinkshorteningMessagingServiceDomainAssociationInstance] Fetched LinkshorteningMessagingServiceDomainAssociationInstance def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) LinkshorteningMessagingServiceDomainAssociationInstance.new( @version, payload, messaging_service_sid: @solution[:messaging_service_sid], ) 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 LinkshorteningMessagingServiceDomainAssociationPage < Page ## # Initialize the LinkshorteningMessagingServiceDomainAssociationPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [LinkshorteningMessagingServiceDomainAssociationPage] LinkshorteningMessagingServiceDomainAssociationPage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of LinkshorteningMessagingServiceDomainAssociationInstance # @param [Hash] payload Payload response from the API # @return [LinkshorteningMessagingServiceDomainAssociationInstance] LinkshorteningMessagingServiceDomainAssociationInstance def get_instance(payload) LinkshorteningMessagingServiceDomainAssociationInstance.new(@version, payload) end ## # Provide a user friendly representation def to_s '' end end class LinkshorteningMessagingServiceDomainAssociationInstance < InstanceResource ## # Initialize the LinkshorteningMessagingServiceDomainAssociationInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [String] account_sid The SID of the # {Account}[https://www.twilio.com/docs/iam/api/account] that created this LinkshorteningMessagingServiceDomainAssociation # resource. # @param [String] sid The SID of the Call resource to fetch. # @return [LinkshorteningMessagingServiceDomainAssociationInstance] LinkshorteningMessagingServiceDomainAssociationInstance def initialize(version, payload , messaging_service_sid: nil) super(version) # Marshaled Properties @properties = { 'domain_sid' => payload['domain_sid'], 'messaging_service_sid' => payload['messaging_service_sid'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'messaging_service_sid' => messaging_service_sid || @properties['messaging_service_sid'] , } 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 [LinkshorteningMessagingServiceDomainAssociationContext] CallContext for this CallInstance def context unless @instance_context @instance_context = LinkshorteningMessagingServiceDomainAssociationContext.new(@version , @params['messaging_service_sid']) end @instance_context end ## # @return [String] The unique string that we created to identify the Domain resource. def domain_sid @properties['domain_sid'] end ## # @return [String] The unique string that identifies the messaging service def messaging_service_sid @properties['messaging_service_sid'] end ## # @return [String] def url @properties['url'] end ## # Fetch the LinkshorteningMessagingServiceDomainAssociationInstance # @return [LinkshorteningMessagingServiceDomainAssociationInstance] Fetched LinkshorteningMessagingServiceDomainAssociationInstance def fetch context.fetch 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