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/endDateTime vs the live
startDatetime/endDatetime), and it swallows the required-event_type 409 to None.
Create events the contract way instead - create_content then a properties-only
update_content (with the required eventType ref). 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: -

📘

Confinement

Class 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)TypeRequiredNotes
sdksdkNomad_SDKyes
content_idcontentIdstr | NoneyesNone to CREATE a new event; the existing event contentId to UPDATE it (idempotent upsert)
content_definition_idcontentDefinitionIdstryesthe event entity id from reference/schema.md
namenamestr | Noneyese.g. "AIH Opening Ceremony"
start_datetimestartDatetimestryesISO-8601 UTC (Z). Convert local sheet times via the timeZone CD utcOffset - see the recipe.
end_datetimeendDatetimestryesISO-8601 UTC (Z)
event_typeeventTypedictyesreference shape {id, description}; resolve the name against the eventType CD
seriesseriesdict | Nonenoreference shape {id, description}; None when the event is standalone
is_disabledisDisabledbool | Nonenoe.g. False
override_series_propertiesoverrideSeriesPropertiesboolyese.g. False
series_propertiesseriesPropertiesdict | Nonenoe.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.


Did this page help you?