Class: MicrosoftGraph::Admin::ServiceAnnouncement::Messages::MessagesRequestBuilder
- Inherits:
-
MicrosoftKiotaAbstractions::BaseRequestBuilder
- Object
- MicrosoftKiotaAbstractions::BaseRequestBuilder
- MicrosoftGraph::Admin::ServiceAnnouncement::Messages::MessagesRequestBuilder
- Defined in:
- lib/admin/service_announcement/messages/messages_request_builder.rb
Overview
Provides operations to manage the messages property of the microsoft.graph.serviceAnnouncement entity.
Defined Under Namespace
Classes: MessagesRequestBuilderGetQueryParameters
Instance Method Summary collapse
-
#archive ⇒ Object
Provides operations to call the archive method.
-
#by_service_update_message_id(service_update_message_id) ⇒ Object
Provides operations to manage the messages property of the microsoft.graph.serviceAnnouncement entity.
-
#count ⇒ Object
Provides operations to count the resources in the collection.
-
#favorite ⇒ Object
Provides operations to call the favorite method.
-
#get(request_configuration = nil) ⇒ Object
Retrieve the serviceUpdateMessage resources from the messages navigation property.
-
#initialize(path_parameters, request_adapter) ⇒ Object
constructor
Instantiates a new MessagesRequestBuilder and sets the default values.
-
#mark_read ⇒ Object
Provides operations to call the markRead method.
-
#mark_unread ⇒ Object
Provides operations to call the markUnread method.
-
#post(body, request_configuration = nil) ⇒ Object
Create new navigation property to messages for admin.
-
#to_get_request_information(request_configuration = nil) ⇒ Object
Retrieve the serviceUpdateMessage resources from the messages navigation property.
-
#to_post_request_information(body, request_configuration = nil) ⇒ Object
Create new navigation property to messages for admin.
-
#unarchive ⇒ Object
Provides operations to call the unarchive method.
-
#unfavorite ⇒ Object
Provides operations to call the unfavorite method.
Constructor Details
#initialize(path_parameters, request_adapter) ⇒ Object
Instantiates a new MessagesRequestBuilder and sets the default values.
78 79 80 |
# File 'lib/admin/service_announcement/messages/messages_request_builder.rb', line 78 def initialize(path_parameters, request_adapter) super(path_parameters, request_adapter, "{+baseurl}/admin/serviceAnnouncement/messages{?%24top,%24skip,%24search,%24filter,%24count,%24orderby,%24select,%24expand}") end |
Instance Method Details
#archive ⇒ Object
Provides operations to call the archive method.
28 29 30 |
# File 'lib/admin/service_announcement/messages/messages_request_builder.rb', line 28 def archive() return MicrosoftGraph::Admin::ServiceAnnouncement::Messages::Archive::ArchiveRequestBuilder.new(@path_parameters, @request_adapter) end |
#by_service_update_message_id(service_update_message_id) ⇒ Object
Provides operations to manage the messages property of the microsoft.graph.serviceAnnouncement entity.
66 67 68 69 70 71 |
# File 'lib/admin/service_announcement/messages/messages_request_builder.rb', line 66 def () raise StandardError, 'service_update_message_id cannot be null' if .nil? url_tpl_params = @path_parameters.clone url_tpl_params["serviceUpdateMessage%2Did"] = return MicrosoftGraph::Admin::ServiceAnnouncement::Messages::Item::ServiceUpdateMessageItemRequestBuilder.new(url_tpl_params, @request_adapter) end |
#count ⇒ Object
Provides operations to count the resources in the collection.
33 34 35 |
# File 'lib/admin/service_announcement/messages/messages_request_builder.rb', line 33 def count() return MicrosoftGraph::Admin::ServiceAnnouncement::Messages::Count::CountRequestBuilder.new(@path_parameters, @request_adapter) end |
#favorite ⇒ Object
Provides operations to call the favorite method.
38 39 40 |
# File 'lib/admin/service_announcement/messages/messages_request_builder.rb', line 38 def favorite() return MicrosoftGraph::Admin::ServiceAnnouncement::Messages::Favorite::FavoriteRequestBuilder.new(@path_parameters, @request_adapter) end |
#get(request_configuration = nil) ⇒ Object
Retrieve the serviceUpdateMessage resources from the messages navigation property. This operation retrieves all service update messages that exist for the tenant.
86 87 88 89 90 91 92 93 94 |
# File 'lib/admin/service_announcement/messages/messages_request_builder.rb', line 86 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::ServiceUpdateMessageCollectionResponse.create_from_discriminator_value(pn) }, error_mapping) end |
#mark_read ⇒ Object
Provides operations to call the markRead method.
43 44 45 |
# File 'lib/admin/service_announcement/messages/messages_request_builder.rb', line 43 def mark_read() return MicrosoftGraph::Admin::ServiceAnnouncement::Messages::MarkRead::MarkReadRequestBuilder.new(@path_parameters, @request_adapter) end |
#mark_unread ⇒ Object
Provides operations to call the markUnread method.
48 49 50 |
# File 'lib/admin/service_announcement/messages/messages_request_builder.rb', line 48 def mark_unread() return MicrosoftGraph::Admin::ServiceAnnouncement::Messages::MarkUnread::MarkUnreadRequestBuilder.new(@path_parameters, @request_adapter) end |
#post(body, request_configuration = nil) ⇒ Object
Create new navigation property to messages for admin
101 102 103 104 105 106 107 108 109 110 |
# File 'lib/admin/service_announcement/messages/messages_request_builder.rb', line 101 def post(body, request_configuration=nil) raise StandardError, 'body cannot be null' if body.nil? request_info = self.to_post_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::ServiceUpdateMessage.create_from_discriminator_value(pn) }, error_mapping) end |
#to_get_request_information(request_configuration = nil) ⇒ Object
Retrieve the serviceUpdateMessage resources from the messages navigation property. This operation retrieves all service update messages that exist for the tenant.
116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/admin/service_announcement/messages/messages_request_builder.rb', line 116 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.(request_configuration.) end return request_info end |
#to_post_request_information(body, request_configuration = nil) ⇒ Object
Create new navigation property to messages for admin
135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/admin/service_announcement/messages/messages_request_builder.rb', line 135 def to_post_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 = :POST request_info.headers.add('Accept', 'application/json') unless request_configuration.nil? request_info.add_headers_from_raw_object(request_configuration.headers) request_info.(request_configuration.) end request_info.set_content_from_parsable(@request_adapter, "application/json", body) return request_info end |
#unarchive ⇒ Object
Provides operations to call the unarchive method.
53 54 55 |
# File 'lib/admin/service_announcement/messages/messages_request_builder.rb', line 53 def unarchive() return MicrosoftGraph::Admin::ServiceAnnouncement::Messages::Unarchive::UnarchiveRequestBuilder.new(@path_parameters, @request_adapter) end |
#unfavorite ⇒ Object
Provides operations to call the unfavorite method.
58 59 60 |
# File 'lib/admin/service_announcement/messages/messages_request_builder.rb', line 58 def unfavorite() return MicrosoftGraph::Admin::ServiceAnnouncement::Messages::Unfavorite::UnfavoriteRequestBuilder.new(@path_parameters, @request_adapter) end |