Class: MicrosoftGraph::Education::Me::Rubrics::Item::EducationRubricItemRequestBuilder

Inherits:
MicrosoftKiotaAbstractions::BaseRequestBuilder
  • Object
show all
Defined in:
lib/education/me/rubrics/item/education_rubric_item_request_builder.rb

Overview

Provides operations to manage the rubrics property of the microsoft.graph.educationUser entity.

Defined Under Namespace

Classes: EducationRubricItemRequestBuilderGetQueryParameters

Instance Method Summary collapse

Constructor Details

#initialize(path_parameters, request_adapter) ⇒ Object

Instantiates a new EducationRubricItemRequestBuilder and sets the default values.



25
26
27
# File 'lib/education/me/rubrics/item/education_rubric_item_request_builder.rb', line 25

def initialize(path_parameters, request_adapter)
    super(path_parameters, request_adapter, "{+baseurl}/education/me/rubrics/{educationRubric%2Did}{?%24select,%24expand}")
end

Instance Method Details

#delete(request_configuration = nil) ⇒ Object

Delete an educationRubric object. Only teachers can perform this operation.



33
34
35
36
37
38
39
40
41
# File 'lib/education/me/rubrics/item/education_rubric_item_request_builder.rb', line 33

def delete(request_configuration=nil)
    request_info = self.to_delete_request_information(
        request_configuration
    )
    error_mapping = Hash.new
    error_mapping["4XX"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }
    error_mapping["5XX"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }
    return @request_adapter.send_async(request_info, nil, error_mapping)
end

#get(request_configuration = nil) ⇒ Object

Retrieve the properties and relationships of an educationRubric object. Only teachers and students can perform this operation.



47
48
49
50
51
52
53
54
55
# File 'lib/education/me/rubrics/item/education_rubric_item_request_builder.rb', line 47

def get(request_configuration=nil)
    request_info = self.to_get_request_information(
        request_configuration
    )
    error_mapping = Hash.new
    error_mapping["4XX"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }
    error_mapping["5XX"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }
    return @request_adapter.send_async(request_info, lambda {|pn| MicrosoftGraph::Models::EducationRubric.create_from_discriminator_value(pn) }, error_mapping)
end

#patch(body, request_configuration = nil) ⇒ Object

Update the properties of an educationRubric object. Only teachers can perform this operation. Updating a rubric attached to an assignment (PATCH /education/classes/acdefc6b-2dc6-4e71-b1e9-6d9810ab1793/assignments/cf6005fc-9e13-44a2-a6ac-a53322006454/rubric) is only possible before the assignment is published, and what is updated is actually the original rubric that exists under /education/users/id/rubrics. After the assignment is published, an immutable copy of the rubric is made that is attached to that specific assignment. That rubric can be retrieved using GET /education/classes/acdefc6b-2dc6-4e71-b1e9-6d9810ab1793/assignments/cf6005fc-9e13-44a2-a6ac-a53322006454/rubric, but it cannot be updated.

Raises:

  • (StandardError)


62
63
64
65
66
67
68
69
70
71
# File 'lib/education/me/rubrics/item/education_rubric_item_request_builder.rb', line 62

def patch(body, request_configuration=nil)
    raise StandardError, 'body cannot be null' if body.nil?
    request_info = self.to_patch_request_information(
        body, request_configuration
    )
    error_mapping = Hash.new
    error_mapping["4XX"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }
    error_mapping["5XX"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }
    return @request_adapter.send_async(request_info, lambda {|pn| MicrosoftGraph::Models::EducationRubric.create_from_discriminator_value(pn) }, error_mapping)
end

#to_delete_request_information(request_configuration = nil) ⇒ Object

Delete an educationRubric object. Only teachers can perform this operation.



77
78
79
80
81
82
83
84
85
86
87
# File 'lib/education/me/rubrics/item/education_rubric_item_request_builder.rb', line 77

def to_delete_request_information(request_configuration=nil)
    request_info = MicrosoftKiotaAbstractions::RequestInformation.new()
    request_info.url_template = @url_template
    request_info.path_parameters = @path_parameters
    request_info.http_method = :DELETE
    unless request_configuration.nil?
        request_info.add_headers_from_raw_object(request_configuration.headers)
        request_info.add_request_options(request_configuration.options)
    end
    return request_info
end

#to_get_request_information(request_configuration = nil) ⇒ Object

Retrieve the properties and relationships of an educationRubric object. Only teachers and students can perform this operation.



93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/education/me/rubrics/item/education_rubric_item_request_builder.rb', line 93

def to_get_request_information(request_configuration=nil)
    request_info = MicrosoftKiotaAbstractions::RequestInformation.new()
    request_info.url_template = @url_template
    request_info.path_parameters = @path_parameters
    request_info.http_method = :GET
    request_info.headers.add('Accept', 'application/json')
    unless request_configuration.nil?
        request_info.add_headers_from_raw_object(request_configuration.headers)
        request_info.set_query_string_parameters_from_raw_object(request_configuration.query_parameters)
        request_info.add_request_options(request_configuration.options)
    end
    return request_info
end

#to_patch_request_information(body, request_configuration = nil) ⇒ Object

Update the properties of an educationRubric object. Only teachers can perform this operation. Updating a rubric attached to an assignment (PATCH /education/classes/acdefc6b-2dc6-4e71-b1e9-6d9810ab1793/assignments/cf6005fc-9e13-44a2-a6ac-a53322006454/rubric) is only possible before the assignment is published, and what is updated is actually the original rubric that exists under /education/users/id/rubrics. After the assignment is published, an immutable copy of the rubric is made that is attached to that specific assignment. That rubric can be retrieved using GET /education/classes/acdefc6b-2dc6-4e71-b1e9-6d9810ab1793/assignments/cf6005fc-9e13-44a2-a6ac-a53322006454/rubric, but it cannot be updated.

Raises:

  • (StandardError)


112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/education/me/rubrics/item/education_rubric_item_request_builder.rb', line 112

def to_patch_request_information(body, request_configuration=nil)
    raise StandardError, 'body cannot be null' if body.nil?
    request_info = MicrosoftKiotaAbstractions::RequestInformation.new()
    request_info.url_template = @url_template
    request_info.path_parameters = @path_parameters
    request_info.http_method = :PATCH
    request_info.headers.add('Accept', 'application/json')
    unless request_configuration.nil?
        request_info.add_headers_from_raw_object(request_configuration.headers)
        request_info.add_request_options(request_configuration.options)
    end
    request_info.set_content_from_parsable(@request_adapter, "application/json", body)
    return request_info
end