Class: MicrosoftGraph::Models::Permission

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

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



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

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 permission

Raises:

  • (StandardError)


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

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

Instance Method Details

#expiration_date_timeObject

Gets the expirationDateTime property value. A format of yyyy-MM-ddTHH:mm:ssZ of DateTimeOffset indicates the expiration time of the permission. DateTime.MinValue indicates there is no expiration set for this permission. Optional.

Returns:

  • a date_time



63
64
65
# File 'lib/models/permission.rb', line 63

def expiration_date_time
    return @expiration_date_time
end

#expiration_date_time=(value) ⇒ Object

Sets the expirationDateTime property value. A format of yyyy-MM-ddTHH:mm:ssZ of DateTimeOffset indicates the expiration time of the permission. DateTime.MinValue indicates there is no expiration set for this permission. Optional.

Parameters:

  • value

    Value to set for the expirationDateTime property.

Returns:

  • a void



71
72
73
# File 'lib/models/permission.rb', line 71

def expiration_date_time=(value)
    @expiration_date_time = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/models/permission.rb', line 78

def get_field_deserializers()
    return super.merge({
        "expirationDateTime" => lambda {|n| @expiration_date_time = n.get_date_time_value() },
        "grantedTo" => lambda {|n| @granted_to = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },
        "grantedToIdentities" => lambda {|n| @granted_to_identities = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },
        "grantedToIdentitiesV2" => lambda {|n| @granted_to_identities_v2 = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SharePointIdentitySet.create_from_discriminator_value(pn) }) },
        "grantedToV2" => lambda {|n| @granted_to_v2 = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SharePointIdentitySet.create_from_discriminator_value(pn) }) },
        "hasPassword" => lambda {|n| @has_password = n.get_boolean_value() },
        "inheritedFrom" => lambda {|n| @inherited_from = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemReference.create_from_discriminator_value(pn) }) },
        "invitation" => lambda {|n| @invitation = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SharingInvitation.create_from_discriminator_value(pn) }) },
        "link" => lambda {|n| @link = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SharingLink.create_from_discriminator_value(pn) }) },
        "roles" => lambda {|n| @roles = n.get_collection_of_primitive_values(String) },
        "shareId" => lambda {|n| @share_id = n.get_string_value() },
    })
end

#granted_toObject

Gets the grantedTo property value. The grantedTo property

Returns:

  • a identity_set



97
98
99
# File 'lib/models/permission.rb', line 97

def granted_to
    return @granted_to
end

#granted_to=(value) ⇒ Object

Sets the grantedTo property value. The grantedTo property

Parameters:

  • value

    Value to set for the grantedTo property.

Returns:

  • a void



105
106
107
# File 'lib/models/permission.rb', line 105

def granted_to=(value)
    @granted_to = value
end

#granted_to_identitiesObject

Gets the grantedToIdentities property value. The grantedToIdentities property

Returns:

  • a identity_set



112
113
114
# File 'lib/models/permission.rb', line 112

def granted_to_identities
    return @granted_to_identities
end

#granted_to_identities=(value) ⇒ Object

Sets the grantedToIdentities property value. The grantedToIdentities property

Parameters:

  • value

    Value to set for the grantedToIdentities property.

Returns:

  • a void



120
121
122
# File 'lib/models/permission.rb', line 120

def granted_to_identities=(value)
    @granted_to_identities = value
end

#granted_to_identities_v2Object

Gets the grantedToIdentitiesV2 property value. For link type permissions, the details of the users to whom permission was granted. Read-only.

Returns:

  • a share_point_identity_set



127
128
129
# File 'lib/models/permission.rb', line 127

def granted_to_identities_v2
    return @granted_to_identities_v2
end

#granted_to_identities_v2=(value) ⇒ Object

Sets the grantedToIdentitiesV2 property value. For link type permissions, the details of the users to whom permission was granted. Read-only.

Parameters:

  • value

    Value to set for the grantedToIdentitiesV2 property.

Returns:

  • a void



135
136
137
# File 'lib/models/permission.rb', line 135

def granted_to_identities_v2=(value)
    @granted_to_identities_v2 = value
end

#granted_to_v2Object

Gets the grantedToV2 property value. For user type permissions, the details of the users and applications for this permission. Read-only.

Returns:

  • a share_point_identity_set



142
143
144
# File 'lib/models/permission.rb', line 142

def granted_to_v2
    return @granted_to_v2
end

#granted_to_v2=(value) ⇒ Object

Sets the grantedToV2 property value. For user type permissions, the details of the users and applications for this permission. Read-only.

