Class: MicrosoftGraph::Education::Classes::Item::EducationClassItemRequestBuilder

Inherits:
MicrosoftKiotaAbstractions::BaseRequestBuilder
  • Object
show all
Defined in:
lib/education/classes/item/education_class_item_request_builder.rb

Overview

Provides operations to manage the classes property of the microsoft.graph.educationRoot entity.

Defined Under Namespace

Classes: EducationClassItemRequestBuilderGetQueryParameters

Instance Method Summary collapse

Constructor Details

#initialize(path_parameters, request_adapter) ⇒ Object

Instantiates a new EducationClassItemRequestBuilder and sets the default values.

Parameters:

  • path_parameters

    Path parameters for the request

  • request_adapter

    The request adapter to use to execute the requests.



71
72
73
# File 'lib/education/classes/item/education_class_item_request_builder.rb', line 71

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

Instance Method Details

#assignment_categoriesObject

Provides operations to manage the assignmentCategories property of the microsoft.graph.educationClass entity.



27
28
29
# File 'lib/education/classes/item/education_class_item_request_builder.rb', line 27

def assignment_categories()
    return MicrosoftGraph::Education::Classes::Item::AssignmentCategories::AssignmentCategoriesRequestBuilder.new(@path_parameters, @request_adapter)
end

#assignment_defaultsObject

Provides operations to manage the assignmentDefaults property of the microsoft.graph.educationClass entity.



32
33
34
# File 'lib/education/classes/item/education_class_item_request_builder.rb', line 32

def assignment_defaults()
    return MicrosoftGraph::Education::Classes::Item::AssignmentDefaults::AssignmentDefaultsRequestBuilder.new(@path_parameters, @request_adapter)
end

#assignment_settingsObject

Provides operations to manage the assignmentSettings property of the microsoft.graph.educationClass entity.



42
43
44
# File 'lib/education/classes/item/education_class_item_request_builder.rb', line 42

def assignment_settings()
    return MicrosoftGraph::Education::Classes::Item::AssignmentSettings::AssignmentSettingsRequestBuilder.new(@path_parameters, @request_adapter)
end

#assignmentsObject

Provides operations to manage the assignments property of the microsoft.graph.educationClass entity.



37
38
39
# File 'lib/education/classes/item/education_class_item_request_builder.rb', line 37

def assignments()
    return MicrosoftGraph::Education::Classes::Item::Assignments::AssignmentsRequestBuilder.new(@path_parameters, @request_adapter)
end

#delete(request_configuration = nil) ⇒ Object

Delete an educationClass. Because a class is also a universal group, deleting a class deletes the group.

Parameters:

  • request_configuration (defaults to: nil)

    Configuration for the request such as headers, query parameters, and middleware options.

Returns:

  • a Fiber of void



79
80
81
82
83
84
85
86
87
# File 'lib/education/classes/item/education_class_item_request_builder.rb', line 79

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 a class from the system. A class is a universal group with a special property that indicates to the system that the group is a class. Group members represent the students; group admins represent the teachers in the class. If you're using the delegated token, the user will only see classes in which they are members.

Parameters:

  • request_configuration (defaults to: nil)

    Configuration for the request such as headers, query parameters, and middleware options.

Returns:

  • a Fiber of education_class



93
94
95
96
97
98
99
100
101
# File 'lib/education/classes/item/education_class_item_request_builder.rb', line 93

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::EducationClass.create_from_discriminator_value(pn) }, error_mapping)
end

#groupObject

Provides operations to manage the group property of the microsoft.graph.educationClass entity.



47
48
49
# File 'lib/education/classes/item/education_class_item_request_builder.rb', line 47

def group()
    return MicrosoftGraph::Education::Classes::Item::Group::GroupRequestBuilder.new(@path_parameters, @request_adapter)
end

#membersObject

Provides operations to manage the members property of the microsoft.graph.educationClass entity.



52
53
54
# File 'lib/education/classes/item/education_class_item_request_builder.rb', line 52

def members()
    return MicrosoftGraph::Education::Classes::Item::Members::MembersRequestBuilder.new(@path_parameters, @request_adapter)
end

#patch(body, request_configuration = nil) ⇒ Object

Update the properties of an educationClass object.

Parameters:

  • body

    The request body

  • request_configuration (defaults to: nil)

    Configuration for the request such as headers, query parameters, and middleware options.

Returns:

  • a Fiber of education_class

Raises:

  • (StandardError)


108
109
110
111
112
113
114
115
116
117
# File 'lib/education/classes/item/education_class_item_request_builder.rb', line 108

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::EducationClass.create_from_discriminator_value(pn) }, error_mapping)
end

#schoolsObject

Provides operations to manage the schools property of the microsoft.graph.educationClass entity.



57
58
59
# File 'lib/education/classes/item/education_class_item_request_builder.rb', line 57

def schools()
    return MicrosoftGraph::Education::Classes::Item::Schools::SchoolsRequestBuilder.new(@path_parameters, @request_adapter)
end

#teachersObject

Provides operations to manage the teachers property of the microsoft.graph.educationClass entity.



62
63
64
# File 'lib/education/classes/item/education_class_item_request_builder.rb', line 62

def teachers()
    return MicrosoftGraph::Education::Classes::Item::Teachers::TeachersRequestBuilder.new(@path_parameters, @request_adapter)
end

#to_delete_request_information(request_configuration = nil) ⇒ Object

Delete an educationClass. Because a class is also a universal group, deleting a class deletes the group.

Parameters:

  • request_configuration (defaults to: nil)

    Configuration for the request such as headers, query parameters, and middleware options.

Returns:

  • a request_information



123
124
125
126
127
128
129
130
131
132
133
# File 'lib/education/classes/item/education_class_item_request_builder.rb', line 123

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 a class from the system. A class is a universal group with a special property that indicates to the system that the group is a class. Group members represent the students; group admins represent the teachers in the class. If you're using the delegated token, the user will only see classes in which they are members.

Parameters:

  • request_configuration (defaults to: nil)

    Configuration for the request such as headers, query parameters, and middleware options.

Returns:

  • a request_information



139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/education/classes/item/education_class_item_request_builder.rb', line 139

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 educationClass object.

Parameters:

  • body

    The request body

  • request_configuration (defaults to: nil)

    Configuration for the request such as headers, query parameters, and middleware options.

Returns:

  • a request_information

Raises:

  • (StandardError)


158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/education/classes/item/education_class_item_request_builder.rb', line 158

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