---
schema_version: "1"
id: 27a6bee3baab69146a80d8a8c75fecc7c001d194dc583a015cd080c89e643b8f
title: TimeSlotOption Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_RichMessaging_TimeSlotOption.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_TimeSlotOption.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: fab2dba3dfd38da5f43d20913ef120c2435c38f8f79136e7851f06dcd6314d95
description: Represents a complex time slot option type. This class is used to provide time option payloads that can be translated to structured content payloads in rich content messages.Creates a TimeSlotOption object with a start and end time.Creates a TimeSlotOption object with a start time and a duration.Creates a TimeSlotOption object.The duration in seconds.The duration in seconds. Enabled for Lightning components.The end time. Enabled for Lightning components.The start time.The start time. Enabled for Lightning components.
---
# TimeSlotOption Class

Represents a complex time slot option type. This class is used to provide time option payloads that can be translated to structured content payloads in rich content messages.

## Namespace

[RichMessaging](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_RichMessaging.htm "Provides objects and methods for handling content in enhanced Messaging channels.")

- **[TimeSlotOption Constructors](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_TimeSlotOption.htm#apex_RichMessaging_TimeSlotOption_constructors)**
- **[TimeSlotOption Properties](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_TimeSlotOption.htm#apex_RichMessaging_TimeSlotOption_properties)**

## TimeSlotOption Constructors

The following are constructors for TimeSlotOption.

- **[TimeSlotOption(startTime, endTime)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_TimeSlotOption.htm#apex_RichMessaging_TimeSlotOption_ctor)**  
    Creates a TimeSlotOption object with a start and end time.
- **[TimeSlotOption(startTime, duration)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_TimeSlotOption.htm#apex_RichMessaging_TimeSlotOption_ctor_2)**  
    Creates a TimeSlotOption object with a start time and a duration.
- **[TimeSlotOption()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_TimeSlotOption.htm#apex_RichMessaging_TimeSlotOption_ctor_3)**  
    Creates a TimeSlotOption object.

### TimeSlotOption(startTime, endTime)

Creates a TimeSlotOption object with a start and end time.

#### Signature

public TimeSlotOption(Datetime startTime, Datetime endTime)

#### Parameters

- **startTime**: Type: [Datetime](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_datetime.htm#apex_methods_system_datetime "Contains methods for the Datetime primitive data type.") Start time.
- **endTime**: Type: [Datetime](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_datetime.htm#apex_methods_system_datetime "Contains methods for the Datetime primitive data type.") End time.

### TimeSlotOption(startTime, duration)

Creates a TimeSlotOption object with a start time and a duration.

#### Signature

public TimeSlotOption(Datetime startTime, Integer duration)

#### Parameters

- **startTime**: Type: [Datetime](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_datetime.htm#apex_methods_system_datetime "Contains methods for the Datetime primitive data type.") Start time.
- **duration**: Type: [Integer](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_integer.htm#apex_methods_system_integer "Contains methods for the Integer primitive data type.") Duration in seconds.

### TimeSlotOption()

Creates a TimeSlotOption object.

#### Signature

public TimeSlotOption()

## TimeSlotOption Properties

The following are properties for TimeSlotOption.

- **[duration](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_TimeSlotOption.htm#apex_RichMessaging_TimeSlotOption_duration)**  
    The duration in seconds.
- **[durationValue](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_TimeSlotOption.htm#apex_RichMessaging_TimeSlotOption_durationValue)**  
    The duration in seconds. Enabled for Lightning components.
- **[endTimeValue](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_TimeSlotOption.htm#apex_RichMessaging_TimeSlotOption_endTimeValue)**  
    The end time. Enabled for Lightning components.
- **[startTime](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_TimeSlotOption.htm#apex_RichMessaging_TimeSlotOption_startTime)**  
    The start time.
- **[startTimeValue](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_RichMessaging_TimeSlotOption.htm#apex_RichMessaging_TimeSlotOption_startTimeValue)**  
    The start time. Enabled for Lightning components.

### duration

The duration in seconds.

#### Signature

public Integer duration {get; set;}

#### Property Value

Type: [Integer](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_integer.htm#apex_methods_system_integer "Contains methods for the Integer primitive data type.")

### durationValue

The duration in seconds. Enabled for Lightning components.

#### Signature

public Integer durationValue {get; set;}

#### Property Value

Type: [Integer](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_integer.htm#apex_methods_system_integer "Contains methods for the Integer primitive data type.")

### endTimeValue

The end time. Enabled for Lightning components.

#### Signature

public Datetime endTimeValue {get; set;}

#### Property Value

Type: [Datetime](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_datetime.htm#apex_methods_system_datetime "Contains methods for the Datetime primitive data type.")

### startTime

The start time.

#### Signature

public Datetime startTime {get; set;}

#### Property Value

Type: [Datetime](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_datetime.htm#apex_methods_system_datetime "Contains methods for the Datetime primitive data type.")

### startTimeValue

The start time. Enabled for Lightning components.

#### Signature

public Datetime startTimeValue {get; set;}

#### Property Value

Type: [Datetime](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_datetime.htm#apex_methods_system_datetime "Contains methods for the Datetime primitive data type.")