##
#    This code was generated by
#    ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
#     |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
#     |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \
#
#    Twilio - Lookups
#    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 Lookups < LookupsBase
            class V2 < Version
                class QueryList < ListResource
                
                    class IdentityMatchParameters
                            # @param [first_name]: [String] 
                            # @param [last_name]: [String] 
                            # @param [address_line1]: [String] 
                            # @param [address_line2]: [String] 
                            # @param [city]: [String] 
                            # @param [state]: [String] 
                            # @param [postal_code]: [String] 
                            # @param [address_country_code]: [String] 
                            # @param [national_id]: [String] 
                            # @param [date_of_birth]: [String] 
                        attr_accessor :first_name, :last_name, :address_line1, :address_line2, :city, :state, :postal_code, :address_country_code, :national_id, :date_of_birth
                        def initialize(payload)
                                @first_name = payload["first_name"]
                                @last_name = payload["last_name"]
                                @address_line1 = payload["address_line1"]
                                @address_line2 = payload["address_line2"]
                                @city = payload["city"]
                                @state = payload["state"]
                                @postal_code = payload["postal_code"]
                                @address_country_code = payload["address_country_code"]
                                @national_id = payload["national_id"]
                                @date_of_birth = payload["date_of_birth"]
                        end
                        def to_json(options = {})
                        {
                                "first_name": @first_name,
                                "last_name": @last_name,
                                "address_line1": @address_line1,
                                "address_line2": @address_line2,
                                "city": @city,
                                "state": @state,
                                "postal_code": @postal_code,
                                "address_country_code": @address_country_code,
                                "national_id": @national_id,
                                "date_of_birth": @date_of_birth,
                        }.to_json(options)
                        end
                    end

                    class LastSimSwap
                            # @param [last_sim_swap_date]: [Time] 
                            # @param [swapped_period]: [String] 
                            # @param [swapped_in_period]: [Boolean] 
                        attr_accessor :last_sim_swap_date, :swapped_period, :swapped_in_period
                        def initialize(payload)
                                @last_sim_swap_date = payload["last_sim_swap_date"]
                                @swapped_period = payload["swapped_period"]
                                @swapped_in_period = payload["swapped_in_period"]
                        end
                        def to_json(options = {})
                        {
                                "last_sim_swap_date": @last_sim_swap_date,
                                "swapped_period": @swapped_period,
                                "swapped_in_period": @swapped_in_period,
                        }.to_json(options)
                        end
                    end

                    class LookupBatchRequest
                            # @param [correlation_id]: [String] Unique identifier used to match request with response
                            # @param [phone_number]: [String] 
                            # @param [fields]: [Array<String>] 
                            # @param [country_code]: [String] 
                            # @param [identity_match]: [QueryList.IdentityMatchParameters] 
                            # @param [reassigned_number]: [QueryList.ReassignedNumberParameters] 
                            # @param [sms_pumping_risk]: [QueryList.RiskParameters] 
                        attr_accessor :correlation_id, :phone_number, :fields, :country_code, :identity_match, :reassigned_number, :sms_pumping_risk
                        def initialize(payload)
                                @correlation_id = payload["correlation_id"]
                                @phone_number = payload["phone_number"]
                                @fields = payload["fields"]
                                @country_code = payload["country_code"]
                                @identity_match = payload["identity_match"]
                                @reassigned_number = payload["reassigned_number"]
                                @sms_pumping_risk = payload["sms_pumping_risk"]
                        end
                        def to_json(options = {})
                        {
                                "correlation_id": @correlation_id,
                                "phone_number": @phone_number,
                                "fields": @fields,
                                "country_code": @country_code,
                                "identity_match": @identity_match,
                                "reassigned_number": @reassigned_number,
                                "sms_pumping_risk": @sms_pumping_risk,
                        }.to_json(options)
                        end
                    end

                    class LookupRequest
                            # @param [phone_numbers]: [Array<QueryList.LookupBatchRequest>] 
                        attr_accessor :phone_numbers
                        def initialize(payload)
                                @phone_numbers = payload["phone_numbers"]
                        end
                        def to_json(options = {})
                        {
                                "phone_numbers": @phone_numbers,
                        }.to_json(options)
                        end
                    end

                    class ReassignedNumberParameters
                            # @param [last_verified_date]: [String] 
                        attr_accessor :last_verified_date
                        def initialize(payload)
                                @last_verified_date = payload["last_verified_date"]
                        end
                        def to_json(options = {})
                        {
                                "last_verified_date": @last_verified_date,
                        }.to_json(options)
                        end
                    end

                    class RiskParameters
                            # @param [partner_sub_id]: [String] 
                        attr_accessor :partner_sub_id
                        def initialize(payload)
                                @partner_sub_id = payload["partner_sub_id"]
                        end
                        def to_json(options = {})
                        {
                                "partner_sub_id": @partner_sub_id,
                        }.to_json(options)
                        end
                    end


                    ##
                    # Initialize the QueryList
                    # @param [Version] version Version that contains the resource
                    # @return [QueryList] QueryList
                    def initialize(version)
                        super(version)
                        # Path Solution
                        @solution = {  }
                        @uri = "/batch/query"
                        
                    end
                    ##
                    # Create the QueryInstance
                    # @param [LookupRequest] lookup_request 
                    # @return [QueryInstance] Created QueryInstance
                    def create(lookup_request: :unset
                    )

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

                


                    # Provide a user friendly representation
                    def to_s
                        '#<Twilio.Lookups.V2.QueryList>'
                    end
                end

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

                        # Path Solution
                        @solution = solution
                    end

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

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

                    
                    ##
                    # @return [Array<LookupBatchResponse>] 
                    def phone_numbers
                        @properties['phone_numbers']
                    end
                    
                    ##
                    # Provide a user friendly representation
                    def to_s
                        "<Twilio.Lookups.V2.QueryInstance>"
                    end

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

            end
        end
    end
end
