Class: MicrosoftGraph::Models::RecurrencePattern

Inherits:
Object
  • Object
show all
Includes:
MicrosoftKiotaAbstractions::AdditionalDataHolder, MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/recurrence_pattern.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject

Instantiates a new recurrencePattern and sets the default values.



55
56
57
# File 'lib/models/recurrence_pattern.rb', line 55

def initialize()
    @additional_data = Hash.new
end

Class Method Details

.create_from_discriminator_value(parse_node) ⇒ Object

Creates a new instance of the appropriate class based on discriminator value

Parameters:

  • parse_node

    The parse node to use to read the discriminator value and create the object

Returns:

  • a recurrence_pattern

Raises:

  • (StandardError)


63
64
65
66
# File 'lib/models/recurrence_pattern.rb', line 63

def self.create_from_discriminator_value(parse_node)
    raise StandardError, 'parse_node cannot be null' if parse_node.nil?
    return RecurrencePattern.new
end

Instance Method Details

#additional_dataObject

Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.

Returns:

  • a i_dictionary



40
41
42
# File 'lib/models/recurrence_pattern.rb', line 40

def additional_data
    return @additional_data
end

#additional_data=(value) ⇒ Object

Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.

Parameters:

  • value

    Value to set for the additionalData property.

Returns:

  • a void



48
49
50
# File 'lib/models/recurrence_pattern.rb', line 48

def additional_data=(value)
    @additional_data = value
end

#day_of_monthObject

Gets the dayOfMonth property value. The day of the month on which the event occurs. Required if type is absoluteMonthly or absoluteYearly.

Returns:

  • a integer



71
72
73
# File 'lib/models/recurrence_pattern.rb', line 71

def day_of_month
    return @day_of_month
end

#day_of_month=(value) ⇒ Object

Sets the dayOfMonth property value. The day of the month on which the event occurs. Required if type is absoluteMonthly or absoluteYearly.

Parameters:

  • value

    Value to set for the dayOfMonth property.

Returns:

  • a void



79
80
81
# File 'lib/models/recurrence_pattern.rb', line 79

def day_of_month=(value)
    @day_of_month = value
end

#days_of_weekObject

Gets the daysOfWeek property value. A collection of the days of the week on which the event occurs. The possible values are: sunday, monday, tuesday, wednesday, thursday, friday, saturday. If type is relativeMonthly or relativeYearly, and daysOfWeek specifies more than one day, the event falls on the first day that satisfies the pattern. Required if type is weekly, relativeMonthly, or relativeYearly.

Returns:

  • a day_of_week



86
87
88
# File 'lib/models/recurrence_pattern.rb', line 86

def days_of_week
    return @days_of_week
end

#days_of_week=(value) ⇒ Object

Sets the daysOfWeek property value. A collection of the days of the week on which the event occurs. The possible values are: sunday, monday, tuesday, wednesday, thursday, friday, saturday. If type is relativeMonthly or relativeYearly, and daysOfWeek specifies more than one day, the event falls on the first day that satisfies the pattern. Required if type is weekly, relativeMonthly, or relativeYearly.

Parameters:

  • value

    Value to set for the daysOfWeek property.

Returns:

  • a void



94
95
96
# File 'lib/models/recurrence_pattern.rb', line 94

def days_of_week=(value)
    @days_of_week = value
end

#first_day_of_weekObject

Gets the firstDayOfWeek property value. The first day of the week. The possible values are: sunday, monday, tuesday, wednesday, thursday, friday, saturday. Default is sunday. Required if type is weekly.

Returns:

  • a day_of_week



101
102
103
# File 'lib/models/recurrence_pattern.rb', line 101

def first_day_of_week
    return @first_day_of_week
end

#first_day_of_week=(value) ⇒ Object

Sets the firstDayOfWeek property value. The first day of the week. The possible values are: sunday, monday, tuesday, wednesday, thursday, friday, saturday. Default is sunday. Required if type is weekly.

Parameters:

  • value

    Value to set for the firstDayOfWeek property.

Returns:

  • a void



109
110
111
# File 'lib/models/recurrence_pattern.rb', line 109

def first_day_of_week=(value)
    @first_day_of_week = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/models/recurrence_pattern.rb', line 116

