Skip to content

Commit

Permalink
Added missing Function properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jefford-qwigo committed Sep 6, 2020
1 parent b4e187f commit eb5788e
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions sammy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,80 @@ def to_dict(self):
class S3URI(SAMSchema):
Bucket = CharForeignProperty(Ref, required=True)
Key = CharForeignProperty(Ref, required=True)
Version = CharForeignProperty(Ref, required=True)

def to_dict(self):
obj = remove_nulls(self._data.copy())
return obj


class Hooks(SAMSchema):
PostTraffic = CharForeignProperty(Ref)
PreTraffic = CharForeignProperty(Ref)

def to_dict(self):
obj = remove_nulls(self._data.copy())
return obj


class DeploymentPreference(SAMSchema):
Alarms = ListProperty()
Enabled = BooleanProperty()
Hooks = ForeignProperty(Hooks)
Role = CharForeignProperty(Ref)
TriggerConfigurations = ListProperty()
Type = CharForeignProperty(Ref, required=True)

def to_dict(self):
obj = remove_nulls(self._data.copy())
return obj


class OnFailure(SAMSchema):
Destination = CharForeignProperty(Ref)
Type = CharForeignProperty(Ref)

def to_dict(self):
obj = remove_nulls(self._data.copy())
return obj


class OnSuccess(SAMSchema):
Destination = CharForeignProperty(Ref)
Type = CharForeignProperty(Ref)

def to_dict(self):
obj = remove_nulls(self._data.copy())
return obj


class EventInvokeDestinationConfiguration(SAMSchema):
OnFailure = ForeignProperty(OnFailure)
OnSuccess = ForeignProperty(OnSuccess)

def to_dict(self):
obj = remove_nulls(self._data.copy())
return obj


class EventInvokeConfiguration(SAMSchema):
DestinationConfig = ForeignProperty(EventInvokeDestinationConfiguration)
MaximumEventAgeInSeconds = IntegerProperty()
MaximumRetryAttempts = IntegerProperty()

def to_dict(self):
obj = remove_nulls(self._data.copy())
return obj


class ProvisionedConcurrencyConfig(SAMSchema):
ProvisionedConcurrentExecutions = IntegerProperty(required=True)

def to_dict(self):
obj = remove_nulls(self._data.copy())
return obj


class LambdaCode(SAMSchema):
S3Bucket = CharForeignProperty(Ref, required=True)
S3Key = CharForeignProperty(Ref, required=True)
Expand Down Expand Up @@ -337,6 +405,15 @@ class Function(AbstractFunction):
_serverless_type = True

CodeUri = ForeignProperty(S3URI)
AutoPublishAlias = CharForeignProperty(Ref)
AutoPublishCodeSha256 = CharForeignProperty(Ref)
DeploymentPreference = ForeignProperty(DeploymentPreference)
EventInvokeConfig = ForeignProperty(EventInvokeConfiguration)
FileSystemConfigs = ListProperty()
InlineCode = CharForeignProperty(Ref)
PermissionsBoundary = CharForeignProperty(Ref)
ProvisionedConcurrencyConfig = ForeignProperty(ProvisionedConcurrencyConfig)
VersionDescription = CharForeignProperty(Ref)
Policies = CharForeignProperty(Ref)
Events = ForeignInstanceListProperty(EventSchema)
Tracing = CharForeignProperty(Ref)
Expand Down

0 comments on commit eb5788e

Please sign in to comment.