Best Python code snippet using localstack_python
mappers.py
Source:mappers.py
...27 if configuration is not None:28 # Just take the whole typed dict and typecast it to our target type29 result = cast(ElasticsearchDestinationDescription, configuration)30 # Only specifically handle keys which are named differently or their values differ (version and clusterconfig)31 result["S3DestinationDescription"] = convert_s3_config_to_desc(32 configuration["S3Configuration"]33 )34 if "VpcConfiguration" in configuration:35 result["VpcConfigurationDescription"] = cast(36 VpcConfigurationDescription, configuration["VpcConfiguration"]37 )38 result.pop("S3Configuration", None)39 result.pop("VpcConfiguration", None)40 return result41def convert_es_update_to_desc(42 update: ElasticsearchDestinationUpdate,43) -> ElasticsearchDestinationDescription:44 if update is not None:45 # Just take the whole typed dict and typecast it to our target type46 result = cast(ElasticsearchDestinationDescription, update)47 # Only specifically handle keys which are named differently or their values differ (version and clusterconfig)48 if "S3Update" in update:49 result["S3DestinationDescription"] = cast(S3DestinationDescription, update["S3Update"])50 result.pop("S3Update", None)51 return result52def convert_opensearch_config_to_desc(53 configuration: AmazonopensearchserviceDestinationConfiguration,54) -> AmazonopensearchserviceDestinationDescription:55 if configuration is not None:56 # Just take the whole typed dict and typecast it to our target type57 result = cast(AmazonopensearchserviceDestinationDescription, configuration)58 # Only specifically handle keys which are named differently or their values differ (version and clusterconfig)59 if "S3Configuration" in configuration:60 result["S3DestinationDescription"] = convert_s3_config_to_desc(61 configuration["S3Configuration"]62 )63 if "VpcConfiguration" in configuration:64 result["VpcConfigurationDescription"] = cast(65 VpcConfigurationDescription, configuration["VpcConfiguration"]66 )67 result.pop("S3Configuration", None)68 result.pop("VpcConfiguration", None)69 return result70def convert_opensearch_update_to_desc(71 update: AmazonopensearchserviceDestinationUpdate,72) -> AmazonopensearchserviceDestinationDescription:73 if update is not None:74 # Just take the whole typed dict and typecast it to our target type75 result = cast(AmazonopensearchserviceDestinationDescription, update)76 # Only specifically handle keys which are named differently or their values differ (version and clusterconfig)77 if "S3Update" in update:78 result["S3DestinationDescription"] = cast(S3DestinationDescription, update["S3Update"])79 result.pop("S3Update", None)80 return result81def convert_s3_config_to_desc(82 configuration: S3DestinationConfiguration,83) -> S3DestinationDescription:84 if configuration:85 return cast(S3DestinationDescription, configuration)86def convert_s3_update_to_desc(update: S3DestinationUpdate) -> S3DestinationDescription:87 if update:88 return cast(S3DestinationDescription, update)89def convert_extended_s3_config_to_desc(90 configuration: ExtendedS3DestinationConfiguration,91) -> ExtendedS3DestinationDescription:92 if configuration:93 result = cast(ExtendedS3DestinationDescription, configuration)94 if "S3BackupConfiguration" in configuration:95 result["S3BackupDescription"] = convert_s3_config_to_desc(96 configuration["S3BackupConfiguration"]97 )98 result.pop("S3BackupConfiguration", None)99 return result100def convert_extended_s3_update_to_desc(101 update: ExtendedS3DestinationUpdate,102) -> ExtendedS3DestinationDescription:103 if update:104 result = cast(ExtendedS3DestinationDescription, update)105 if "S3BackupUpdate" in update:106 result["S3BackupDescription"] = convert_s3_update_to_desc(update["S3BackupUpdate"])107 result.pop("S3BackupUpdate", None)108 return result109def convert_http_config_to_desc(110 configuration: HttpEndpointDestinationConfiguration,111) -> HttpEndpointDestinationDescription:112 if configuration:113 result = cast(HttpEndpointDestinationDescription, configuration)114 if "S3Configuration" in configuration:115 result["S3DestinationDescription"] = convert_s3_config_to_desc(116 configuration["S3Configuration"]117 )118 result.pop("S3Configuration", None)119 return result120def convert_http_update_to_desc(121 update: HttpEndpointDestinationUpdate,122) -> HttpEndpointDestinationDescription:123 if update:124 result = cast(HttpEndpointDestinationDescription, update)125 if "S3Update" in update:126 result["S3DestinationDescription"] = convert_s3_update_to_desc(update["S3Update"])127 result.pop("S3Update", None)128 return result129def convert_source_config_to_desc(...
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!!