microslop_one_drive 5.1.2 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +43 -0
- data/lib/microslop_one_drive/batch/batch.rb +2 -0
- data/lib/microslop_one_drive/deserializers/application_deserializer.rb +17 -0
- data/lib/microslop_one_drive/deserializers/base_identity_set_deserializer.rb +12 -0
- data/lib/microslop_one_drive/deserializers/deserializers.rb +13 -0
- data/lib/microslop_one_drive/deserializers/device_deserializer.rb +17 -0
- data/lib/microslop_one_drive/deserializers/group_deserializer.rb +17 -0
- data/lib/microslop_one_drive/deserializers/identity_set_deserializer.rb +27 -0
- data/lib/microslop_one_drive/deserializers/permission_deserializer.rb +2 -2
- data/lib/microslop_one_drive/deserializers/user_deserializer.rb +3 -3
- data/lib/microslop_one_drive/endpoints/endpoints.rb +13 -0
- data/lib/microslop_one_drive/endpoints/me.rb +1 -1
- data/lib/microslop_one_drive/errors/errors.rb +1 -0
- data/lib/microslop_one_drive/identity_sets/application.rb +5 -0
- data/lib/microslop_one_drive/identity_sets/base_identity_set.rb +12 -0
- data/lib/microslop_one_drive/identity_sets/device.rb +5 -0
- data/lib/microslop_one_drive/identity_sets/group.rb +5 -0
- data/lib/microslop_one_drive/identity_sets/identity_sets.rb +5 -0
- data/lib/microslop_one_drive/identity_sets/user.rb +47 -0
- data/lib/microslop_one_drive/list_responses/list_responses.rb +5 -0
- data/lib/microslop_one_drive/permissions/permissions.rb +5 -0
- data/lib/microslop_one_drive/version.rb +1 -1
- data/lib/microslop_one_drive.rb +9 -47
- metadata +18 -3
- data/lib/microslop_one_drive/deserializers/granted_to_deserializer.rb +0 -20
- data/lib/microslop_one_drive/user.rb +0 -46
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c3391a616afb68c1cfef2bd83d8d9533bbe78ac392992af9778ad206e121c1be
|
|
4
|
+
data.tar.gz: 448e9e6f528d0754a5f13086a29e0020608b6be9da316a14bd12273a5503fd4b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2f09383070ce2c2fdcb4115d7adc2999b656045838beb697f48cad8a2781924a371ac5180027fc16fb86f1d48f1d08631e1d5fdee5765d42e0cb2026760a1f12
|
|
7
|
+
data.tar.gz: 888939a36e1c8896088192bbd3032062cb4543c5e052f8b5f92354a59fb704b22ec2c83042957fd312263b5366e616eaffc03b90ef95bf58fc5a665e4ab2ed8d
|
data/README.md
CHANGED
|
@@ -176,6 +176,49 @@ permissions.each do |p|
|
|
|
176
176
|
end
|
|
177
177
|
```
|
|
178
178
|
|
|
179
|
+
### Deleting a Permission from a Drive Item
|
|
180
|
+
|
|
181
|
+
Use `delete_permission` to remove a permission from a drive item. It returns `true` both when the permission was just
|
|
182
|
+
deleted and when it's already gone (idempotent behavior). It raises an error if the drive or item does not exist.
|
|
183
|
+
|
|
184
|
+
```rb
|
|
185
|
+
permission = permissions.first
|
|
186
|
+
|
|
187
|
+
# Delete from the default drive
|
|
188
|
+
client.delete_permission(item_id: example_item.id, permission_id: permission.id) # => true
|
|
189
|
+
|
|
190
|
+
# Or from a specific drive
|
|
191
|
+
client.delete_permission(
|
|
192
|
+
drive_id: drive.id,
|
|
193
|
+
item_id: example_item.id,
|
|
194
|
+
permission_id: permission.id
|
|
195
|
+
) # => true
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Revoking Grants on a Permission (beta API)
|
|
199
|
+
|
|
200
|
+
Use `revoke_grants` to revoke specific grantees from an existing permission. This uses the Microsoft Graph **beta**
|
|
201
|
+
endpoint under the hood:
|
|
202
|
+
|
|
203
|
+
<https://learn.microsoft.com/en-us/graph/api/permission-revokegrants?view=graph-rest-beta>
|
|
204
|
+
|
|
205
|
+
Each grantee is a hash with **exactly one** of the following keys: `:email`, `:alias`, or `:objectId`.
|
|
206
|
+
|
|
207
|
+
```rb
|
|
208
|
+
permission = permissions.find { |p| p.is_a?(MicroslopOneDrive::Permissions::SharingLink) }
|
|
209
|
+
|
|
210
|
+
grantees = [
|
|
211
|
+
{email: "person@example.com"},
|
|
212
|
+
{objectId: "00000000-0000-0000-0000-000000000000"}
|
|
213
|
+
]
|
|
214
|
+
|
|
215
|
+
client.revoke_grants(
|
|
216
|
+
item_id: example_item.id,
|
|
217
|
+
permission_id: permission.id,
|
|
218
|
+
grantees: grantees
|
|
219
|
+
) # => true
|
|
220
|
+
```
|
|
221
|
+
|
|
179
222
|
### Checking if the user's accounts supports SharePoint Sites
|
|
180
223
|
|
|
181
224
|
```rb
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module MicroslopOneDrive
|
|
2
|
+
module Deserializers
|
|
3
|
+
class ApplicationDeserializer
|
|
4
|
+
def self.create_from_hash(application_hash)
|
|
5
|
+
return nil if application_hash.nil?
|
|
6
|
+
return nil if application_hash.empty?
|
|
7
|
+
|
|
8
|
+
application_hash = Utils.deep_symbolize_keys(application_hash)
|
|
9
|
+
|
|
10
|
+
MicroslopOneDrive::IdentitySets::Application.new(
|
|
11
|
+
id: application_hash.fetch(:id, nil),
|
|
12
|
+
display_name: application_hash.fetch(:displayName, nil)
|
|
13
|
+
)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module MicroslopOneDrive
|
|
2
|
+
module Deserializers
|
|
3
|
+
class BaseIdentitySetDeserializer
|
|
4
|
+
def self.create_from_hash(identity_set_hash)
|
|
5
|
+
MicroslopOneDrive::IdentitySets::BaseIdentitySet.new(
|
|
6
|
+
id: identity_set_hash.fetch(:id, nil),
|
|
7
|
+
display_name: identity_set_hash.fetch(:displayName, nil)
|
|
8
|
+
)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require_relative "application_deserializer"
|
|
2
|
+
require_relative "device_deserializer"
|
|
3
|
+
require_relative "drive_deserializer"
|
|
4
|
+
require_relative "drive_item_deserializer"
|
|
5
|
+
require_relative "group_deserializer"
|
|
6
|
+
require_relative "link_deserializer"
|
|
7
|
+
require_relative "parent_reference_deserializer"
|
|
8
|
+
require_relative "permission_deserializer"
|
|
9
|
+
require_relative "quota_deserializer"
|
|
10
|
+
require_relative "shared_with_me_item_deserializer"
|
|
11
|
+
require_relative "user_deserializer"
|
|
12
|
+
require_relative "base_identity_set_deserializer"
|
|
13
|
+
require_relative "identity_set_deserializer"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module MicroslopOneDrive
|
|
2
|
+
module Deserializers
|
|
3
|
+
class DeviceDeserializer
|
|
4
|
+
def self.create_from_hash(device_hash)
|
|
5
|
+
return nil if device_hash.nil?
|
|
6
|
+
return nil if device_hash.empty?
|
|
7
|
+
|
|
8
|
+
device_hash = Utils.deep_symbolize_keys(device_hash)
|
|
9
|
+
|
|
10
|
+
MicroslopOneDrive::IdentitySets::Device.new(
|
|
11
|
+
id: device_hash.fetch(:id, nil),
|
|
12
|
+
display_name: device_hash.fetch(:displayName, nil)
|
|
13
|
+
)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module MicroslopOneDrive
|
|
2
|
+
module Deserializers
|
|
3
|
+
class GroupDeserializer
|
|
4
|
+
def self.create_from_hash(group_hash)
|
|
5
|
+
return nil if group_hash.nil?
|
|
6
|
+
return nil if group_hash.empty?
|
|
7
|
+
|
|
8
|
+
group_hash = Utils.deep_symbolize_keys(group_hash)
|
|
9
|
+
|
|
10
|
+
MicroslopOneDrive::IdentitySets::Group.new(
|
|
11
|
+
id: group_hash.fetch(:id, nil),
|
|
12
|
+
display_name: group_hash.fetch(:displayName, nil)
|
|
13
|
+
)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module MicroslopOneDrive
|
|
2
|
+
module Deserializers
|
|
3
|
+
class IdentitySetDeserializer
|
|
4
|
+
TYPE_MAPPING = {
|
|
5
|
+
siteUser: UserDeserializer,
|
|
6
|
+
user: UserDeserializer,
|
|
7
|
+
application: ApplicationDeserializer,
|
|
8
|
+
group: GroupDeserializer,
|
|
9
|
+
siteGroup: GroupDeserializer,
|
|
10
|
+
device: DeviceDeserializer
|
|
11
|
+
}.freeze
|
|
12
|
+
|
|
13
|
+
def self.create_from_hash(identity_set_hash)
|
|
14
|
+
return nil if identity_set_hash.nil?
|
|
15
|
+
return nil if identity_set_hash.empty?
|
|
16
|
+
|
|
17
|
+
identity_set_hash = Utils.deep_symbolize_keys(identity_set_hash)
|
|
18
|
+
|
|
19
|
+
key, deserializer_class = TYPE_MAPPING.find { identity_set_hash.keys.include?(it.first) }
|
|
20
|
+
|
|
21
|
+
return BaseIdentitySetDeserializer.create_from_hash(identity_set_hash.values.first) if deserializer_class.nil?
|
|
22
|
+
|
|
23
|
+
deserializer_class.create_from_hash(identity_set_hash[key])
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -47,7 +47,7 @@ module MicroslopOneDrive
|
|
|
47
47
|
common_parameters = build_common_parameters(permission_hash)
|
|
48
48
|
|
|
49
49
|
granted_to_hash_list = permission_hash.fetch(:grantedToIdentitiesV2, [])
|
|
50
|
-
granted_to_list = granted_to_hash_list.map {
|
|
50
|
+
granted_to_list = granted_to_hash_list.map { IdentitySetDeserializer.create_from_hash(it) }.compact
|
|
51
51
|
|
|
52
52
|
has_password = permission_hash.fetch(:hasPassword, false)
|
|
53
53
|
|
|
@@ -67,7 +67,7 @@ module MicroslopOneDrive
|
|
|
67
67
|
common_parameters = build_common_parameters(permission_hash)
|
|
68
68
|
|
|
69
69
|
granted_to_hash = permission_hash.fetch(:grantedToV2, nil)
|
|
70
|
-
granted_to =
|
|
70
|
+
granted_to = IdentitySetDeserializer.create_from_hash(granted_to_hash)
|
|
71
71
|
|
|
72
72
|
MicroslopOneDrive::Permissions::DirectPermission.new(**common_parameters, granted_to: granted_to)
|
|
73
73
|
end
|
|
@@ -3,14 +3,14 @@ require "microslop_one_drive/utils"
|
|
|
3
3
|
module MicroslopOneDrive
|
|
4
4
|
module Deserializers
|
|
5
5
|
class UserDeserializer
|
|
6
|
-
# Creates a new User object from a hash.
|
|
6
|
+
# Creates a new User identity (IdentitySet user) object from a hash.
|
|
7
7
|
#
|
|
8
8
|
# @param user_hash [Hash] The hash to create the User object from.
|
|
9
|
-
# @return [MicroslopOneDrive::User] The created User object.
|
|
9
|
+
# @return [MicroslopOneDrive::IdentitySets::User] The created User object.
|
|
10
10
|
def self.create_from_hash(user_hash)
|
|
11
11
|
user_hash = Utils.deep_symbolize_keys(user_hash)
|
|
12
12
|
|
|
13
|
-
User.new(
|
|
13
|
+
MicroslopOneDrive::IdentitySets::User.new(
|
|
14
14
|
id: user_hash.fetch(:id, nil),
|
|
15
15
|
principal_name: user_hash.fetch(:userPrincipalName, nil),
|
|
16
16
|
display_name: user_hash.fetch(:displayName, nil),
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require_relative "me"
|
|
2
|
+
require_relative "drive"
|
|
3
|
+
require_relative "all_drives"
|
|
4
|
+
require_relative "drive_exists"
|
|
5
|
+
require_relative "drive_item"
|
|
6
|
+
require_relative "drive_item_exists"
|
|
7
|
+
require_relative "delta"
|
|
8
|
+
require_relative "permissions"
|
|
9
|
+
require_relative "batch"
|
|
10
|
+
require_relative "batch_permissions"
|
|
11
|
+
require_relative "delete_permission"
|
|
12
|
+
require_relative "supports_sites"
|
|
13
|
+
require_relative "revoke_grants"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require_relative "client_error"
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
module MicroslopOneDrive
|
|
2
|
+
module IdentitySets
|
|
3
|
+
class User < BaseIdentitySet
|
|
4
|
+
attr_reader :principal_name, :surname, :given_name, :preferred_language, :mail, :mobile_phone,
|
|
5
|
+
:job_title, :office_location, :business_phones, :login_name
|
|
6
|
+
|
|
7
|
+
def initialize(
|
|
8
|
+
principal_name: nil,
|
|
9
|
+
id: nil,
|
|
10
|
+
display_name: nil,
|
|
11
|
+
surname: nil,
|
|
12
|
+
given_name: nil,
|
|
13
|
+
preferred_language: nil,
|
|
14
|
+
mail: nil,
|
|
15
|
+
mobile_phone: nil,
|
|
16
|
+
job_title: nil,
|
|
17
|
+
office_location: nil,
|
|
18
|
+
business_phones: [],
|
|
19
|
+
login_name: nil
|
|
20
|
+
)
|
|
21
|
+
super(id: id, display_name: display_name)
|
|
22
|
+
@principal_name = principal_name
|
|
23
|
+
@surname = surname
|
|
24
|
+
@given_name = given_name
|
|
25
|
+
@preferred_language = preferred_language
|
|
26
|
+
@mail = mail
|
|
27
|
+
@mobile_phone = mobile_phone
|
|
28
|
+
@job_title = job_title
|
|
29
|
+
@office_location = office_location
|
|
30
|
+
@business_phones = business_phones
|
|
31
|
+
@login_name = login_name
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def email
|
|
35
|
+
@mail
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def email_address
|
|
39
|
+
@mail
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def last_name
|
|
43
|
+
@surname
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
data/lib/microslop_one_drive.rb
CHANGED
|
@@ -1,64 +1,26 @@
|
|
|
1
1
|
require "httparty"
|
|
2
2
|
require "json"
|
|
3
3
|
|
|
4
|
+
# Utilities
|
|
4
5
|
require_relative "microslop_one_drive/version"
|
|
5
6
|
require_relative "microslop_one_drive/utils"
|
|
7
|
+
require_relative "microslop_one_drive/deserializers/deserializers"
|
|
6
8
|
|
|
7
|
-
#
|
|
8
|
-
require_relative "microslop_one_drive/deserializers/user_deserializer"
|
|
9
|
-
require_relative "microslop_one_drive/deserializers/drive_deserializer"
|
|
10
|
-
require_relative "microslop_one_drive/deserializers/quota_deserializer"
|
|
11
|
-
require_relative "microslop_one_drive/deserializers/drive_item_deserializer"
|
|
12
|
-
require_relative "microslop_one_drive/deserializers/parent_reference_deserializer"
|
|
13
|
-
require_relative "microslop_one_drive/deserializers/shared_with_me_item_deserializer"
|
|
14
|
-
require_relative "microslop_one_drive/deserializers/permission_deserializer"
|
|
15
|
-
require_relative "microslop_one_drive/deserializers/link_deserializer"
|
|
16
|
-
require_relative "microslop_one_drive/deserializers/granted_to_deserializer"
|
|
17
|
-
|
|
18
|
-
# Drive items
|
|
9
|
+
# Models
|
|
19
10
|
require_relative "microslop_one_drive/file"
|
|
20
11
|
require_relative "microslop_one_drive/folder"
|
|
21
12
|
require_relative "microslop_one_drive/root_folder"
|
|
22
13
|
require_relative "microslop_one_drive/drive_item"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
require_relative "microslop_one_drive/
|
|
26
|
-
require_relative "microslop_one_drive/list_responses/drive_list"
|
|
27
|
-
require_relative "microslop_one_drive/list_responses/drive_item_list"
|
|
28
|
-
require_relative "microslop_one_drive/list_responses/permission_list"
|
|
29
|
-
require_relative "microslop_one_drive/list_responses/shared_with_me_list"
|
|
30
|
-
|
|
31
|
-
# Batch
|
|
32
|
-
require_relative "microslop_one_drive/batch/batch_response"
|
|
33
|
-
require_relative "microslop_one_drive/batch/response"
|
|
34
|
-
|
|
35
|
-
# Other models
|
|
36
|
-
require_relative "microslop_one_drive/user"
|
|
14
|
+
require_relative "microslop_one_drive/list_responses/list_responses"
|
|
15
|
+
require_relative "microslop_one_drive/batch/batch"
|
|
16
|
+
require_relative "microslop_one_drive/identity_sets/identity_sets"
|
|
37
17
|
require_relative "microslop_one_drive/parent_reference"
|
|
38
18
|
require_relative "microslop_one_drive/drive"
|
|
39
19
|
require_relative "microslop_one_drive/quota"
|
|
40
20
|
require_relative "microslop_one_drive/shared_with_me_item"
|
|
41
|
-
require_relative "microslop_one_drive/permissions/
|
|
42
|
-
require_relative "microslop_one_drive/permissions/direct_permission"
|
|
43
|
-
require_relative "microslop_one_drive/permissions/sharing_link"
|
|
44
|
-
require_relative "microslop_one_drive/permissions/sharing_invitation"
|
|
45
|
-
require_relative "microslop_one_drive/permissions/link"
|
|
46
|
-
|
|
47
|
-
# Endpoints
|
|
48
|
-
require_relative "microslop_one_drive/endpoints/me"
|
|
49
|
-
require_relative "microslop_one_drive/endpoints/drive"
|
|
50
|
-
require_relative "microslop_one_drive/endpoints/all_drives"
|
|
51
|
-
require_relative "microslop_one_drive/endpoints/drive_exists"
|
|
52
|
-
require_relative "microslop_one_drive/endpoints/drive_item"
|
|
53
|
-
require_relative "microslop_one_drive/endpoints/drive_item_exists"
|
|
54
|
-
require_relative "microslop_one_drive/endpoints/delta"
|
|
55
|
-
require_relative "microslop_one_drive/endpoints/permissions"
|
|
56
|
-
require_relative "microslop_one_drive/endpoints/batch"
|
|
57
|
-
require_relative "microslop_one_drive/endpoints/batch_permissions"
|
|
58
|
-
require_relative "microslop_one_drive/endpoints/delete_permission"
|
|
59
|
-
require_relative "microslop_one_drive/endpoints/supports_sites"
|
|
60
|
-
require_relative "microslop_one_drive/endpoints/revoke_grants"
|
|
21
|
+
require_relative "microslop_one_drive/permissions/permissions"
|
|
61
22
|
|
|
62
23
|
# Client
|
|
63
|
-
require_relative "microslop_one_drive/
|
|
24
|
+
require_relative "microslop_one_drive/endpoints/endpoints"
|
|
25
|
+
require_relative "microslop_one_drive/errors/errors"
|
|
64
26
|
require_relative "microslop_one_drive/client"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: microslop_one_drive
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 6.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bradley Marques
|
|
@@ -33,12 +33,18 @@ extra_rdoc_files: []
|
|
|
33
33
|
files:
|
|
34
34
|
- README.md
|
|
35
35
|
- lib/microslop_one_drive.rb
|
|
36
|
+
- lib/microslop_one_drive/batch/batch.rb
|
|
36
37
|
- lib/microslop_one_drive/batch/batch_response.rb
|
|
37
38
|
- lib/microslop_one_drive/batch/response.rb
|
|
38
39
|
- lib/microslop_one_drive/client.rb
|
|
40
|
+
- lib/microslop_one_drive/deserializers/application_deserializer.rb
|
|
41
|
+
- lib/microslop_one_drive/deserializers/base_identity_set_deserializer.rb
|
|
42
|
+
- lib/microslop_one_drive/deserializers/deserializers.rb
|
|
43
|
+
- lib/microslop_one_drive/deserializers/device_deserializer.rb
|
|
39
44
|
- lib/microslop_one_drive/deserializers/drive_deserializer.rb
|
|
40
45
|
- lib/microslop_one_drive/deserializers/drive_item_deserializer.rb
|
|
41
|
-
- lib/microslop_one_drive/deserializers/
|
|
46
|
+
- lib/microslop_one_drive/deserializers/group_deserializer.rb
|
|
47
|
+
- lib/microslop_one_drive/deserializers/identity_set_deserializer.rb
|
|
42
48
|
- lib/microslop_one_drive/deserializers/link_deserializer.rb
|
|
43
49
|
- lib/microslop_one_drive/deserializers/parent_reference_deserializer.rb
|
|
44
50
|
- lib/microslop_one_drive/deserializers/permission_deserializer.rb
|
|
@@ -56,28 +62,37 @@ files:
|
|
|
56
62
|
- lib/microslop_one_drive/endpoints/drive_exists.rb
|
|
57
63
|
- lib/microslop_one_drive/endpoints/drive_item.rb
|
|
58
64
|
- lib/microslop_one_drive/endpoints/drive_item_exists.rb
|
|
65
|
+
- lib/microslop_one_drive/endpoints/endpoints.rb
|
|
59
66
|
- lib/microslop_one_drive/endpoints/me.rb
|
|
60
67
|
- lib/microslop_one_drive/endpoints/permissions.rb
|
|
61
68
|
- lib/microslop_one_drive/endpoints/revoke_grants.rb
|
|
62
69
|
- lib/microslop_one_drive/endpoints/supports_sites.rb
|
|
63
70
|
- lib/microslop_one_drive/errors/client_error.rb
|
|
71
|
+
- lib/microslop_one_drive/errors/errors.rb
|
|
64
72
|
- lib/microslop_one_drive/file.rb
|
|
65
73
|
- lib/microslop_one_drive/folder.rb
|
|
74
|
+
- lib/microslop_one_drive/identity_sets/application.rb
|
|
75
|
+
- lib/microslop_one_drive/identity_sets/base_identity_set.rb
|
|
76
|
+
- lib/microslop_one_drive/identity_sets/device.rb
|
|
77
|
+
- lib/microslop_one_drive/identity_sets/group.rb
|
|
78
|
+
- lib/microslop_one_drive/identity_sets/identity_sets.rb
|
|
79
|
+
- lib/microslop_one_drive/identity_sets/user.rb
|
|
66
80
|
- lib/microslop_one_drive/list_responses/drive_item_list.rb
|
|
67
81
|
- lib/microslop_one_drive/list_responses/drive_list.rb
|
|
68
82
|
- lib/microslop_one_drive/list_responses/list_response.rb
|
|
83
|
+
- lib/microslop_one_drive/list_responses/list_responses.rb
|
|
69
84
|
- lib/microslop_one_drive/list_responses/permission_list.rb
|
|
70
85
|
- lib/microslop_one_drive/list_responses/shared_with_me_list.rb
|
|
71
86
|
- lib/microslop_one_drive/parent_reference.rb
|
|
72
87
|
- lib/microslop_one_drive/permissions/base_permission.rb
|
|
73
88
|
- lib/microslop_one_drive/permissions/direct_permission.rb
|
|
74
89
|
- lib/microslop_one_drive/permissions/link.rb
|
|
90
|
+
- lib/microslop_one_drive/permissions/permissions.rb
|
|
75
91
|
- lib/microslop_one_drive/permissions/sharing_invitation.rb
|
|
76
92
|
- lib/microslop_one_drive/permissions/sharing_link.rb
|
|
77
93
|
- lib/microslop_one_drive/quota.rb
|
|
78
94
|
- lib/microslop_one_drive/root_folder.rb
|
|
79
95
|
- lib/microslop_one_drive/shared_with_me_item.rb
|
|
80
|
-
- lib/microslop_one_drive/user.rb
|
|
81
96
|
- lib/microslop_one_drive/utils.rb
|
|
82
97
|
- lib/microslop_one_drive/version.rb
|
|
83
98
|
homepage: https://github.com/bradleymarques/microslop_one_drive
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
module MicroslopOneDrive
|
|
2
|
-
module Deserializers
|
|
3
|
-
class GrantedToDeserializer
|
|
4
|
-
def self.create_from_hash(granted_to_hash)
|
|
5
|
-
return nil if granted_to_hash.nil?
|
|
6
|
-
return nil if granted_to_hash.empty?
|
|
7
|
-
|
|
8
|
-
granted_to_hash = Utils.deep_symbolize_keys(granted_to_hash)
|
|
9
|
-
|
|
10
|
-
if granted_to_hash.key?(:siteUser)
|
|
11
|
-
UserDeserializer.create_from_hash(granted_to_hash[:siteUser])
|
|
12
|
-
elsif granted_to_hash.key?(:group)
|
|
13
|
-
raise NotImplementedError, "Group permissions are not supported yet"
|
|
14
|
-
else
|
|
15
|
-
raise NotImplementedError, "Unknown granted to type for hash: #{granted_to_hash.inspect}"
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
module MicroslopOneDrive
|
|
2
|
-
class User
|
|
3
|
-
attr_reader :principal_name, :id, :display_name, :surname, :given_name, :preferred_language, :mail, :mobile_phone,
|
|
4
|
-
:job_title, :office_location, :business_phones, :login_name
|
|
5
|
-
|
|
6
|
-
def initialize(
|
|
7
|
-
principal_name: nil,
|
|
8
|
-
id: nil,
|
|
9
|
-
display_name: nil,
|
|
10
|
-
surname: nil,
|
|
11
|
-
given_name: nil,
|
|
12
|
-
preferred_language: nil,
|
|
13
|
-
mail: nil,
|
|
14
|
-
mobile_phone: nil,
|
|
15
|
-
job_title: nil,
|
|
16
|
-
office_location: nil,
|
|
17
|
-
business_phones: [],
|
|
18
|
-
login_name: nil
|
|
19
|
-
)
|
|
20
|
-
@principal_name = principal_name
|
|
21
|
-
@id = id
|
|
22
|
-
@display_name = display_name
|
|
23
|
-
@surname = surname
|
|
24
|
-
@given_name = given_name
|
|
25
|
-
@preferred_language = preferred_language
|
|
26
|
-
@mail = mail
|
|
27
|
-
@mobile_phone = mobile_phone
|
|
28
|
-
@job_title = job_title
|
|
29
|
-
@office_location = office_location
|
|
30
|
-
@business_phones = business_phones
|
|
31
|
-
@login_name = login_name
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def email
|
|
35
|
-
@mail
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def email_address
|
|
39
|
-
@mail
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
def last_name
|
|
43
|
-
@surname
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
end
|