Parameters:

  • value

    Value to set for the grantedToV2 property.

Returns:

  • a void



150
151
152
# File 'lib/models/permission.rb', line 150

def granted_to_v2=(value)
    @granted_to_v2 = value
end

#has_passwordObject

Gets the hasPassword property value. Indicates whether the password is set for this permission. This property only appears in the response. Optional. Read-only. For OneDrive Personal only..

Returns:

  • a boolean



157
158
159
# File 'lib/models/permission.rb', line 157

def has_password
    return @has_password
end

#has_password=(value) ⇒ Object

Sets the hasPassword property value. Indicates whether the password is set for this permission. This property only appears in the response. Optional. Read-only. For OneDrive Personal only..

Parameters:

  • value

    Value to set for the hasPassword property.

Returns:

  • a void



165
166
167
# File 'lib/models/permission.rb', line 165

def has_password=(value)
    @has_password = value
end

#inherited_fromObject

Gets the inheritedFrom property value. Provides a reference to the ancestor of the current permission, if it is inherited from an ancestor. Read-only.

Returns:

  • a item_reference



172
173
174
# File 'lib/models/permission.rb', line 172

def inherited_from
    return @inherited_from
end

#inherited_from=(value) ⇒ Object

Sets the inheritedFrom property value. Provides a reference to the ancestor of the current permission, if it is inherited from an ancestor. Read-only.

Parameters:

  • value

    Value to set for the inheritedFrom property.

Returns:

  • a void



180
181
182
# File 'lib/models/permission.rb', line 180

def inherited_from=(value)
    @inherited_from = value
end

#invitationObject

Gets the invitation property value. Details of any associated sharing invitation for this permission. Read-only.

Returns:

  • a sharing_invitation



187
188
189
# File 'lib/models/permission.rb', line 187

def invitation
    return @invitation
end

#invitation=(value) ⇒ Object

Sets the invitation property value. Details of any associated sharing invitation for this permission. Read-only.

Parameters:

  • value

    Value to set for the invitation property.

Returns:

  • a void



195
196
197
# File 'lib/models/permission.rb', line 195

def invitation=(value)
    @invitation = value
end

Gets the link property value. Provides the link details of the current permission, if it is a link type permissions. Read-only.

Returns:

  • a sharing_link



202
203
204
# File 'lib/models/permission.rb', line 202

def link
    return @link
end

#link=(value) ⇒ Object

Sets the link property value. Provides the link details of the current permission, if it is a link type permissions. Read-only.

Parameters:

  • value

    Value to set for the link property.

Returns:

  • a void



210
211
212
# File 'lib/models/permission.rb', line 210

def link=(value)
    @link = value
end

#rolesObject

Gets the roles property value. The type of permission, for example, read. See below for the full list of roles. Read-only.

Returns:

  • a string



217
218
219
# File 'lib/models/permission.rb', line 217

def roles
    return @roles
end

#roles=(value) ⇒ Object

Sets the roles property value. The type of permission, for example, read. See below for the full list of roles. Read-only.

Parameters:

  • value

    Value to set for the roles property.

Returns:

  • a void



225
226
227
# File 'lib/models/permission.rb', line 225

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


233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/models/permission.rb', line 233

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_date_time_value("expirationDateTime", @expiration_date_time)
    writer.write_object_value("grantedTo", @granted_to)
    writer.write_collection_of_object_values("grantedToIdentities", @granted_to_identities)
    writer.write_collection_of_object_values("grantedToIdentitiesV2", @granted_to_identities_v2)
    writer.write_object_value("grantedToV2", @granted_to_v2)
    writer.write_boolean_value("hasPassword", @has_password)
    writer.write_object_value("inheritedFrom", @inherited_from)
    writer.write_object_value("invitation", @invitation)
    writer.write_object_value("link", @link)
    writer.write_collection_of_primitive_values("roles", @roles)
    writer.write_string_value("shareId", @share_id)
end

#share_idObject

Gets the shareId property value. A unique token that can be used to access this shared item via the shares API. Read-only.

Returns:

  • a string



252
253
254
# File 'lib/models/permission.rb', line 252

def share_id
    return @share_id
end

#share_id=(value) ⇒ Object

Sets the shareId property value. A unique token that can be used to access this shared item via the shares API. Read-only.

Parameters:

  • value

    Value to set for the shareId property.

Returns:

  • a void



260
261
262
# File 'lib/models/permission.rb', line 260

def share_id=(value)
    @share_id = value
end