Class: MicrosoftGraph::Models::PrinterShare

Inherits:
PrinterBase show all
Includes:
MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/printer_share.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PrinterBase

#capabilities, #capabilities=, #defaults, #defaults=, #display_name, #display_name=, #is_accepting_jobs, #is_accepting_jobs=, #jobs, #jobs=, #location, #location=, #manufacturer, #manufacturer=, #model, #model=, #status, #status=

Methods inherited from Entity

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

Constructor Details

#initializeObject

Instantiates a new printerShare and sets the default values.



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

def initialize()
    super
    @odata_type = "#microsoft.graph.printerShare"
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_share

Raises:

  • (StandardError)


101
102
103
104
# File 'lib/models/printer_share.rb', line 101

def self.create_from_discriminator_value(parse_node)
    raise StandardError, 'parse_node cannot be null' if parse_node.nil?
    return PrinterShare.new
end

Instance Method Details

#allow_all_usersObject

Gets the allowAllUsers property value. If true, all users and groups will be granted access to this printer share. This supersedes the allow lists defined by the allowedUsers and allowedGroups navigation properties.

Returns:

  • a boolean



32
33
34
# File 'lib/models/printer_share.rb', line 32

def allow_all_users
    return @allow_all_users
end

#allow_all_users=(value) ⇒ Object

Sets the allowAllUsers property value. If true, all users and groups will be granted access to this printer share. This supersedes the allow lists defined by the allowedUsers and allowedGroups navigation properties.

Parameters:

  • value

    Value to set for the allowAllUsers property.

Returns:

  • a void



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

def allow_all_users=(value)
    @allow_all_users = value
end

#allowed_groupsObject

Gets the allowedGroups property value. The groups whose users have access to print using the printer.

Returns:

  • a group



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

def allowed_groups
    return @allowed_groups
end

#allowed_groups=(value) ⇒ Object

Sets the allowedGroups property value. The groups whose users have access to print using the printer.

Parameters:

  • value

    Value to set for the allowedGroups property.

Returns:

  • a void



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

def allowed_groups=(value)
    @allowed_groups = value
end

#allowed_usersObject

Gets the allowedUsers property value. The users who have access to print using the printer.

Returns:

  • a user



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

def allowed_users
    return @allowed_users
end

#allowed_users=(value) ⇒ Object

Sets the allowedUsers property value. The users who have access to print using the printer.

Parameters:

  • value

    Value to set for the allowedUsers property.

Returns:

  • a void



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

def allowed_users=(value)
    @allowed_users = value
end

#created_date_timeObject

Gets the createdDateTime property value. The DateTimeOffset when the printer share was created. Read-only.

Returns:

  • a date_time



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

def created_date_time
    return @created_date_time
end

#created_date_time=(value) ⇒ Object

Sets the createdDateTime property value. The DateTimeOffset when the printer share was created. Read-only.

Parameters:

  • value

    Value to set for the createdDateTime property.

Returns:

  • a void



93
94
95
# File 'lib/models/printer_share.rb', line 93

def created_date_time=(value)
    @created_date_time = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



109
110
111
112
113
114
115
116
117
118
# File 'lib/models/printer_share.rb', line 109

def get_field_deserializers()
    return super.merge({
        "allowAllUsers" => lambda {|n| @allow_all_users = n.get_boolean_value() },
        "allowedGroups" => lambda {|n| @allowed_groups = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Group.create_from_discriminator_value(pn) }) },
        "allowedUsers" => lambda {|n| @allowed_users = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::User.create_from_discriminator_value(pn) }) },
        "createdDateTime" => lambda {|n| @created_date_time = n.get_date_time_value() },
        "printer" => lambda {|n| @printer = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Printer.create_from_discriminator_value(pn) }) },
        "viewPoint" => lambda {|n| @view_point = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::PrinterShareViewpoint.create_from_discriminator_value(pn) }) },
    })
end

#printerObject

Gets the printer property value. The printer that this printer share is related to.

Returns:

  • a printer



123
124
125
# File 'lib/models/printer_share.rb', line 123

def printer
    return @printer
end

#printer=(value) ⇒ Object

Sets the printer property value. The printer that this printer share is related to.

Parameters:

  • value

    Value to set for the printer property.

Returns:

  • a void



131
132
133
# File 'lib/models/printer_share.rb', line 131

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


139
140
141
142
143
144
145
146
147
148
# File 'lib/models/printer_share.rb', line 139

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_boolean_value("allowAllUsers", @allow_all_users)
    writer.write_collection_of_object_values("allowedGroups", @allowed_groups)
    writer.write_collection_of_object_values("allowedUsers", @allowed_users)
    writer.write_date_time_value("createdDateTime", @created_date_time)
    writer.write_object_value("printer", @printer)
    writer.write_object_value("viewPoint", @view_point)
end

#view_pointObject

Gets the viewPoint property value. Additional data for a printer share as viewed by the signed-in user.

Returns:

  • a printer_share_viewpoint



153
154
155
# File 'lib/models/printer_share.rb', line 153

def view_point
    return @view_point
end

#view_point=(value) ⇒ Object

Sets the viewPoint property value. Additional data for a printer share as viewed by the signed-in user.

Parameters:

  • value

    Value to set for the viewPoint property.

Returns:

  • a void



161
162
163
# File 'lib/models/printer_share.rb', line 161

def view_point=(value)
    @view_point = value
end