Class: MicrosoftGraph::Models::PrintUsage

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

Direct Known Subclasses

PrintUsageByPrinter, PrintUsageByUser

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 printUsage and sets the default values.



122
123
124
# File 'lib/models/print_usage.rb', line 122

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 print_usage

Raises:

  • (StandardError)


130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/models/print_usage.rb', line 130

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.printUsageByPrinter"
                return PrintUsageByPrinter.new
            when "#microsoft.graph.printUsageByUser"
                return PrintUsageByUser.new
        end
    end
    return PrintUsage.new
end

Instance Method Details

#black_and_white_page_countObject

Gets the blackAndWhitePageCount property value. The blackAndWhitePageCount property

Returns:

  • a int64



47
48
49
# File 'lib/models/print_usage.rb', line 47

def black_and_white_page_count
    return @black_and_white_page_count
end

#black_and_white_page_count=(value) ⇒ Object

Sets the blackAndWhitePageCount property value. The blackAndWhitePageCount property

Parameters:

  • value

    Value to set for the blackAndWhitePageCount property.

Returns:

  • a void



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

def black_and_white_page_count=(value)
    @black_and_white_page_count = value
end

#color_page_countObject

Gets the colorPageCount property value. The colorPageCount property

Returns:

  • a int64



62
63
64
# File 'lib/models/print_usage.rb', line 62

def color_page_count
    return @color_page_count
end

#color_page_count=(value) ⇒ Object

Sets the colorPageCount property value. The colorPageCount property

Parameters:

  • value

    Value to set for the colorPageCount property.

Returns:

  • a void



70
71
72
# File 'lib/models/print_usage.rb', line 70

def color_page_count=(value)
    @color_page_count = value
end

#completed_black_and_white_job_countObject

Gets the completedBlackAndWhiteJobCount property value. The completedBlackAndWhiteJobCount property

Returns:

  • a int64



77
78
79
# File 'lib/models/print_usage.rb', line 77

def completed_black_and_white_job_count
    return @completed_black_and_white_job_count
end

#completed_black_and_white_job_count=(value) ⇒ Object

Sets the completedBlackAndWhiteJobCount property value. The completedBlackAndWhiteJobCount property

Parameters:

  • value

    Value to set for the completedBlackAndWhiteJobCount property.

Returns:

  • a void



85
86
87
# File 'lib/models/print_usage.rb', line 85

def completed_black_and_white_job_count=(value)
    @completed_black_and_white_job_count = value
end

#completed_color_job_countObject

Gets the completedColorJobCount property value. The completedColorJobCount property

Returns:

  • a int64



92
93
94
# File 'lib/models/print_usage.rb', line 92

def completed_color_job_count
    return @completed_color_job_count
end

#completed_color_job_count=(value) ⇒ Object

Sets the completedColorJobCount property value. The completedColorJobCount property

Parameters:

  • value

    Value to set for the completedColorJobCount property.

Returns:

  • a void



100
101
102
# File 'lib/models/print_usage.rb', line 100

def completed_color_job_count=(value)
    @completed_color_job_count = value
end

#completed_job_countObject

Gets the completedJobCount property value. The completedJobCount property

Returns:

  • a int64



107
108
109
# File 'lib/models/print_usage.rb', line 107

def completed_job_count
    return @completed_job_count
end

#completed_job_count=(value) ⇒ Object

Sets the completedJobCount property value. The completedJobCount property

Parameters:

  • value

    Value to set for the completedJobCount property.

Returns:

  • a void



115
116
117
# File 'lib/models/print_usage.rb', line 115

def completed_job_count=(value)
    @completed_job_count = value
end

#double_sided_sheet_countObject

Gets the doubleSidedSheetCount property value. The doubleSidedSheetCount property

Returns:

  • a int64



148
149
150
# File 'lib/models/print_usage.rb', line 148

def double_sided_sheet_count
    return @double_sided_sheet_count
end

#double_sided_sheet_count=(value) ⇒ Object

Sets the doubleSidedSheetCount property value. The doubleSidedSheetCount property

Parameters:

  • value

    Value to set for the doubleSidedSheetCount property.

Returns:

  • a void



156
157
158
# File 'lib/models/print_usage.rb', line 156

def double_sided_sheet_count=(value)
    @double_sided_sheet_count = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/models/print_usage.rb', line 163

