Class: MicrosoftGraph::Models::PrinterBase

Inherits:
Entity
  • Object
show all
Includes:
MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/printer_base.rb

Direct Known Subclasses

Printer, PrinterShare

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

#additional_data, #additional_data=, #id, #id=, #odata_type, #odata_type=

Constructor Details

#initializeObject

Instantiates a new printerBase and sets the default values.



55
56
57
# File 'lib/models/printer_base.rb', line 55

def initialize()
    super
end

Class Method Details

.create_from_discriminator_value(parse_node) ⇒ Object

Creates a new instance of the appropriate class based on discriminator value

Parameters:

  • parse_node

    The parse node to use to read the discriminator value and create the object

Returns:

  • a printer_base

Raises:

  • (StandardError)


63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/models/printer_base.rb', line 63

def self.create_from_discriminator_value(parse_node)
    raise StandardError, 'parse_node cannot be null' if parse_node.nil?
    mapping_value_node = parse_node.get_child_node("@odata.type")
    unless mapping_value_node.nil? then
        mapping_value = mapping_value_node.get_string_value
        case mapping_value
            when "#microsoft.graph.printer"
                return Printer.new
            when "#microsoft.graph.printerShare"
                return PrinterShare.new
        end
    end
    return PrinterBase.new
end

Instance Method Details

#capabilitiesObject

Gets the capabilities property value. The capabilities of the printer/printerShare.

Returns:

  • a printer_capabilities



40
41
42
# File 'lib/models/printer_base.rb', line 40

def capabilities
    return @capabilities
end

#capabilities=(value) ⇒ Object

Sets the capabilities property value. The capabilities of the printer/printerShare.

Parameters:

  • value

    Value to set for the capabilities property.

Returns:

  • a void



48
49
50
# File 'lib/models/printer_base.rb', line 48

def capabilities=(value)
    @capabilities = value
end

#defaultsObject

Gets the defaults property value. The default print settings of printer/printerShare.

Returns:

  • a printer_defaults



81
82
83
# File 'lib/models/printer_base.rb', line 81

def defaults
    return @defaults
end

#defaults=(value) ⇒ Object

Sets the defaults property value. The default print settings of printer/printerShare.

Parameters:

  • value

    Value to set for the defaults property.

Returns:

  • a void



89
90
91
# File 'lib/models/printer_base.rb', line 89

def defaults=(value)
    @defaults = value
end

#display_nameObject

Gets the displayName property value. The name of the printer/printerShare.

Returns:

  • a string



96
97
98
# File 'lib/models/printer_base.rb', line 96

def display_name
    return @display_name
end

#display_name=(value) ⇒ Object

Sets the displayName property value. The name of the printer/printerShare.

Parameters:

  • value

    Value to set for the displayName property.

Returns:

  • a void



104
105
106
# File 'lib/models/printer_base.rb', line 104

def display_name=(value)
    @display_name = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/models/printer_base.rb', line 111

def get_field_deserializers()
    return super.merge({
        "capabilities" => lambda {|n| @capabilities = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::PrinterCapabilities.create_from_discriminator_value(pn) }) },
        "defaults" => lambda {|n| @defaults = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::PrinterDefaults.create_from_discriminator_value(pn) }) },
        "displayName" => lambda {|n| @display_name = n.get_string_value() },
        "isAcceptingJobs" => lambda {|n| @is_accepting_jobs = n.get_boolean_value() },
        "jobs" => lambda {|n| @jobs = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PrintJob.create_from_discriminator_value(pn) }) },
        "location" => lambda {|n| @location = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::PrinterLocation.create_from_discriminator_value(pn) }) },
        "manufacturer" => lambda {|n| @manufacturer = n.get_string_value() },
        "model" => lambda {|n| @model = n.get_string_value() },
        "status" => lambda {|n| @status = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::PrinterStatus.create_from_discriminator_value(pn) }) },
    })
end

#is_accepting_jobsObject

