##
#    This code was generated by
#    ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
#     |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
#     |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \
#
#    Twilio - Marketplace
#    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 Marketplace < MarketplaceBase
            class V1 < Version
                class ReferralConversionList < ListResource
                
                    class CreateReferralConversionRequest
                            # @param [referral_account_sid]: [String] 
                        attr_accessor :referral_account_sid
                        def initialize(payload)
                                @referral_account_sid = payload["referral_account_sid"]
                        end
                        def to_json(options = {})
                        {
                                "referral_account_sid": @referral_account_sid,
                        }.to_json(options)
                        end
                    end


                    ##
                    # Initialize the ReferralConversionList
                    # @param [Version] version Version that contains the resource
                    # @return [ReferralConversionList] ReferralConversionList
                    def initialize(version)
                        super(version)
                        # Path Solution
                        @solution = {  }
                        @uri = "/ReferralConversion"
                        
                    end
                    ##
                    # Create the ReferralConversionInstance
                    # @param [CreateReferralConversionRequest] create_referral_conversion_request 
                    # @return [ReferralConversionInstance] Created ReferralConversionInstance
                    def create(create_referral_conversion_request: nil
                    )

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

                


                    # Provide a user friendly representation
                    def to_s
                        '#<Twilio.Marketplace.V1.ReferralConversionList>'
                    end
                end

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

                        # Path Solution
                        @solution = solution
                    end

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

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

                    
                    ##
                    # @return [String] 
                    def converted_account_sid
                        @properties['converted_account_sid']
                    end
                    
                    ##
                    # Provide a user friendly representation
                    def to_s
                        "<Twilio.Marketplace.V1.ReferralConversionInstance>"
                    end

                    ##
                    # Provide a detailed, user friendly representation
                    def inspect
                        "<Twilio.Marketplace.V1.ReferralConversionInstance>"
                    end
                end

            end
        end
    end
end
