
    r.h                        S SK JrJr  S SKJr  S SKJr  S SKJr  S SKJ	r	J
r
JrJrJrJr  S SKJrJrJrJrJrJrJr  \" 5       r\R1                  S\	S9\" \R2                  5      4S	\
4S
 jj5       r\R7                  S\S9S SSSSSS\" \R2                  5      4S\S\S\\   S\\   S\\   S\\   S\\   4S jj5       r\R1                  S\S/S9\" \R2                  5      4S\4S jj5       r\R7                  S\S9S SSSSSS\" \R2                  5      4S\S\S\\   S\\   S\\   S\\   S\\   4S jj5       r \R7                  S\	S9\" \R2                  5      4S\4S jj5       r!\R1                  S\	S9\" \R2                  5      4S\S	\
4S jj5       r"\RG                  S\	S9\" \R2                  5      4S\S \4S! jj5       r$\RK                  S\	S9\" \R2                  5      4S\4S" jj5       r&g)#    )	APIRouterDepends)datetime)Optional)database)	IotDeviceIotDeviceCreateIotDeviceUpdateIotDeviceListIotDeviceWithMappingListNearbyDevicesRequest)create_iot_device_serviceget_iot_device_serviceupdate_iot_device_servicedelete_iot_device_servicelist_iot_devices_service%list_iot_devices_with_mapping_servicelist_nearby_devices_service/)response_modeldevicec                 4   #    [        X5      I S h  vN $  N7fNr   )r   dbs     PC:\Suresh\moveshuttle\MDcreated\moveengine\app\v1\routers\platform\iotdevices.pycreate_iot_devicer           *66666   z/with-mapping
   Nskiplimitqdevice_typestatus	date_fromdate_toc           
          [        XX#XEXg5      $ r   )r   r!   r"   r#   r$   r%   r&   r'   r   s           r   list_iot_devices_with_mappingr*      s     1QV     z/nearbyzIoT Devices)r   tagspayloadc                 Z    [        U R                  U R                  U R                  U5      $ r   )r   latitude	longitude	radius_km)r-   r   s     r   list_nearby_devicesr2   $   s/    
 '
	 r+   c           
      :   #    [        XX#XEXg5      I S h  vN $  N7fr   )r   r)   s           r   list_iot_devicesr4   0   s      *$qvZaffffs   z/{account_id}
account_idc                 4   #    [        X5      I S h  vN $  N7fr   )r   r5   r   s     r   get_iot_devicer8   =   s     '
7777r   c                 4   #    [        X5      I S h  vN $  N7fr   r   )r5   r   r   s      r   post_iot_devicer:   A   r   r   updatec                 6   #    [        XU5      I S h  vN $  N7fr   )r   )r5   r;   r   s      r   update_iot_devicer=   E   s     *:rBBBBs   c                 4   #    [        X5      I S h  vN $  N7fr   )r   r7   s     r   delete_iot_devicer?   I   s     *:::::r   )'fastapir   r   r   typingr   app.dbr   !app.v1.models.platform.iotdevicesr   r	   r
   r   r   r   #app.v1.services.platform.iotdevicesr   r   r   r   r   r   r   routerpostget_mongo_dbr   getintstrr*   r2   r4   r8   r:   putr=   deleter?    r+   r   <module>rN      s   &       
S+8?@U@U8V 7O 7 ,7 O,DE!% #!x$$%
 } #	
 SM } c] F Y'?}oV x$$%	!	 W	 C.!% #!x$$%
g

g
g }
g #	
g
 SM
g }
g c]
g /
g OI6-4X5J5J-K 8S 8 78 _Y7GNxOdOdGe 7c 7? 7 87 OI6IPQYQfQfIg C C_ C 7C y9078M8M0N ; ; :;r+   