Gets the isAcceptingJobs property value. Whether the printer/printerShare is currently accepting new print jobs.

Returns:

  • a boolean



128
129
130
# File 'lib/models/printer_base.rb', line 128

def is_accepting_jobs
    return @is_accepting_jobs
end

#is_accepting_jobs=(value) ⇒ Object

Sets the isAcceptingJobs property value. Whether the printer/printerShare is currently accepting new print jobs.

Parameters:

  • value

    Value to set for the isAcceptingJobs property.

Returns:

  • a void



136
137
138
# File 'lib/models/printer_base.rb', line 136

def is_accepting_jobs=(value)
    @is_accepting_jobs = value
end

#jobsObject

Gets the jobs property value. The list of jobs that are queued for printing by the printer/printerShare.

Returns:

  • a print_job



143
144
145
# File 'lib/models/printer_base.rb', line 143

def jobs
    return @jobs
end

#jobs=(value) ⇒ Object

Sets the jobs property value. The list of jobs that are queued for printing by the printer/printerShare.

Parameters:

  • value

    Value to set for the jobs property.

Returns:

  • a void



151
152
153
# File 'lib/models/printer_base.rb', line 151

def jobs=(value)
    @jobs = value
end

#locationObject

Gets the location property value. The physical and/or organizational location of the printer/printerShare.

Returns:

  • a printer_location



158
159
160
# File 'lib/models/printer_base.rb', line 158

def location
    return @location
end

#location=(value) ⇒ Object

Sets the location property value. The physical and/or organizational location of the printer/printerShare.

Parameters:

  • value

    Value to set for the location property.

Returns:

  • a void



166
167
168
# File 'lib/models/printer_base.rb', line 166

def location=(value)
    @location = value
end

#manufacturerObject

Gets the manufacturer property value. The manufacturer of the printer/printerShare.

Returns:

  • a string



173
174
175
# File 'lib/models/printer_base.rb', line 173

def manufacturer
    return @manufacturer
end

#manufacturer=(value) ⇒ Object

Sets the manufacturer property value. The manufacturer of the printer/printerShare.

Parameters:

  • value

    Value to set for the manufacturer property.

Returns:

  • a void



181
182
183
# File 'lib/models/printer_base.rb', line 181

def manufacturer=(value)
    @manufacturer = value
end

#modelObject

Gets the model property value. The model name of the printer/printerShare.

Returns:

  • a string



188
189
190
# File 'lib/models/printer_base.rb', line 188

def model
    return @model
end

#model=(value) ⇒ Object

Sets the model property value. The model name of the printer/printerShare.

Parameters:

  • value

    Value to set for the model property.

Returns:

  • a void



196
197
198
# File 'lib/models/printer_base.rb', line 196

def model=(value)
    @model = value
end

#serialize(writer) ⇒ Object

Serializes information the current object

Parameters:

  • writer

    Serialization writer to use to serialize this model

Returns:

  • a void

Raises:

  • (StandardError)


204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/models/printer_base.rb', line 204

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_object_value("capabilities", @capabilities)
    writer.write_object_value("defaults", @defaults)
    writer.write_string_value("displayName", @display_name)
    writer.write_boolean_value("isAcceptingJobs", @is_accepting_jobs)
    writer.write_collection_of_object_values("jobs", @jobs)
    writer.write_object_value("location", @location)
    writer.write_string_value("manufacturer", @manufacturer)
    writer.write_string_value("model", @model)
    writer.write_object_value("status", @status)
end

#statusObject

Gets the status property value. The status property

Returns:

  • a printer_status



221
222
223
# File 'lib/models/printer_base.rb', line 221

def status
    return @status
end

#status=(value) ⇒ Object

Sets the status property value. The status property

Parameters:

  • value

    Value to set for the status property.

Returns:

  • a void



229
230
231
# File 'lib/models/printer_base.rb', line 229

def status=(value)
    @status = value
end