def get_field_deserializers()
    return super.merge({
        "blackAndWhitePageCount" => lambda {|n| @black_and_white_page_count = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },
        "colorPageCount" => lambda {|n| @color_page_count = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },
        "completedBlackAndWhiteJobCount" => lambda {|n| @completed_black_and_white_job_count = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },
        "completedColorJobCount" => lambda {|n| @completed_color_job_count = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },
        "completedJobCount" => lambda {|n| @completed_job_count = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },
        "doubleSidedSheetCount" => lambda {|n| @double_sided_sheet_count = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },
        "incompleteJobCount" => lambda {|n| @incomplete_job_count = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },
        "mediaSheetCount" => lambda {|n| @media_sheet_count = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },
        "pageCount" => lambda {|n| @page_count = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },
        "singleSidedSheetCount" => lambda {|n| @single_sided_sheet_count = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },
        "usageDate" => lambda {|n| @usage_date = n.get_date_value() },
    })
end

#incomplete_job_countObject

Gets the incompleteJobCount property value. The incompleteJobCount property

Returns:

  • a int64



182
183
184
# File 'lib/models/print_usage.rb', line 182

def incomplete_job_count
    return @incomplete_job_count
end

#incomplete_job_count=(value) ⇒ Object

Sets the incompleteJobCount property value. The incompleteJobCount property

Parameters:

  • value

    Value to set for the incompleteJobCount property.

Returns:

  • a void



190
191
192
# File 'lib/models/print_usage.rb', line 190

def incomplete_job_count=(value)
    @incomplete_job_count = value
end

#media_sheet_countObject

Gets the mediaSheetCount property value. The mediaSheetCount property

Returns:

  • a int64



197
198
199
# File 'lib/models/print_usage.rb', line 197

def media_sheet_count
    return @media_sheet_count
end

#media_sheet_count=(value) ⇒ Object

Sets the mediaSheetCount property value. The mediaSheetCount property

Parameters:

  • value

    Value to set for the mediaSheetCount property.

Returns:

  • a void



205
206
207
# File 'lib/models/print_usage.rb', line 205

def media_sheet_count=(value)
    @media_sheet_count = value
end

#page_countObject

Gets the pageCount property value. The pageCount property

Returns:

  • a int64



212
213
214
# File 'lib/models/print_usage.rb', line 212

def page_count
    return @page_count
end

#page_count=(value) ⇒ Object

Sets the pageCount property value. The pageCount property

Parameters:

  • value

    Value to set for the pageCount property.

Returns:

  • a void



220
221
222
# File 'lib/models/print_usage.rb', line 220

def page_count=(value)
    @page_count = 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)


228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/models/print_usage.rb', line 228

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_object_value("blackAndWhitePageCount", @black_and_white_page_count)
    writer.write_object_value("colorPageCount", @color_page_count)
    writer.write_object_value("completedBlackAndWhiteJobCount", @completed_black_and_white_job_count)
    writer.write_object_value("completedColorJobCount", @completed_color_job_count)
    writer.write_object_value("completedJobCount", @completed_job_count)
    writer.write_object_value("doubleSidedSheetCount", @double_sided_sheet_count)
    writer.write_object_value("incompleteJobCount", @incomplete_job_count)
    writer.write_object_value("mediaSheetCount", @media_sheet_count)
    writer.write_object_value("pageCount", @page_count)
    writer.write_object_value("singleSidedSheetCount", @single_sided_sheet_count)
    writer.write_date_value("usageDate", @usage_date)
end

#single_sided_sheet_countObject

Gets the singleSidedSheetCount property value. The singleSidedSheetCount property

Returns:

  • a int64



247
248
249
# File 'lib/models/print_usage.rb', line 247

def single_sided_sheet_count
    return @single_sided_sheet_count
end

#single_sided_sheet_count=(value) ⇒ Object

Sets the singleSidedSheetCount property value. The singleSidedSheetCount property

Parameters:

  • value

    Value to set for the singleSidedSheetCount property.

Returns:

  • a void



255
256
257
# File 'lib/models/print_usage.rb', line 255

def single_sided_sheet_count=(value)
    @single_sided_sheet_count = value
end

#usage_dateObject

Gets the usageDate property value. The usageDate property

Returns:

  • a date



262
263
264
# File 'lib/models/print_usage.rb', line 262

def usage_date
    return @usage_date
end

#usage_date=(value) ⇒ Object

Sets the usageDate property value. The usageDate property

Parameters:

  • value

    Value to set for the usageDate property.

Returns:

  • a void



270
271
272
# File 'lib/models/print_usage.rb', line 270

def usage_date=(value)
    @usage_date = value
end