create_and_update_event
AVOID: SDK wrapper meant to create/update an event's core fields. Use create_content + update_content instead.
create_and_update_event
AVOID: SDK wrapper meant to create/update an event's core fields. Use create_content + update_content instead.
Do not use this for event writes. The SDK wrapper is broken three ways: its update path is a no-op,
it misspells the datetime keys (startDateTime/endDateTimevs the live
startDatetime/endDatetime), and it swallows the required-event_type409toNone.
Create events the contract way instead -create_contentthen a properties-only
update_content(with the requiredeventTyperef). See
recipes/bulk-import-events-from-spreadsheet.md.
This wrapper is supposed to create-or-update an event's core scheduling fields. On the
create path (content_id=None) it returns the event's contentId as a bare string; on the
update path it does nothing and returns None. It is documented here only to capture the
drift - the recipe and smoke test use the primitives.
Safety class: C · API type: admin · Min version: -
ConfinementClass C: creates/updates a global event record (no folder anchor) - non-prod only. Tear down with delete_event.
Signatures
def create_and_update_event(sdk, content_id, content_definition_id, name, start_datetime,
end_datetime, event_type, series=None, is_disabled=False,
override_series_properties=False, series_properties=None):
"""AVOID (): use create_content + update_content. Update path is a no-op."""
return sdk.create_and_update_event(content_id, content_definition_id, name, start_datetime,
end_datetime, event_type, series, is_disabled, override_series_properties,
series_properties)export async function createAndUpdateEvent(sdk, contentId, contentDefinitionId, name,
startDatetime, endDatetime, eventType, series = null, isDisabled = false,
overrideSeriesProperties = false, seriesProperties = null) {
// AVOID (): use createContent + updateContent. Update path is a no-op.
return await sdk.createAndUpdateEvent(contentId, contentDefinitionId, name, startDatetime,
endDatetime, eventType, series, isDisabled, overrideSeriesProperties, seriesProperties);
}Parameters
| Parameter (Python) | Parameter (JS) | Type | Required | Notes |
|---|---|---|---|---|
sdk | sdk | Nomad_SDK | yes | |
content_id | contentId | str | None | yes | None to CREATE a new event; the existing event contentId to UPDATE it (idempotent upsert) |
content_definition_id | contentDefinitionId | str | yes | the event entity id from reference/schema.md |
name | name | str | None | yes | e.g. "AIH Opening Ceremony" |
start_datetime | startDatetime | str | yes | ISO-8601 UTC (Z). Convert local sheet times via the timeZone CD utcOffset - see the recipe. |
end_datetime | endDatetime | str | yes | ISO-8601 UTC (Z) |
event_type | eventType | dict | yes | reference shape {id, description}; resolve the name against the eventType CD |
series | series | dict | None | no | reference shape {id, description}; None when the event is standalone |
is_disabled | isDisabled | bool | None | no | e.g. False |
override_series_properties | overrideSeriesProperties | bool | yes | e.g. False |
series_properties | seriesProperties | dict | None | no | e.g. null |
Returns
str | None - CREATE path: a BARE contentId string on success (not a dict). UPDATE path (content_id given): a no-op that returns None - it does NOT update. Any server validation failure (e.g. missing required event_type -> 409) is swallowed to None.
Errors
- 401 unauthenticated
- 404 content definition / event not found
- 409 missing/invalid event_type (swallowed to None)
See also: Python ↔ JS naming map · Return shapes.
Updated about 2 months ago
