NewTriggerModel
NewTriggerModel builds a models.Trigger from a deploy request. The caller supplies the TriggerIdentifier (including the expected revision for optimistic locking).
def NewTriggerModel(
ctx: context.Context,
id: *common.TriggerIdentifier,
spec: *triggerpb.TriggerSpec,
automationSpec: *taskpb.TriggerAutomationSpec
) - > *models.Trigger, error
Builds a models.Trigger from a deploy request. The caller supplies the TriggerIdentifier (including the expected revision for optimistic locking).
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, typically used for cancellation and deadlines. |
| id | *common.TriggerIdentifier | The identifier for the trigger, including its name and the expected revision for optimistic locking. |
| spec | *triggerpb.TriggerSpec | The specification for the trigger, defining its behavior and configuration. |
| automationSpec | *taskpb.TriggerAutomationSpec | The specification for trigger automation, such as scheduling. If nil, it defaults to no automation. |
Returns
| Type | Description |
|---|---|
*models.Trigger, error | A new Trigger model and an error if the operation failed. |