Class: MicrosoftGraph::Print::Printers::Item::PrinterItemRequestBuilder
- Inherits:
-
MicrosoftKiotaAbstractions::BaseRequestBuilder
- Object
- MicrosoftKiotaAbstractions::BaseRequestBuilder
- MicrosoftGraph::Print::Printers::Item::PrinterItemRequestBuilder
- Defined in:
- lib/print/printers/item/printer_item_request_builder.rb
Overview
Provides operations to manage the printers property of the microsoft.graph.print entity.
Defined Under Namespace
Classes: PrinterItemRequestBuilderGetQueryParameters
Instance Method Summary collapse
-
#connectors ⇒ Object
Provides operations to manage the connectors property of the microsoft.graph.printer entity.
-
#delete(request_configuration = nil) ⇒ Object
Delete (unregister) a printer.
-
#get(request_configuration = nil) ⇒ Object
Retrieve the properties and relationships of a printer object.
-
#initialize(path_parameters, request_adapter) ⇒ Object
constructor
Instantiates a new PrinterItemRequestBuilder and sets the default values.
-
#jobs ⇒ Object
Provides operations to manage the jobs property of the microsoft.graph.printerBase entity.
-
#patch(body, request_configuration = nil) ⇒ Object
Update the properties of a printer object.
-
#restore_factory_defaults ⇒ Object
Provides operations to call the restoreFactoryDefaults method.
-
#shares ⇒ Object
Provides operations to manage the shares property of the microsoft.graph.printer entity.
-
#task_triggers ⇒ Object
Provides operations to manage the taskTriggers property of the microsoft.graph.printer entity.
-
#to_delete_request_information(request_configuration = nil) ⇒ Object
Delete (unregister) a printer.
-
#to_get_request_information(request_configuration = nil) ⇒ Object
Retrieve the properties and relationships of a printer object.
-
#to_patch_request_information(body, request_configuration = nil) ⇒ Object
Update the properties of a printer object.
Constructor Details
#initialize(path_parameters, request_adapter) ⇒ Object
Instantiates a new PrinterItemRequestBuilder and sets the default values.
53 54 55 |
# File 'lib/print/printers/item/printer_item_request_builder.rb', line 53 def initialize(path_parameters, request_adapter) super(path_parameters, request_adapter, "{+baseurl}/print/printers/{printer%2Did}{?%24select,%24expand}") end |
Instance Method Details
#connectors ⇒ Object
Provides operations to manage the connectors property of the microsoft.graph.printer entity.
24 25 26 |
# File 'lib/print/printers/item/printer_item_request_builder.rb', line 24 def connectors() return MicrosoftGraph::Print::Printers::Item::Connectors::ConnectorsRequestBuilder.new(@path_parameters, @request_adapter) end |
#delete(request_configuration = nil) ⇒ Object
Delete (unregister) a printer.
61 62 63 64 65 66 67 68 69 |
# File 'lib/print/printers/item/printer_item_request_builder.rb', line 61 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 a printer object.
75 76 77 78 79 80 81 82 83 |
# File 'lib/print/printers/item/printer_item_request_builder.rb', line 75 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::Printer.create_from_discriminator_value(pn) }, error_mapping) end |
#jobs ⇒ Object
Provides operations to manage the jobs property of the microsoft.graph.printerBase entity.
29 30 31 |
# File 'lib/print/printers/item/printer_item_request_builder.rb', line 29 def jobs() return MicrosoftGraph::Print::Printers::Item::Jobs::JobsRequestBuilder.new(@path_parameters, @request_adapter) end |
#patch(body, request_configuration = nil) ⇒ Object
Update the properties of a printer object.
90 91 92 93 94 95 96 97 98 99 |
# File 'lib/print/printers/item/printer_item_request_builder.rb', line 90 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::Printer.create_from_discriminator_value(pn) }, error_mapping) end |
#restore_factory_defaults ⇒ Object
Provides operations to call the restoreFactoryDefaults method.
34 35 36 |
# File 'lib/print/printers/item/printer_item_request_builder.rb', line 34 def restore_factory_defaults() return MicrosoftGraph::Print::Printers::Item::RestoreFactoryDefaults::RestoreFactoryDefaultsRequestBuilder.new(@path_parameters, @request_adapter) end |
#shares ⇒ Object
Provides operations to manage the shares property of the microsoft.graph.printer entity.
39 40 41 |
# File 'lib/print/printers/item/printer_item_request_builder.rb', line 39 def shares() return MicrosoftGraph::Print::Printers::Item::Shares::SharesRequestBuilder.new(@path_parameters, @request_adapter) end |
#task_triggers ⇒ Object
Provides operations to manage the taskTriggers property of the microsoft.graph.printer entity.
44 45 46 |
# File 'lib/print/printers/item/printer_item_request_builder.rb', line 44 def task_triggers() return MicrosoftGraph::Print::Printers::Item::TaskTriggers::TaskTriggersRequestBuilder.new(@path_parameters, @request_adapter) end |
#to_delete_request_information(request_configuration = nil) ⇒ Object
Delete (unregister) a printer.
105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/print/printers/item/printer_item_request_builder.rb', line 105 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.(request_configuration.) end return request_info end |
#to_get_request_information(request_configuration = nil) ⇒ Object
Retrieve the properties and relationships of a printer object.
121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/print/printers/item/printer_item_request_builder.rb', line 121 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_patch_request_information(body, request_configuration = nil) ⇒ Object
Update the properties of a printer object.
140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/print/printers/item/printer_item_request_builder.rb', line 140 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.(request_configuration.) end request_info.set_content_from_parsable(@request_adapter, "application/json", body) return request_info end |