##
#    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 V2 < Version
                class TypingIndicatorList < ListResource
                
                    ##
                    # Initialize the TypingIndicatorList
                    # @param [Version] version Version that contains the resource
                    # @return [TypingIndicatorList] TypingIndicatorList
                    def initialize(version)
                        super(version)
                        # Path Solution
                        @solution = {  }
                        @uri = "/Indicators/Typing.json"
                        
                    end
                    ##
                    # Create the TypingIndicatorInstance
                    # @param [String] channel Shared channel identifier
                    # @param [String] message_id Message SID that identifies the conversation thread for the typing indicator. Must be a valid Twilio Message SID (SM*) or Media SID (MM*) from an existing WhatsApp conversation. 
                    # @return [TypingIndicatorInstance] Created TypingIndicatorInstance
                    def create(
                        channel: nil, 
                        message_id: nil
                    )

                        data = Twilio::Values.of({
                            'channel' => channel,
                            'messageId' => message_id,
                        })

                        headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
                        
                        
                        
                        
                        
                        payload = @version.create('POST', @uri, data: data, headers: headers)
                        TypingIndicatorInstance.new(
                            @version,
                            payload,
                        )
                    end

                


                    # Provide a user friendly representation
                    def to_s
                        '#<Twilio.Messaging.V2.TypingIndicatorList>'
                    end
                end

                class TypingIndicatorPage < Page
                    ##
                    # Initialize the TypingIndicatorPage
                    # @param [Version] version Version that contains the resource
                    # @param [Response] response Response from the API
                    # @param [Hash] solution Path solution for the resource
                    # @return [TypingIndicatorPage] TypingIndicatorPage
                    def initialize(version, response, solution)
                        super(version, response)

                        # Path Solution
                        @solution = solution
                    end

                    ##
                    # Build an instance of TypingIndicatorInstance
                    # @param [Hash] payload Payload response from the API
                    # @return [TypingIndicatorInstance] TypingIndicatorInstance
                    def get_instance(payload)
                        TypingIndicatorInstance.new(@version, payload)
                    end

                    ##
                    # Provide a user friendly representation
                    def to_s
                        '<Twilio.Messaging.V2.TypingIndicatorPage>'
                    end
                end
                class TypingIndicatorInstance < InstanceResource
                    ##
                    # Initialize the TypingIndicatorInstance
                    # @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 TypingIndicator
                    #   resource.
                    # @param [String] sid The SID of the Call resource to fetch.
                    # @return [TypingIndicatorInstance] TypingIndicatorInstance
                    def initialize(version, payload )
                        super(version)
                        
                        # Marshaled Properties
                        @properties = { 
                            'success' => payload['success'],
                        }
                    end

                    
                    ##
                    # @return [Boolean] Indicates if the typing indicator was sent successfully.
                    def success
                        @properties['success']
                    end
                    
                    ##
                    # Provide a user friendly representation
                    def to_s
                        "<Twilio.Messaging.V2.TypingIndicatorInstance>"
                    end

                    ##
                    # Provide a detailed, user friendly representation
                    def inspect
                        "<Twilio.Messaging.V2.TypingIndicatorInstance>"
                    end
                end

            end
        end
    end
end
