microslop_one_drive 5.0.0 → 5.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c456959cfd4fbe8f15976c434467f540fce7a38187f26d4142227516fa71826e
4
- data.tar.gz: e75f721e545a657b399840247c4a04721c8b407148edfb8ffc9feeeaf95c5408
3
+ metadata.gz: 3888f96cecbe9314e50eb6808fbd53af0ec0115905ac06c9c034abbee0871cf9
4
+ data.tar.gz: 9efebc0e59d585e66e8bc7778f593d4e299dafe37e7497319fb71a4bb928a8a7
5
5
  SHA512:
6
- metadata.gz: bc8051606e48ce9e91b09108965645a87acb0c90d61a8eef0255858d060efd08b02dff8507ab6b91f8140fa20896ad445039d0b33c1848ca307175dbb2b87353
7
- data.tar.gz: 557535418c4488950a39ef2b063010531b59888357aa0fae89bbf42c6c73f07667bb716588ace852a95d65bf245079d8e48616d8d82bcd6f932d200a5a88a0e9
6
+ metadata.gz: bc24edeb9829b2c982d6c629f82bd1d6a884fe90476bfa8cc9c49948b30c9f25bde0fe3bda934607aab8f1f64d993e3da7d68e8f363849a4a29af4e026b10b77
7
+ data.tar.gz: 6275971239665720766eff7629b3bfc3b375844a5f3f15f1b6c8c29569590730f3a8410c17bbdfbdd18ea54ae9cc53766ba055b97c7479ac3f6428db22b7ede5
@@ -16,6 +16,7 @@ module MicroslopOneDrive
16
16
  include Endpoints::BatchPermissions
17
17
  include Endpoints::SupportsSites
18
18
  include Endpoints::DeletePermission
19
+ include Endpoints::RevokeGrants
19
20
 
20
21
  # @param access_token [String] OAuth access token for Microsoft Graph.
21
22
  # @param logger [Object, nil] Optional logger (e.g. Rails.logger) that responds to +#info+, +#debug+, +#warn+, +#error+.
@@ -0,0 +1,30 @@
1
+ module MicroslopOneDrive
2
+ module Endpoints
3
+ module RevokeGrants
4
+ # Revokes a grant from a drive item.
5
+ #
6
+ # NOTE: This is from the beta version of the OneDrive API.
7
+ # https://learn.microsoft.com/en-us/graph/api/permission-revokegrants
8
+ #
9
+ # @param item_id [String] The ID of the DriveItem to revoke the grant from.
10
+ # @param permission_id [String] The ID of the Permission to revoke.
11
+ # @param grantees [Array<Hash>] The grantees to revoke the grant from. Each grantee should be a hash with one
12
+ # (and only one) of the following keys:
13
+ #
14
+ # - email: The email address of the grantee.
15
+ # - alias: The alias of the grantee.
16
+ # - objectId: The object ID of the grantee.
17
+ #
18
+ # @return [boolean] True if successful, else raises an error.
19
+ def revoke_grants(item_id:, permission_id:, grantees:)
20
+ url = "me/drive/items/#{item_id}/permissions/#{permission_id}/revokeGrants"
21
+
22
+ response = post(path: url, body: {grantees: grantees}.to_json)
23
+
24
+ return true if response.success?
25
+
26
+ handle_error(response)
27
+ end
28
+ end
29
+ end
30
+ end
@@ -1,3 +1,3 @@
1
1
  module MicroslopOneDrive
2
- VERSION = "5.0.0".freeze
2
+ VERSION = "5.1.0".freeze
3
3
  end
@@ -57,6 +57,7 @@ require_relative "microslop_one_drive/endpoints/batch"
57
57
  require_relative "microslop_one_drive/endpoints/batch_permissions"
58
58
  require_relative "microslop_one_drive/endpoints/delete_permission"
59
59
  require_relative "microslop_one_drive/endpoints/supports_sites"
60
+ require_relative "microslop_one_drive/endpoints/revoke_grants"
60
61
 
61
62
  # Client
62
63
  require_relative "microslop_one_drive/errors/client_error"
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: 5.0.0
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bradley Marques
@@ -58,6 +58,7 @@ files:
58
58
  - lib/microslop_one_drive/endpoints/drive_item_exists.rb
59
59
  - lib/microslop_one_drive/endpoints/me.rb
60
60
  - lib/microslop_one_drive/endpoints/permissions.rb
61
+ - lib/microslop_one_drive/endpoints/revoke_grants.rb
61
62
  - lib/microslop_one_drive/endpoints/supports_sites.rb
62
63
  - lib/microslop_one_drive/errors/client_error.rb
63
64
  - lib/microslop_one_drive/file.rb