Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions samtranslator/schema/aws_serverless_application.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
from __future__ import annotations

from typing import Optional, Any, Dict, Union

from typing_extensions import Literal

from samtranslator.schema.common import PassThrough, BaseModel, SamIntrinsicable
from samtranslator.schema.common import PassThrough, BaseModel, SamIntrinsicable, get_prop

location = get_prop("sam-property-application-applicationlocationobject")
properties = get_prop("sam-resource-application")


class Location(BaseModel):
ApplicationId: SamIntrinsicable[str]
SemanticVersion: SamIntrinsicable[str]
ApplicationId: SamIntrinsicable[str] = location("ApplicationId")
SemanticVersion: SamIntrinsicable[str] = location("SemanticVersion")


class Properties(BaseModel):
Location: Union[str, Location]
NotificationARNs: Optional[PassThrough]
Parameters: Optional[PassThrough]
Tags: Optional[Dict[str, Any]]
TimeoutInMinutes: Optional[PassThrough]
Location: Union[str, Location] = properties("Location")
NotificationARNs: Optional[PassThrough] = properties("NotificationARNs")
Parameters: Optional[PassThrough] = properties("Parameters")
Tags: Optional[Dict[str, Any]] = properties("Tags")
TimeoutInMinutes: Optional[PassThrough] = properties("TimeoutInMinutes")


class Resource(BaseModel):
Expand Down
27 changes: 15 additions & 12 deletions samtranslator/schema/aws_serverless_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,27 @@

from typing_extensions import Literal

from samtranslator.schema.common import PassThrough, BaseModel
from samtranslator.schema.common import PassThrough, BaseModel, get_prop

resourcereference = get_prop("sam-property-connector-resourcereference")
properties = get_prop("sam-resource-connector")


class ResourceReference(BaseModel):
Id: Optional[str]
Arn: Optional[PassThrough]
Name: Optional[PassThrough]
Qualifier: Optional[PassThrough]
QueueUrl: Optional[PassThrough]
ResourceId: Optional[PassThrough]
RoleName: Optional[PassThrough]
Type: Optional[str]
Id: Optional[str] = resourcereference("Id")
Arn: Optional[PassThrough] = resourcereference("Arn")
Name: Optional[PassThrough] = resourcereference("Name")
Qualifier: Optional[PassThrough] = resourcereference("Qualifier")
QueueUrl: Optional[PassThrough] = resourcereference("QueueUrl")
ResourceId: Optional[PassThrough] = resourcereference("ResourceId")
RoleName: Optional[PassThrough] = resourcereference("RoleName")
Type: Optional[str] = resourcereference("Type")


class Properties(BaseModel):
Source: ResourceReference
Destination: ResourceReference
Permissions: List[Literal["Read", "Write"]]
Source: ResourceReference = properties("Source")
Destination: ResourceReference = properties("Destination")
Permissions: List[Literal["Read", "Write"]] = properties("Permissions")


class Resource(BaseModel):
Expand Down
27 changes: 16 additions & 11 deletions samtranslator/schema/aws_serverless_layerversion.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
from __future__ import annotations

from typing import Optional, Union

from typing_extensions import Literal

from samtranslator.schema.common import PassThrough, BaseModel, SamIntrinsicable
from samtranslator.schema.common import PassThrough, BaseModel, SamIntrinsicable, get_prop

contenturi = get_prop("sam-property-layerversion-layercontent")
properties = get_prop("sam-resource-layerversion")


class ContentUri(BaseModel):
Bucket: PassThrough
Key: PassThrough
Version: Optional[PassThrough]
Bucket: PassThrough = contenturi("Bucket")
Key: PassThrough = contenturi("Key")
Version: Optional[PassThrough] = contenturi("Version")


class Properties(BaseModel):
CompatibleArchitectures: Optional[PassThrough]
CompatibleRuntimes: Optional[PassThrough]
ContentUri: Union[str, ContentUri]
Description: Optional[PassThrough]
LayerName: Optional[PassThrough]
LicenseInfo: Optional[PassThrough]
RetentionPolicy: Optional[SamIntrinsicable[str]]
CompatibleArchitectures: Optional[PassThrough] = properties("CompatibleArchitectures")
CompatibleRuntimes: Optional[PassThrough] = properties("CompatibleRuntimes")
ContentUri: Union[str, ContentUri] = properties("ContentUri")
Description: Optional[PassThrough] = properties("Description")
LayerName: Optional[PassThrough] = properties("LayerName")
LicenseInfo: Optional[PassThrough] = properties("LicenseInfo")
RetentionPolicy: Optional[SamIntrinsicable[str]] = properties("RetentionPolicy")


class Resource(BaseModel):
Expand Down
23 changes: 14 additions & 9 deletions samtranslator/schema/aws_serverless_simpletable.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
from __future__ import annotations

from typing import Optional, Any, Dict

from typing_extensions import Literal

from samtranslator.schema.common import PassThrough, BaseModel
from samtranslator.schema.common import PassThrough, BaseModel, get_prop

primarykey = get_prop("sam-property-simpletable-primarykeyobject")
properties = get_prop("sam-resource-simpletable")


class PrimaryKey(BaseModel):
Name: PassThrough
Type: PassThrough
Name: PassThrough = primarykey("Name")
Type: PassThrough = primarykey("Type")


SSESpecification = Optional[PassThrough]


class Properties(BaseModel):
PrimaryKey: Optional[PrimaryKey]
ProvisionedThroughput: Optional[PassThrough]
SSESpecification: Optional[SSESpecification]
TableName: Optional[PassThrough]
Tags: Optional[Dict[str, Any]]
PrimaryKey: Optional[PrimaryKey] = properties("PrimaryKey")
ProvisionedThroughput: Optional[PassThrough] = properties("ProvisionedThroughput")
SSESpecification: Optional[SSESpecification] = properties("SSESpecification")
TableName: Optional[PassThrough] = properties("TableName")
Tags: Optional[Dict[str, Any]] = properties("Tags")


class Globals(BaseModel):
SSESpecification: Optional[SSESpecification]
SSESpecification: Optional[SSESpecification] = properties("SSESpecification")


class Resource(BaseModel):
Expand Down
Loading