Best Python code snippet using localstack_python
get_gateway_response.py
Source:get_gateway_response.py
...65 id=self.id,66 response_parameters=self.response_parameters,67 response_templates=self.response_templates,68 status_code=self.status_code)69def get_gateway_response(id: Optional[str] = None,70 opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetGatewayResponseResult:71 """72 Resource Type definition for AWS::ApiGateway::GatewayResponse73 :param str id: A Cloudformation auto generated ID.74 """75 __args__ = dict()76 __args__['id'] = id77 opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)78 __ret__ = pulumi.runtime.invoke('aws-native:apigateway:getGatewayResponse', __args__, opts=opts, typ=GetGatewayResponseResult).value79 return AwaitableGetGatewayResponseResult(80 id=__ret__.id,81 response_parameters=__ret__.response_parameters,82 response_templates=__ret__.response_templates,83 status_code=__ret__.status_code)...
ApiTask.py
Source:ApiTask.py
...27 elif api['description'] != api_description:28 client.update_rest_api(restApiId=api['id'], patchOperations=[{'op': 'replace', 'path': '/description', 'value': api_description}])29 result = self.CHANGED 30 if 'cors' in self.params:31 errResponse4 = client.get_gateway_response(restApiId=api['id'], responseType='DEFAULT_4XX')32 errResponse5 = client.get_gateway_response(restApiId=api['id'], responseType='DEFAULT_5XX')33 if self.params['cors'] == True:34 client.update_gateway_response(restApiId=api['id'], responseType='DEFAULT_4XX', patchOperations=[{'op': 'add', 'path': '/responseParameters/gatewayresponse.header.Access-Control-Allow-Origin', 'value': "'*'"}])35 client.update_gateway_response(restApiId=api['id'], responseType='DEFAULT_5XX', patchOperations=[{'op': 'add', 'path': '/responseParameters/gatewayresponse.header.Access-Control-Allow-Origin', 'value': "'*'"}])36 result = self.CHANGED 37 elif self.params['cors'] == False:38 client.update_gateway_response(restApiId=api['id'], responseType='DEFAULT_4XX', patchOperations=[{'op': 'remove', 'path': '/responseParameters/gatewayresponse.header.Access-Control-Allow-Origin'}])39 client.update_gateway_response(restApiId=api['id'], responseType='DEFAULT_5XX', patchOperations=[{'op': 'remove', 'path': '/responseParameters/gatewayresponse.header.Access-Control-Allow-Origin'}])40 result = self.CHANGED 41 cache.put('api', api['name'], api['id'])...
lambda_function.py
Source:lambda_function.py
...26 response = {27 "message": "Tà i khoản hoặc máºt khẩu không chÃnh xác.",28 "data": {}29 }30 return get_gateway_response(sc.BAD_REQUEST.value, json.dumps(response))31 32 return get_gateway_response(sc.SUCCESS.value, 33 json.dumps(response))34 except Exception as err:35 logger.debug(f"Exception: {str(err)}")36 response = {37 "message": "Há» thá»ng lá»i. Vui lòng thá» lại sau.",38 "data": {}39 }...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!