Skip to content

UserScheduleAddEventRequest

Bases: OCIRequest

Add an event to user schedule. The response is either a SuccessResponse or an ErrorResponse. The startDate element is adjusted to the first occurrence of the recurrent schedule that comes at or after the startDate. The endDate element is set to the sum of the adjusted starDate element value and the event duration.

Attributes:

user_id (str):

schedule_key (ScheduleKey):

event_name (str):

start_date (int):

all_day_event (Optional[bool]):

start_time (Optional[HourMinute]):

end_time (Optional[HourMinute]):

end_date (int):

recurrence (Optional[Recurrence]):
Source code in src/mercury_ocip/commands/commands.py
@dataclass(kw_only=True)
class UserScheduleAddEventRequest(OCIRequest):
    """Add an event to user schedule.
        The response is either a SuccessResponse or an ErrorResponse.
        The startDate element is adjusted to the first occurrence of the recurrent schedule that comes at or after the startDate.
        The endDate element is set to the sum of the adjusted starDate element value and the event duration.

    Attributes:

        user_id (str):

        schedule_key (ScheduleKey):

        event_name (str):

        start_date (int):

        all_day_event (Optional[bool]):

        start_time (Optional[HourMinute]):

        end_time (Optional[HourMinute]):

        end_date (int):

        recurrence (Optional[Recurrence]):

    """

    user_id: str = field(metadata={"alias": "userId"})

    schedule_key: ScheduleKey = field(metadata={"alias": "scheduleKey"})

    event_name: str = field(metadata={"alias": "eventName"})

    start_date: int = field(metadata={"alias": "startDate"})

    all_day_event: Optional[bool] = field(
        default=None, metadata={"alias": "allDayEvent"}
    )

    start_time: Optional[HourMinute] = field(
        default=None, metadata={"alias": "startTime"}
    )

    end_time: Optional[HourMinute] = field(default=None, metadata={"alias": "endTime"})

    end_date: int = field(metadata={"alias": "endDate"})

    recurrence: Optional[Recurrence] = field(
        default=None, metadata={"alias": "recurrence"}
    )

Responses

Bases: OCIResponse

Source code in src/mercury_ocip/commands/base_command.py
class SuccessResponse(OCIResponse):
    pass

Bases: OCIResponse

Source code in src/mercury_ocip/commands/base_command.py
class ErrorResponse(OCIResponse):
    errorCode: Optional[int] = None
    summary: str
    summaryEnglish: str
    detail: Optional[str] = None

Example Usage

from mercury_ocip.client import Client
from mercury_ocip.commands import UserScheduleAddEventRequest

client = Client()

command = UserScheduleAddEventRequest(
    user_id=...,
    schedule_key=...,
    event_name=...,
    start_date=...,
    all_day_event=...,
    start_time=...,
    end_time=...,
    end_date=...,
    recurrence=...,
)

response = client.command(command)

print(response)

Example 2 with Raw Command

from mercury_ocip.client import Client

client = Client()

response = client.raw_command("UserScheduleAddEventRequest",
    user_id=...,
    schedule_key=...,
    event_name=...,
    start_date=...,
    all_day_event=...,
    start_time=...,
    end_time=...,
    end_date=...,
    recurrence=...,
)

print(response)