Best Python code snippet using localstack_python
literals.pyi
Source:literals.pyi
1"""2Type annotations for lambda service literal definitions.3[Open documentation](https://vemel.github.io/boto3_stubs_docs/mypy_boto3_lambda/literals.html)4Usage::5 ```python6 from mypy_boto3_lambda.literals import ArchitectureType7 data: ArchitectureType = "arm64"8 ```9"""10import sys11if sys.version_info >= (3, 8):12 from typing import Literal13else:14 from typing_extensions import Literal15__all__ = (16 "ArchitectureType",17 "CodeSigningPolicyType",18 "EndPointTypeType",19 "EventSourcePositionType",20 "FunctionActiveV2WaiterName",21 "FunctionActiveWaiterName",22 "FunctionExistsWaiterName",23 "FunctionResponseTypeType",24 "FunctionUpdatedV2WaiterName",25 "FunctionUpdatedWaiterName",26 "FunctionUrlAuthTypeType",27 "FunctionVersionType",28 "InvocationTypeType",29 "LastUpdateStatusReasonCodeType",30 "LastUpdateStatusType",31 "ListAliasesPaginatorName",32 "ListCodeSigningConfigsPaginatorName",33 "ListEventSourceMappingsPaginatorName",34 "ListFunctionEventInvokeConfigsPaginatorName",35 "ListFunctionUrlConfigsPaginatorName",36 "ListFunctionsByCodeSigningConfigPaginatorName",37 "ListFunctionsPaginatorName",38 "ListLayerVersionsPaginatorName",39 "ListLayersPaginatorName",40 "ListProvisionedConcurrencyConfigsPaginatorName",41 "ListVersionsByFunctionPaginatorName",42 "LogTypeType",43 "PackageTypeType",44 "ProvisionedConcurrencyStatusEnumType",45 "RuntimeType",46 "SourceAccessTypeType",47 "StateReasonCodeType",48 "StateType",49 "TracingModeType",50)51ArchitectureType = Literal["arm64", "x86_64"]52CodeSigningPolicyType = Literal["Enforce", "Warn"]53EndPointTypeType = Literal["KAFKA_BOOTSTRAP_SERVERS"]54EventSourcePositionType = Literal["AT_TIMESTAMP", "LATEST", "TRIM_HORIZON"]55FunctionActiveV2WaiterName = Literal["function_active_v2"]56FunctionActiveWaiterName = Literal["function_active"]57FunctionExistsWaiterName = Literal["function_exists"]58FunctionResponseTypeType = Literal["ReportBatchItemFailures"]59FunctionUpdatedV2WaiterName = Literal["function_updated_v2"]60FunctionUpdatedWaiterName = Literal["function_updated"]61FunctionUrlAuthTypeType = Literal["AWS_IAM", "NONE"]62FunctionVersionType = Literal["ALL"]63InvocationTypeType = Literal["DryRun", "Event", "RequestResponse"]64LastUpdateStatusReasonCodeType = Literal[65 "EniLimitExceeded",66 "ImageAccessDenied",67 "ImageDeleted",68 "InsufficientRolePermissions",69 "InternalError",70 "InvalidConfiguration",71 "InvalidImage",72 "InvalidSecurityGroup",73 "InvalidSubnet",74 "SubnetOutOfIPAddresses",75]76LastUpdateStatusType = Literal["Failed", "InProgress", "Successful"]77ListAliasesPaginatorName = Literal["list_aliases"]78ListCodeSigningConfigsPaginatorName = Literal["list_code_signing_configs"]79ListEventSourceMappingsPaginatorName = Literal["list_event_source_mappings"]80ListFunctionEventInvokeConfigsPaginatorName = Literal["list_function_event_invoke_configs"]81ListFunctionUrlConfigsPaginatorName = Literal["list_function_url_configs"]82ListFunctionsByCodeSigningConfigPaginatorName = Literal["list_functions_by_code_signing_config"]83ListFunctionsPaginatorName = Literal["list_functions"]84ListLayerVersionsPaginatorName = Literal["list_layer_versions"]85ListLayersPaginatorName = Literal["list_layers"]86ListProvisionedConcurrencyConfigsPaginatorName = Literal["list_provisioned_concurrency_configs"]87ListVersionsByFunctionPaginatorName = Literal["list_versions_by_function"]88LogTypeType = Literal["None", "Tail"]89PackageTypeType = Literal["Image", "Zip"]90ProvisionedConcurrencyStatusEnumType = Literal["FAILED", "IN_PROGRESS", "READY"]91RuntimeType = Literal[92 "dotnet6",93 "dotnetcore1.0",94 "dotnetcore2.0",95 "dotnetcore2.1",96 "dotnetcore3.1",97 "go1.x",98 "java11",99 "java8",100 "java8.al2",101 "nodejs",102 "nodejs10.x",103 "nodejs12.x",104 "nodejs14.x",105 "nodejs16.x",106 "nodejs4.3",107 "nodejs4.3-edge",108 "nodejs6.10",109 "nodejs8.10",110 "provided",111 "provided.al2",112 "python2.7",113 "python3.6",114 "python3.7",115 "python3.8",116 "python3.9",117 "ruby2.5",118 "ruby2.7",119]120SourceAccessTypeType = Literal[121 "BASIC_AUTH",122 "CLIENT_CERTIFICATE_TLS_AUTH",123 "SASL_SCRAM_256_AUTH",124 "SASL_SCRAM_512_AUTH",125 "SERVER_ROOT_CA_CERTIFICATE",126 "VIRTUAL_HOST",127 "VPC_SECURITY_GROUP",128 "VPC_SUBNET",129]130StateReasonCodeType = Literal[131 "Creating",132 "EniLimitExceeded",133 "Idle",134 "ImageAccessDenied",135 "ImageDeleted",136 "InsufficientRolePermissions",137 "InternalError",138 "InvalidConfiguration",139 "InvalidImage",140 "InvalidSecurityGroup",141 "InvalidSubnet",142 "Restoring",143 "SubnetOutOfIPAddresses",144]145StateType = Literal["Active", "Failed", "Inactive", "Pending"]...
__init__.pyi
Source:__init__.pyi
1"""2Main interface for lambda service.3Usage::4 ```python5 import boto36 from mypy_boto3_lambda import (7 Client,8 FunctionActiveV2Waiter,9 FunctionActiveWaiter,10 FunctionExistsWaiter,11 FunctionUpdatedV2Waiter,12 FunctionUpdatedWaiter,13 LambdaClient,14 ListAliasesPaginator,15 ListCodeSigningConfigsPaginator,16 ListEventSourceMappingsPaginator,17 ListFunctionEventInvokeConfigsPaginator,18 ListFunctionUrlConfigsPaginator,19 ListFunctionsByCodeSigningConfigPaginator,20 ListFunctionsPaginator,21 ListLayerVersionsPaginator,22 ListLayersPaginator,23 ListProvisionedConcurrencyConfigsPaginator,24 ListVersionsByFunctionPaginator,25 )26 session = boto3.Session()27 client: LambdaClient = boto3.client("lambda")28 session_client: LambdaClient = session.client("lambda")29 function_active_waiter: FunctionActiveWaiter = client.get_waiter("function_active")30 function_active_v2_waiter: FunctionActiveV2Waiter = client.get_waiter("function_active_v2")31 function_exists_waiter: FunctionExistsWaiter = client.get_waiter("function_exists")32 function_updated_waiter: FunctionUpdatedWaiter = client.get_waiter("function_updated")33 function_updated_v2_waiter: FunctionUpdatedV2Waiter = client.get_waiter("function_updated_v2")34 list_aliases_paginator: ListAliasesPaginator = client.get_paginator("list_aliases")35 list_code_signing_configs_paginator: ListCodeSigningConfigsPaginator = client.get_paginator("list_code_signing_configs")36 list_event_source_mappings_paginator: ListEventSourceMappingsPaginator = client.get_paginator("list_event_source_mappings")37 list_function_event_invoke_configs_paginator: ListFunctionEventInvokeConfigsPaginator = client.get_paginator("list_function_event_invoke_configs")38 list_function_url_configs_paginator: ListFunctionUrlConfigsPaginator = client.get_paginator("list_function_url_configs")39 list_functions_paginator: ListFunctionsPaginator = client.get_paginator("list_functions")40 list_functions_by_code_signing_config_paginator: ListFunctionsByCodeSigningConfigPaginator = client.get_paginator("list_functions_by_code_signing_config")41 list_layer_versions_paginator: ListLayerVersionsPaginator = client.get_paginator("list_layer_versions")42 list_layers_paginator: ListLayersPaginator = client.get_paginator("list_layers")43 list_provisioned_concurrency_configs_paginator: ListProvisionedConcurrencyConfigsPaginator = client.get_paginator("list_provisioned_concurrency_configs")44 list_versions_by_function_paginator: ListVersionsByFunctionPaginator = client.get_paginator("list_versions_by_function")45 ```46"""47from .client import LambdaClient48from .paginator import (49 ListAliasesPaginator,50 ListCodeSigningConfigsPaginator,51 ListEventSourceMappingsPaginator,52 ListFunctionEventInvokeConfigsPaginator,53 ListFunctionsByCodeSigningConfigPaginator,54 ListFunctionsPaginator,55 ListFunctionUrlConfigsPaginator,56 ListLayersPaginator,57 ListLayerVersionsPaginator,58 ListProvisionedConcurrencyConfigsPaginator,59 ListVersionsByFunctionPaginator,60)61from .waiter import (62 FunctionActiveV2Waiter,63 FunctionActiveWaiter,64 FunctionExistsWaiter,65 FunctionUpdatedV2Waiter,66 FunctionUpdatedWaiter,67)68Client = LambdaClient69__all__ = (70 "Client",71 "FunctionActiveV2Waiter",72 "FunctionActiveWaiter",73 "FunctionExistsWaiter",74 "FunctionUpdatedV2Waiter",75 "FunctionUpdatedWaiter",76 "LambdaClient",77 "ListAliasesPaginator",78 "ListCodeSigningConfigsPaginator",79 "ListEventSourceMappingsPaginator",80 "ListFunctionEventInvokeConfigsPaginator",81 "ListFunctionUrlConfigsPaginator",82 "ListFunctionsByCodeSigningConfigPaginator",83 "ListFunctionsPaginator",84 "ListLayerVersionsPaginator",85 "ListLayersPaginator",86 "ListProvisionedConcurrencyConfigsPaginator",87 "ListVersionsByFunctionPaginator",...
lambda_function.py
Source:lambda_function.py
...32 urls = []33 for functionArn in functionArnList:34 print("Finding URLs for function: "+functionArn)35 try:36 urls.extend([function['FunctionUrl'] for function in client.list_function_url_configs(FunctionName=functionArn)['FunctionUrlConfigs']])37 except client.exceptions.ResourceNotFoundException:38 print('No URL configs found for lambda: ',functionArn)39 40 print('\n\nFunction URLs found:\n',urls,'\n\n')41 # Get all aliases for each function42 # TODO: Deal with results pagination43 aliases = dict()44 for functionArn in functionArnList:45 try:46 for alias in client.list_aliases(FunctionName=functionArn)['Aliases']:47 aliases[alias["Name"]] = functionArn48 except client.exceptions.ResourceNotFoundException:49 print('No aliases found for lambda: ',functionArn)50 print('\n\nList of aliases:\n', aliases,'\n\n')...
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!!