def get_field_deserializers()
    return {
        "dayOfMonth" => lambda {|n| @day_of_month = n.get_number_value() },
        "daysOfWeek" => lambda {|n| @days_of_week = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DayOfWeek.create_from_discriminator_value(pn) }) },
        "firstDayOfWeek" => lambda {|n| @first_day_of_week = n.get_enum_value(MicrosoftGraph::Models::DayOfWeek) },
        "index" => lambda {|n| @index = n.get_enum_value(MicrosoftGraph::Models::WeekIndex) },
        "interval" => lambda {|n| @interval = n.get_number_value() },
        "month" => lambda {|n| @month = n.get_number_value() },
        "@odata.type" => lambda {|n| @odata_type = n.get_string_value() },
        "type" => lambda {|n| @type = n.get_enum_value(MicrosoftGraph::Models::RecurrencePatternType) },
    }
end

#indexObject

Gets the index property value. Specifies on which instance of the allowed days specified in daysOfWeek the event occurs, counted from the first instance in the month. The possible values are: first, second, third, fourth, last. Default is first. Optional and used if type is relativeMonthly or relativeYearly.

Returns:

  • a week_index



132
133
134
# File 'lib/models/recurrence_pattern.rb', line 132

def index
    return @index
end

#index=(value) ⇒ Object

Sets the index property value. Specifies on which instance of the allowed days specified in daysOfWeek the event occurs, counted from the first instance in the month. The possible values are: first, second, third, fourth, last. Default is first. Optional and used if type is relativeMonthly or relativeYearly.

Parameters:

  • value

    Value to set for the index property.

Returns:

  • a void



140
141
142
# File 'lib/models/recurrence_pattern.rb', line 140

def index=(value)
    @index = value
end

#intervalObject

Gets the interval property value. The number of units between occurrences, where units can be in days, weeks, months, or years, depending on the type. Required.

Returns:

  • a integer



147
148
149
# File 'lib/models/recurrence_pattern.rb', line 147

def interval
    return @interval
end

#interval=(value) ⇒ Object

Sets the interval property value. The number of units between occurrences, where units can be in days, weeks, months, or years, depending on the type. Required.

Parameters:

  • value

    Value to set for the interval property.

Returns:

  • a void



155
156
157
# File 'lib/models/recurrence_pattern.rb', line 155

def interval=(value)
    @interval = value
end

#monthObject

Gets the month property value. The month in which the event occurs. This is a number from 1 to 12.

Returns:

  • a integer



162
163
164
# File 'lib/models/recurrence_pattern.rb', line 162

def month
    return @month
end

#month=(value) ⇒ Object

Sets the month property value. The month in which the event occurs. This is a number from 1 to 12.

Parameters:

  • value

    Value to set for the month property.

Returns:

  • a void



170
171
172
# File 'lib/models/recurrence_pattern.rb', line 170

def month=(value)
    @month = value
end

#odata_typeObject

Gets the @odata.type property value. The OdataType property

Returns:

  • a string



177
178
179
# File 'lib/models/recurrence_pattern.rb', line 177

def odata_type
    return @odata_type
end

#odata_type=(value) ⇒ Object

Sets the @odata.type property value. The OdataType property

Parameters:

  • value

    Value to set for the @odata.type property.

Returns:

  • a void



185
186
187
# File 'lib/models/recurrence_pattern.rb', line 185

def odata_type=(value)
    @odata_type = value
end

#serialize(writer) ⇒ Object

Serializes information the current object

Parameters:

  • writer

    Serialization writer to use to serialize this model

Returns:

  • a void

Raises:

  • (StandardError)


193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/models/recurrence_pattern.rb', line 193

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    writer.write_number_value("dayOfMonth", @day_of_month)
    writer.write_collection_of_object_values("daysOfWeek", @days_of_week)
    writer.write_enum_value("firstDayOfWeek", @first_day_of_week)
    writer.write_enum_value("index", @index)
    writer.write_number_value("interval", @interval)
    writer.write_number_value("month", @month)
    writer.write_string_value("@odata.type", @odata_type)
    writer.write_enum_value("type", @type)
    writer.write_additional_data(@additional_data)
end

#typeObject

Gets the type property value. The recurrence pattern type: daily, weekly, absoluteMonthly, relativeMonthly, absoluteYearly, relativeYearly. Required. For more information, see values of type property.

Returns:

  • a recurrence_pattern_type



209
210
211
# File 'lib/models/recurrence_pattern.rb', line 209

def type
    return @type
end

#type=(value) ⇒ Object

Sets the type property value. The recurrence pattern type: daily, weekly, absoluteMonthly, relativeMonthly, absoluteYearly, relativeYearly. Required. For more information, see values of type property.

Parameters:

  • value

    Value to set for the type property.

Returns:

  • a void



217
218
219
# File 'lib/models/recurrence_pattern.rb', line 217

def type=(value)
    @type = value
end