model

Base model implementation for AWS Lambda objects.

This module provides the foundational data models for the AWS Lambda library, implementing common patterns for representing and interacting with AWS Lambda resources. The models follow three key design patterns:

  1. Raw Data Storage Pattern:

All models store the original API response data in a _data attribute, treating the API response schema as potentially unstable. Properties provide a stable interface for accessing the underlying data, making the code more resilient to API changes.

  1. Property-Based Access Pattern:

All attributes are exposed through properties rather than direct instance attributes. This approach allows for lazy loading, data validation, and type conversion while maintaining a clean public interface.

  1. Core Data Extraction Pattern:

Each model implements a core_data property that returns a standardized, minimal representation of the object. This provides a consistent way to access essential information across different model types.

These models are designed to be instantiated by the API client methods, not directly by users of the library. They provide a Pythonic interface to the JSON data returned by the native boto3 AWS Lambda API.

class simple_aws_lambda.model.Base(_data: dict[str, Any] = REQ)[source]
class simple_aws_lambda.model.LatestMatchingLayerVersion(_data: LayerVersionsListItemTypeDef = REQ)[source]

Represents the latest matching version of a Lambda layer.

Ref:

Parameters:

_data

Raw data structure as returned by AWS SDK

{

‘LayerVersionArn’: ‘string’, ‘Version’: 123, ‘Description’: ‘string’, …

}

property layer_version_arn: str | None

The ARN of the layer version.

property version: int | None

The version number of the layer.

property description: str | None

The description of the layer version.

property created_date: str | None

The date that the layer version was created (ISO 8601 format).

property compatible_runtimes: list[str] | None

The layer’s compatible runtimes.

property license_info: str | None

The layer’s software license.

property compatible_architectures: list[str] | None

A list of compatible instruction set architectures.

property has_python_runtime: bool

Check if this layer version supports any Python runtime.

property has_nodejs_runtime: bool

Check if this layer version supports any Node.js runtime.

property supports_arm64: bool

Check if this layer version supports ARM64 architecture.

property supports_x86_64: bool

Check if this layer version supports x86_64 architecture.

property core_data: Dict[str, Any]

Extract core data for standardized representation.

class simple_aws_lambda.model.Layer(_data: LayersListItemTypeDef = REQ)[source]

Represents an AWS Lambda layer.

Ref:

Parameters:

_data – Raw data structure as returned by AWS SDK:

{
    'LayerName': 'string',
    'LayerArn': 'string',
    'LatestMatchingVersion': {
        ...
    }
}
property layer_name: str

The name of the layer.

property layer_arn: str

The Amazon Resource Name (ARN) of the layer.

property latest_matching_version: LatestMatchingLayerVersion | None

The latest matching version of the layer.

property has_latest_version: bool

Check if this layer has a latest matching version.

property core_data: Dict[str, Any]

Extract core data for standardized representation.

class simple_aws_lambda.model.LayerIterproxy(iterable: Iterable)[source]

Iterator proxy for collections of Layer objects with enhanced iteration capabilities.

class simple_aws_lambda.model.LayerContent(_data: LayerVersionContentOutputTypeDef)[source]

Represents the content details of a Lambda layer version.

Parameters:

_data – Raw data structure as returned by AWS SDK:

{
    'Location': 'string',
    'CodeSha256': 'string',
    'CodeSize': 123,
    'SigningProfileVersionArn': 'string',
    'SigningJobArn': 'string'
}
property location: str | None

A link to the layer archive in Amazon S3 that is valid for 10 minutes.

property code_sha256: str | None

The SHA-256 hash of the layer archive.

property code_size: int | None

The size of the layer archive in bytes.

property signing_profile_version_arn: str | None

The Amazon Resource Name (ARN) for a signing profile version.

property signing_job_arn: str | None

The Amazon Resource Name (ARN) of a signing job.

property core_data: Dict[str, Any]

Extract core data for standardized representation.

class simple_aws_lambda.model.LayerVersion(_data: LayerVersionsListItemTypeDef | GetLayerVersionResponseTypeDef = REQ)[source]

Represents a specific version of an AWS Lambda layer.

Ref:

Parameters:

_data – Raw data structure as returned by AWS SDK:

{
    'LayerVersionArn': 'string',
    'Version': 123,
    'Description': 'string',
    ...
}
# or (from get_layer_version)
{
    'Content': {
        'Location': 'string',
        'CodeSha256': 'string',
        'CodeSize': 123,
        'SigningProfileVersionArn': 'string',
        'SigningJobArn': 'string'
    },
    'LayerArn': 'string',
    'LayerVersionArn': 'string',
    'Description': 'string',
    ...
}
property layer_version_arn: str

The ARN of the layer version.

property version: int

The version number of the layer.

property description: str | None

The description of the layer version.

property created_date: str | None

The date that the layer version was created (ISO 8601 format).

property compatible_runtimes: list[str] | None

The layer’s compatible runtimes.

property license_info: str | None

The layer’s software license.

property compatible_architectures: list[str] | None

A list of compatible instruction set architectures.

property layer_arn: str | None

The ARN of the layer (only available from get_layer_version).

property content: LayerContent | None

Information about the layer’s deployment package (only from get_layer_version).

property created_datetime: datetime

Convert the created_date string to a datetime object.

property layer_name: str

Extract the layer name from the layer version ARN.

property has_content_details: bool

Check if this layer version includes content details (from get_layer_version).

property has_python_runtime: bool

Check if this layer version supports any Python runtime.

property has_nodejs_runtime: bool

Check if this layer version supports any Node.js runtime.

property has_java_runtime: bool

Check if this layer version supports any Java runtime.

property has_dotnet_runtime: bool

Check if this layer version supports any .NET runtime.

property has_go_runtime: bool

Check if this layer version supports Go runtime.

property has_ruby_runtime: bool

Check if this layer version supports any Ruby runtime.

property has_provided_runtime: bool

Check if this layer version supports provided runtime.

property supports_arm64: bool

Check if this layer version supports ARM64 architecture.

property supports_x86_64: bool

Check if this layer version supports x86_64 architecture.

property supports_multi_arch: bool

Check if this layer version supports multiple architectures.

property runtime_count: int

Number of compatible runtimes.

property architecture_count: int

Number of compatible architectures.

property core_data: Dict[str, Any]

Extract core data for standardized representation.

class simple_aws_lambda.model.LayerVersionIterproxy(iterable: Iterable)[source]

Iterator proxy for collections of LayerVersion objects with enhanced iteration capabilities.