## # 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 DomainConfigMessagingServiceList < ListResource ## # Initialize the DomainConfigMessagingServiceList # @param [Version] version Version that contains the resource # @return [DomainConfigMessagingServiceList] DomainConfigMessagingServiceList def initialize(version) super(version) # Path Solution @solution = { } end # Provide a user friendly representation def to_s '#' end end ## #PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. class DomainConfigMessagingServiceContext < InstanceContext ## # Initialize the DomainConfigMessagingServiceContext # @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 [DomainConfigMessagingServiceContext] DomainConfigMessagingServiceContext def initialize(version, messaging_service_sid) super(version) # Path Solution @solution = { messaging_service_sid: messaging_service_sid, } @uri = "/LinkShortening/MessagingService/#{@solution[:messaging_service_sid]}/DomainConfig" end ## # Fetch the DomainConfigMessagingServiceInstance # @return [DomainConfigMessagingServiceInstance] Fetched DomainConfigMessagingServiceInstance def fetch payload = @version.fetch('GET', @uri) DomainConfigMessagingServiceInstance.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 DomainConfigMessagingServicePage < Page ## # Initialize the DomainConfigMessagingServicePage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [DomainConfigMessagingServicePage] DomainConfigMessagingServicePage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of DomainConfigMessagingServiceInstance # @param [Hash] payload Payload response from the API # @return [DomainConfigMessagingServiceInstance] DomainConfigMessagingServiceInstance def get_instance(payload) DomainConfigMessagingServiceInstance.new(@version, payload) end ## # Provide a user friendly representation def to_s '' end end class DomainConfigMessagingServiceInstance < InstanceResource ## # Initialize the DomainConfigMessagingServiceInstance # @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 DomainConfigMessagingService # resource. # @param [String] sid The SID of the Call resource to fetch. # @return [DomainConfigMessagingServiceInstance] DomainConfigMessagingServiceInstance def initialize(version, payload , messaging_service_sid: nil) super(version) # Marshaled Properties @properties = { 'domain_sid' => payload['domain_sid'], 'config_sid' => payload['config_sid'], 'messaging_service_sid' => payload['messaging_service_sid'], 'fallback_url' => payload['fallback_url'], 'callback_url' => payload['callback_url'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), '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 [DomainConfigMessagingServiceContext] CallContext for this CallInstance def context unless @instance_context @instance_context = DomainConfigMessagingServiceContext.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 we created to identify the Domain config (prefix ZK). def config_sid @properties['config_sid'] end ## # @return [String] The unique string that identifies the messaging service def messaging_service_sid @properties['messaging_service_sid'] end ## # @return [String] Any requests we receive to this domain that do not match an existing shortened message will be redirected to the fallback url. These will likely be either expired messages, random misdirected traffic, or intentional scraping. def fallback_url @properties['fallback_url'] end ## # @return [String] URL to receive click events to your webhook whenever the recipients click on the shortened links. def callback_url @properties['callback_url'] end ## # @return [Time] Date this Domain Config was created. def date_created @properties['date_created'] end ## # @return [Time] Date that this Domain Config was last updated. def date_updated @properties['date_updated'] end ## # @return [String] def url @properties['url'] end ## # Fetch the DomainConfigMessagingServiceInstance # @return [DomainConfigMessagingServiceInstance] Fetched DomainConfigMessagingServiceInstance 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