Class: MicrosoftGraph::Models::LearningCourseActivity

Inherits:
Entity
  • Object
show all
Includes:
MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/learning_course_activity.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

#additional_data, #additional_data=, #id, #id=, #odata_type, #odata_type=

Constructor Details

#initializeObject

Instantiates a new learningCourseActivity and sets the default values.



65
66
67
# File 'lib/models/learning_course_activity.rb', line 65

def initialize()
    super
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 learning_course_activity

Raises:

  • (StandardError)


73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/models/learning_course_activity.rb', line 73

def self.create_from_discriminator_value(parse_node)
    raise StandardError, 'parse_node cannot be null' if parse_node.nil?
    mapping_value_node = parse_node.get_child_node("@odata.type")
    unless mapping_value_node.nil? then
        mapping_value = mapping_value_node.get_string_value
        case mapping_value
            when "#microsoft.graph.learningAssignment"
                return LearningAssignment.new
            when "#microsoft.graph.learningSelfInitiatedCourse"
                return LearningSelfInitiatedCourse.new
        end
    end
    return LearningCourseActivity.new
end

Instance Method Details

#completed_date_timeObject

Gets the completedDateTime property value. Date and time when the assignment was completed. Optional.

Returns:

  • a date_time



35
36
37
# File 'lib/models/learning_course_activity.rb', line 35

def completed_date_time
    return @completed_date_time
end

#completed_date_time=(value) ⇒ Object

Sets the completedDateTime property value. Date and time when the assignment was completed. Optional.

Parameters:

  • value

    Value to set for the completedDateTime property.

Returns:

  • a void



43
44
45
# File 'lib/models/learning_course_activity.rb', line 43

def completed_date_time=(value)
    @completed_date_time = value
end

#completion_percentageObject

Gets the completionPercentage property value. The percentage completion value of the course activity. Optional.

Returns:

  • a integer



50
51
52
# File 'lib/models/learning_course_activity.rb', line 50

def completion_percentage
    return @completion_percentage
end

#completion_percentage=(value) ⇒ Object

Sets the completionPercentage property value. The percentage completion value of the course activity. Optional.

Parameters:

  • value

    Value to set for the completionPercentage property.

Returns:

  • a void



58
59
60
# File 'lib/models/learning_course_activity.rb', line 58

def completion_percentage=(value)
    @completion_percentage = value
end

#externalcourse_activity_idObject

Gets the externalcourseActivityId property value. A course activity ID generated by the provider. Optional.

Returns:

  • a string



91
92
93
# File 'lib/models/learning_course_activity.rb', line 91

def externalcourse_activity_id
    return @externalcourse_activity_id
end

#externalcourse_activity_id=(value) ⇒ Object

Sets the externalcourseActivityId property value. A course activity ID generated by the provider. Optional.

Parameters:

  • value

    Value to set for the externalcourseActivityId property.

Returns:

  • a void



99
100
101
# File 'lib/models/learning_course_activity.rb', line 99

def externalcourse_activity_id=(value)
    @externalcourse_activity_id = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



106
107
108
109
110
111
112
113
114
115
116
# File 'lib/models/learning_course_activity.rb', line 106

def get_field_deserializers()
    return super.merge({
        "completedDateTime" => lambda {|n| @completed_date_time = n.get_date_time_value() },
        "completionPercentage" => lambda {|n| @completion_percentage = n.get_number_value() },
        "externalcourseActivityId" => lambda {|n| @externalcourse_activity_id = n.get_string_value() },
        "learnerUserId" => lambda {|n| @learner_user_id = n.get_string_value() },
        "learningContentId" => lambda {|n| @learning_content_id = n.get_string_value() },
        "learningProviderId" => lambda {|n| @learning_provider_id = n.get_string_value() },
        "status" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::CourseStatus) },
    })
end

#learner_user_idObject

Gets the learnerUserId property value. The user ID of the learner to whom the activity is assigned. Required.

Returns:

  • a string



121
122
123
# File 'lib/models/learning_course_activity.rb', line 121

def learner_user_id
    return @learner_user_id
end

#learner_user_id=(value) ⇒ Object

Sets the learnerUserId property value. The user ID of the learner to whom the activity is assigned. Required.

Parameters:

  • value

    Value to set for the learnerUserId property.

Returns:

  • a void



129
130
131
# File 'lib/models/learning_course_activity.rb', line 129

def learner_user_id=(value)
    @learner_user_id = value
end

#learning_content_idObject

Gets the learningContentId property value. The ID of the learning content created in Viva Learning. Required.

Returns:

  • a string



136
137
138
# File 'lib/models/learning_course_activity.rb', line 136

def learning_content_id
    return @learning_content_id
end

#learning_content_id=(value) ⇒ Object

Sets the learningContentId property value. The ID of the learning content created in Viva Learning. Required.

Parameters:

  • value

    Value to set for the learningContentId property.

Returns:

  • a void



144
145
146
# File 'lib/models/learning_course_activity.rb', line 144

def learning_content_id=(value)
    @learning_content_id = value
end

#learning_provider_idObject

Gets the learningProviderId property value. The registration ID of the provider. Required.

Returns:

  • a string



151
152
153
# File 'lib/models/learning_course_activity.rb', line 151

def learning_provider_id
    return @learning_provider_id
end

#learning_provider_id=(value) ⇒ Object

Sets the learningProviderId property value. The registration ID of the provider. Required.

Parameters:

  • value

    Value to set for the learningProviderId property.

Returns:

  • a void



159
160
161
# File 'lib/models/learning_course_activity.rb', line 159

def learning_provider_id=(value)
    @learning_provider_id = 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)


167
168
169
170
171
172
173
174
175
176
177
# File 'lib/models/learning_course_activity.rb', line 167

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_date_time_value("completedDateTime", @completed_date_time)
    writer.write_number_value("completionPercentage", @completion_percentage)
    writer.write_string_value("externalcourseActivityId", @externalcourse_activity_id)
    writer.write_string_value("learnerUserId", @learner_user_id)
    writer.write_string_value("learningContentId", @learning_content_id)
    writer.write_string_value("learningProviderId", @learning_provider_id)
    writer.write_enum_value("status", @status)
end

#statusObject

Gets the status property value. The status of the course activity. Possible values are: notStarted, inProgress, completed. Required.

Returns:

  • a course_status



182
183
184
# File 'lib/models/learning_course_activity.rb', line 182

def status
    return @status
end

#status=(value) ⇒ Object

Sets the status property value. The status of the course activity. Possible values are: notStarted, inProgress, completed. Required.

Parameters:

  • value

    Value to set for the status property.

Returns:

  • a void



190
191
192
# File 'lib/models/learning_course_activity.rb', line 190

def status=(value)
    @status = value
end