Class: MicrosoftGraph::Me::Messages::Item::MessageItemRequestBuilder

Inherits:
MicrosoftKiotaAbstractions::BaseRequestBuilder
  • Object
show all
Defined in:
lib/me/messages/item/message_item_request_builder.rb

Overview

Provides operations to manage the messages property of the microsoft.graph.user entity.

Defined Under Namespace

Classes: MessageItemRequestBuilderGetQueryParameters

Instance Method Summary collapse

Constructor Details

#initialize(path_parameters, request_adapter) ⇒ Object

Instantiates a new MessageItemRequestBuilder and sets the default values.

Parameters:

  • path_parameters

    Path parameters for the request

  • request_adapter

    The request adapter to use to execute the requests.



95
96
97
# File 'lib/me/messages/item/message_item_request_builder.rb', line 95

def initialize(path_parameters, request_adapter)
    super(path_parameters, request_adapter, "{+baseurl}/me/messages/{message%2Did}{?includeHiddenMessages*,%24select,%24expand}")
end

Instance Method Details

#attachmentsObject

Provides operations to manage the attachments property of the microsoft.graph.message entity.



31
32
33
# File 'lib/me/messages/item/message_item_request_builder.rb', line 31

def attachments()
    return MicrosoftGraph::Me::Messages::Item::Attachments::AttachmentsRequestBuilder.new(@path_parameters, @request_adapter)
end

#contentObject

Provides operations to manage the media for the user entity.



36
37
38
# File 'lib/me/messages/item/message_item_request_builder.rb', line 36

def content()
    return MicrosoftGraph::Me::Messages::Item::Value::ContentRequestBuilder.new(@path_parameters, @request_adapter)
end

#copyObject

Provides operations to call the copy method.



41
42
43
# File 'lib/me/messages/item/message_item_request_builder.rb', line 41

def copy()
    return MicrosoftGraph::Me::Messages::Item::Copy::CopyRequestBuilder.new(@path_parameters, @request_adapter)
end

#create_forwardObject

Provides operations to call the createForward method.



46
47
48
# File 'lib/me/messages/item/message_item_request_builder.rb', line 46

def create_forward()
    return MicrosoftGraph::Me::Messages::Item::CreateForward::CreateForwardRequestBuilder.new(@path_parameters, @request_adapter)
end

#create_replyObject

Provides operations to call the createReply method.



51
52
53
# File 'lib/me/messages/item/message_item_request_builder.rb', line 51

def create_reply()
    return MicrosoftGraph::Me::Messages::Item::CreateReply::CreateReplyRequestBuilder.new(@path_parameters, @request_adapter)
end

#create_reply_allObject

Provides operations to call the createReplyAll method.



56
57
58
# File 'lib/me/messages/item/message_item_request_builder.rb', line 56

def create_reply_all()
    return MicrosoftGraph::Me::Messages::Item::CreateReplyAll::CreateReplyAllRequestBuilder.new(@path_parameters, @request_adapter)
end

#delete(request_configuration = nil) ⇒ Object

Delete a message in the specified user’s mailbox, or delete a relationship of the message.

Parameters:

  • request_configuration (defaults to: nil)

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

Returns:

  • a Fiber of void



103
104
105
106
107
108
109
110
111
# File 'lib/me/messages/item/message_item_request_builder.rb', line 103

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

#extensionsObject

Provides operations to manage the extensions property of the microsoft.graph.message entity.



61
62
63
# File 'lib/me/messages/item/message_item_request_builder.rb', line 61

def extensions()
    return MicrosoftGraph::Me::Messages::Item::Extensions::ExtensionsRequestBuilder.new(@path_parameters, @request_adapter)
end

#forwardObject

Provides operations to call the forward method.



66
67
68
# File 'lib/me/messages/item/message_item_request_builder.rb', line 66

def forward()
    return MicrosoftGraph::Me::Messages::Item::Forward::ForwardRequestBuilder.new(@path_parameters, @request_adapter)
end

#get(request_configuration = nil) ⇒ Object

The messages in a mailbox or folder. Read-only. Nullable.

Parameters:

  • request_configuration (defaults to: nil)

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

Returns:

  • a Fiber of message



117
118
119
120
121
122
123
124
125
# File 'lib/me/messages/item/message_item_request_builder.rb', line 117

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

#moveObject

Provides operations to call the move method.



71
72
73
# File 'lib/me/messages/item/message_item_request_builder.rb', line 71

def move()
    return MicrosoftGraph::Me::Messages::Item::Move::MoveRequestBuilder.new(@path_parameters, @request_adapter)
end

#patch(body, request_configuration = nil) ⇒ Object

Update the properties of an eventMessage 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 message

Raises:

  • (StandardError)


132
133
134
135
136
137
138
139
140
141
# File 'lib/me/messages/item/message_item_request_builder.rb', line 132

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

#replyObject

Provides operations to call the reply method.



76
77
78
# File 'lib/me/messages/item/message_item_request_builder.rb', line 76

def reply()
    return MicrosoftGraph::Me::Messages::Item::Reply::ReplyRequestBuilder.new(@path_parameters, @request_adapter)
end

#reply_allObject

Provides operations to call the replyAll method.



81
82
83
# File 'lib/me/messages/item/message_item_request_builder.rb', line 81

def reply_all()
    return MicrosoftGraph::Me::Messages::Item::ReplyAll::ReplyAllRequestBuilder.new(@path_parameters, @request_adapter)
end

#sendObject

Provides operations to call the send method.



86
87
88
# File 'lib/me/messages/item/message_item_request_builder.rb', line 86

def send()
    return MicrosoftGraph::Me::Messages::Item::Send::SendRequestBuilder.new(@path_parameters, @request_adapter)
end

#to_delete_request_information(request_configuration = nil) ⇒ Object

Delete a message in the specified user’s mailbox, or delete a relationship of the message.

Parameters:

  • request_configuration (defaults to: nil)

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

Returns:

  • a request_information



147
148
149
150
151
152
153
154
155
156
157
# File 'lib/me/messages/item/message_item_request_builder.rb', line 147

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

The messages in a mailbox or folder. Read-only. Nullable.

Parameters:

  • request_configuration (defaults to: nil)

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

Returns:

  • a request_information



163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/me/messages/item/message_item_request_builder.rb', line 163

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 eventMessage 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)


182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/me/messages/item/message_item_request_builder.rb', line 182

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