1̟ddlmZddlmZddlmZmZmZmZm Z ddl m Z dZ dZ GddZeeged fZ eGd d eZd S) ) annotations) dataclass)Any AwaitableCallableDictOptional)MsgzNats-Service-ErrorzNats-Service-Error-CodeceZdZUded<ddZeddZedd Zedd ZdddZ dddZ dS)Requestr _msgmsgreturnNonec"||_d|_dS)N)r _error)selfrs r/builddir/build/BUILD/imunify360-venv-2.6.2/opt/imunify360/venv/lib/python3.11/site-packages/nats/micro/request.py__init__zRequest.__init__s  strc|jjS)z*The subject on which request was received.)r subjectrs rrzRequest.subject!y  rOptional[Dict[str, str]]c|jjS)zThe headers of the request.)r headersrs rrzRequest.headers&rrbytesc|jjS)zThe data of the request.)r datars rr!z Request.data+sy~rrNr!rcK|jjstd|jj|jj||d{VdS)zSend a response to the request. :param data: The response data. :param headers: Additional response headers. zno reply subject setrN)r reply ValueError_clientpublish)rr!rs rrespondzRequest.respond0sz y 5344 4i'' IO (           rcode descriptioncK|r|}ni}|t|t|i|||d{VdS)a$Send an error response to the request. :param code: The error code describing the error. :param description: A string describing the error which can be displayed to the client. :param data: The error data. :param headers: Additional response headers. r#N)copyupdate ERROR_HEADERERROR_CODE_HEADERr()rr)r*r!rs r respond_errorzRequest.respond_error?sy  llnnGGGk!4    ll4l11111111111r)rr rrrr)rr)rr)rN)r!rrrrr) r)rr*rr!rrrrr) __name__ __module__ __qualname____annotations__rpropertyrrr!r(r0rrr r s III!!!X!!!!X!X      &,0 2222222rr NcLeZdZUded<ded<d dZd dZed d Zd S) ServiceErrorrr)r*rc$|jd|jS)N:r)r*rs r__repr__zServiceError.__repr__es)00d.000rDict[str, Any]c |j|jdS)Nr<r<rs rto_dictzServiceError.to_dicths $2BCCCrr!cl||dd|ddS)Nr)r*r<)get)clsr!s r from_dictzServiceError.from_dictks4s,,$((=RT:U:UVVVVrNr1)rr>)r!r>rr9)r2r3r4r5r=r@ classmethodrEr7rrr9r9`s} III1111DDDDWWW[WWWrr9) __future__r dataclassesrtypingrrrrr nats.aio.msgr r.r/r Handler Exceptionr9r7rrrMs#"""""!!!!!!;;;;;;;;;;;;;;# -?2?2?2?2?2?2?2?2D G9io- .=  W W W W W9 W W  W W Wr