ó ByòYc@s¿ddlZddlZddlmZddlmZddlmZmZddl m Z ej e ƒZ ee _dZdefd„ƒYZd d d „ƒYZd efd „ƒYZdS(iÿÿÿÿN(tBytesIO(tFunctionArnFields(t IPCClientt IPCException(tmocksL^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$tInvocationExceptioncBseZRS((t__name__t __module__(((sŠ/rhel5pdi/workplace/yunusko/lambda-blueprints/src/LambdaConsoleResources/blueprints/greengrass-hello-world/test/../greengrasssdk/Lambda.pyRstClientcBs2eZddd„Zd„Zedd„ƒZRS(t localhosti@cCstd|d|ƒ|_dS(s :param endpoint: Endpoint used to connect to IPC. :type endpoint: str :param port: Port number used to connect to the :code:`endpoint`. :type port: int tendpointtportN(Rtipc(tselfR R ((sŠ/rhel5pdi/workplace/yunusko/lambda-blueprints/src/LambdaConsoleResources/blueprints/greengrass-hello-world/test/../greengrasssdk/Lambda.pyt__init__sc Kskd|krtdƒ‚nt|dƒ}|j}|jddƒ}|rm|rm||krmtdƒ‚n|ry|n|}tj|j|j|j|ƒ}y|jddƒjƒ}Wn,t k rê}t j |ƒtdƒ‚nX|rt j t|ƒstdƒ‚qn|jd dƒ} |jd d ƒ} t jd j|| |ƒƒ|j|| || ƒS( Nt FunctionNames\"FunctionName" argument of Lambda.Client.invoke is a required argument but was not provided.t QualifiertsTThe derived qualifier from the function name does not match the specified qualifier.t ClientContexts`"ClientContext" argument must be a byte string or support a decode method which returns a stringsH"ClientContext" argument of Lambda.Client.invoke must be base64 encoded.tPayloadtInvocationTypetRequestResponsesDInvoking local lambda "{}" with payload "{}" and client context "{}"(t ValueErrorRt qualifiertgettbuild_arn_stringtregiont account_idtnametdecodetAttributeErrortcustomer_loggert exceptiontretmatchtvalid_base64_regextinfotformatt_invoke_internal( R tkwargst arn_fieldst arn_qualifiertextraneous_qualifiertfinal_qualifiert function_arntclient_contexttetpayloadtinvocation_type((sŠ/rhel5pdi/workplace/yunusko/lambda-blueprints/src/LambdaConsoleResources/blueprints/greengrass-hello-world/test/../greengrasssdk/Lambda.pytinvoke's2      Rc Csçtjdj||ƒƒy‘|jj||||ƒ}|dkrUidd6dd6S|jj||ƒ}|js…t|jƒ}n |j}i|d6|jd6}|SWn6t k râ} tj | ƒt dt | ƒƒ‚nXdS(sh This private method is seperate from the main, public invoke method so that other code within this SDK can give this Lambda client a raw payload/client context to invoke with, rather than having it built for them. This lets you include custom ExtensionMap_ values like subject which are needed for our internal pinned Lambdas. s:Invoking Lambda function "{}" with Greengrass Message "{}"tEventRRt FunctionErrors!Failed to invoke function due to N( RR$R%R t post_worktget_work_resulttfunc_errt StreamingBodyR/RR Rtstr( R R,R/R-R0t invocation_idtwork_result_outputtoutput_payloadt invoke_outputR.((sŠ/rhel5pdi/workplace/yunusko/lambda-blueprints/src/LambdaConsoleResources/blueprints/greengrass-hello-world/test/../greengrasssdk/Lambda.pyR&Us      (RRRR1RR&(((sŠ/rhel5pdi/workplace/yunusko/lambda-blueprints/src/LambdaConsoleResources/blueprints/greengrass-hello-world/test/../greengrasssdk/Lambda.pyRs .R7cBs,eZdZd„Zdd„Zd„ZRS(soWrapper class for http response payload This provides a consistent interface to AWS Lambda Python SDK cCst|ƒ|_d|_dS(Ni(Rt _raw_streamt _amount_read(R R/((sŠ/rhel5pdi/workplace/yunusko/lambda-blueprints/src/LambdaConsoleResources/blueprints/greengrass-hello-world/test/../greengrasssdk/Lambda.pyRzscCs+|jj|ƒ}|jt|ƒ7_|S(sgRead at most amt bytes from the stream. If the amt argument is omitted, read all data. (R=treadR>tlen(R tamttchunk((sŠ/rhel5pdi/workplace/yunusko/lambda-blueprints/src/LambdaConsoleResources/blueprints/greengrass-hello-world/test/../greengrasssdk/Lambda.pyR?~scCs|jjƒdS(N(R=tclose(R ((sŠ/rhel5pdi/workplace/yunusko/lambda-blueprints/src/LambdaConsoleResources/blueprints/greengrass-hello-world/test/../greengrasssdk/Lambda.pyRC†sN(RRt__doc__RtNoneR?RC(((sŠ/rhel5pdi/workplace/yunusko/lambda-blueprints/src/LambdaConsoleResources/blueprints/greengrass-hello-world/test/../greengrasssdk/Lambda.pyR7us  ((tloggingR!tioRt%greengrass_common.function_arn_fieldsRt$greengrass_ipc_python_sdk.ipc_clientRRtgreengrasssdk.utils.testingRt getLoggerRRtTruet propagateR#t ExceptionRRtobjectR7(((sŠ/rhel5pdi/workplace/yunusko/lambda-blueprints/src/LambdaConsoleResources/blueprints/greengrass-hello-world/test/../greengrasssdk/Lambda.pyts   Y