Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[#66697] Sharepoint Rename File Command

Pavel Balashoudbb7decb1081
diff --git a/modules/storages/app/common/storages/adapters/providers/sharepoint/commands/rename_file_command.rb b/modules/storages/app/common/storages/adapters/providers/sharepoint/commands/rename_file_command.rb
new file mode 100644
index 00000000000..adbfc6f85d2
--- /dev/null
+++ b/modules/storages/app/common/storages/adapters/providers/sharepoint/commands/rename_file_command.rb
@@ -0,0 +1,83 @@
+# frozen_string_literal: true
+
+#-- copyright
+# OpenProject is an open source project management software.
+# Copyright (C) the OpenProject GmbH
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version 3.
+#
+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+# Copyright (C) 2010-2013 the ChiliProject Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See COPYRIGHT and LICENSE files for more details.
+#++
+
+module Storages
+ module Adapters
+ module Providers
+ module Sharepoint
+ module Commands
+ class RenameFileCommand < Base
+ def call(auth_strategy:, input_data:)
+ with_tagged_logger do
+ split_identifier(input_data.location) => { drive_id:, location: item_id }
+ info "Renaming file: #{input_data.inspect}"
+ Authentication[auth_strategy].call(storage: @storage) do |http|
+ handle_response(
+ http.patch(
+ UrlBuilder.url(
+ base_uri,
+ "/v1.0/drives",
+ drive_id,
+ "items",
+ item_id
+ ),
+ json: { name: input_data.new_name }
+ )
+ )
+ end
+ end
+ end
+
+ private
+
+ def handle_response(response)
+ error = Results::Error.new(source: self.class, payload: response)
+
+ case response
+ in { status: 200..299 }
+ StorageFileTransformer.new(site_name).transform(response.json(symbolize_keys: true))
+ in { status: 401 }
+ Failure(error.with(code: :unauthorized))
+ in { status: 403 }
+ Failure(error.with(code: :forbidden))
+ in { status: 404 }
+ Failure(error.with(code: :not_found))
+ in { status: 409 }
+ Failure(error.with(code: :conflict))
+ else
+ Failure(error.with(code: :error))
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/modules/storages/app/common/storages/adapters/providers/sharepoint/sharepoint_registry.rb b/modules/storages/app/common/storages/adapters/providers/sharepoint/sharepoint_registry.rb
index ef6f338cb97..f133983ab2e 100644
--- a/modules/storages/app/common/storages/adapters/providers/sharepoint/sharepoint_registry.rb
+++ b/modules/storages/app/common/storages/adapters/providers/sharepoint/sharepoint_registry.rb
@@ -41,6 +41,7 @@ module Storages
namespace("commands") do
register(:create_folder, Commands::CreateFolderCommand)
register(:delete_folder, Commands::DeleteFolderCommand)
+ register(:rename_file, Commands::RenameFileCommand)
end
namespace("components") do
diff --git a/modules/storages/spec/common/storages/adapters/providers/sharepoint/commands/rename_file_command_spec.rb b/modules/storages/spec/common/storages/adapters/providers/sharepoint/commands/rename_file_command_spec.rb
new file mode 100644
index 00000000000..688f53a3a38
--- /dev/null
+++ b/modules/storages/spec/common/storages/adapters/providers/sharepoint/commands/rename_file_command_spec.rb
@@ -0,0 +1,73 @@
+# frozen_string_literal: true
+
+#-- copyright
+# OpenProject is an open source project management software.
+# Copyright (C) the OpenProject GmbH
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version 3.
+#
+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+# Copyright (C) 2010-2013 the ChiliProject Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See COPYRIGHT and LICENSE files for more details.
+#++
+
+require "spec_helper"
+require_module_spec_helper
+
+module Storages
+ module Adapters
+ module Providers
+ module Sharepoint
+ module Commands
+ RSpec.describe RenameFileCommand, :webmock do
+ let(:storage) { create(:sharepoint_storage, :sandbox) }
+ let(:auth_strategy) { Registry.resolve("sharepoint.authentication.userless").call }
+ let(:input_data) { Input::RenameFile.build(location: file_id, new_name: name).value! }
+ let(:base_drive) { "b!FeOZEMfQx0eGQKqVBLcP__BG8mq-4-9FuRqOyk3MXY8CfNaHr_0ERYs5kgmEWFrX" }
+
+ it_behaves_like "adapter rename_file_command: basic command setup"
+
+ context "when renaming a folder", vcr: "sharepoint/rename_file_success" do
+ let(:file_id) { "#{base_drive}:01ANJ53W7XPDQZRCOJK5CJC2M72EB6WKEG" }
+ let(:name) { "I am the senat" }
+
+ it_behaves_like "adapter rename_file_command: successful file renaming"
+ end
+
+ context "when renaming a file inside a subdirectory", vcr: "sharepoint/rename_file_with_location_success" do
+ let(:file_id) { "#{base_drive}:01ANJ53W5WDLAMJBIRRVD3PK2MNCSGTJVD" }
+ let(:name) { "I❤️you death star.png" }
+
+ it_behaves_like "adapter rename_file_command: successful file renaming"
+ end
+
+ context "when trying to rename a not existent file", vcr: "sharepoint/rename_file_not_found" do
+ let(:file_id) { "#{base_drive}:sith_have_yellow_light_sabers" }
+ let(:name) { "this_will_not_happen.png" }
+ let(:error_source) { described_class }
+
+ it_behaves_like "adapter rename_file_command: not found"
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/modules/storages/spec/support/fixtures/vcr_cassettes/sharepoint/rename_file_not_found.yml b/modules/storages/spec/support/fixtures/vcr_cassettes/sharepoint/rename_file_not_found.yml
new file mode 100644
index 00000000000..db07acc94a5
--- /dev/null
+++ b/modules/storages/spec/support/fixtures/vcr_cassettes/sharepoint/rename_file_not_found.yml
@@ -0,0 +1,119 @@
+---
+http_interactions:
+- request:
+ method: post
+ uri: https://login.microsoftonline.com/e36f1dbc-fdae-427e-b61b-0d96ddfb81a4/oauth2/v2.0/token
+ body:
+ encoding: ASCII-8BIT
+ string: grant_type=client_credentials&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default+offline_access&client_id=404e0567-19a1-4a64-b2d1-d3b0c99f2ed9&client_secret=QRB8Q%7Ei.1rID_.MC9FTfRGq-FTE5SgWYsoeLacWf
+ headers:
+ User-Agent:
+ - httpx.rb/1.6.1
+ Accept:
+ - "*/*"
+ Accept-Encoding:
+ - gzip, deflate
+ Content-Type:
+ - application/x-www-form-urlencoded
+ Content-Length:
+ - '199'
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Cache-Control:
+ - no-store, no-cache
+ Pragma:
+ - no-cache
+ Content-Type:
+ - application/json; charset=utf-8
+ Expires:
+ - "-1"
+ Strict-Transport-Security:
+ - max-age=31536000; includeSubDomains
+ X-Content-Type-Options:
+ - nosniff
+ P3p:
+ - CP="DSP CUR OTPi IND OTRi ONL FIN"
+ X-Ms-Request-Id:
+ - 1958fd8f-cf47-4a3e-a11f-828e7add7600
+ X-Ms-Ests-Server:
+ - 2.1.21950.4 - WEULR1 ProdSlices
+ X-Ms-Srs:
+ - 1.P
+ Content-Security-Policy-Report-Only:
+ - object-src 'none'; base-uri 'self'; script-src 'self' 'nonce-tE1gHC0eenDVYfA-1io21Q'
+ 'unsafe-inline' 'unsafe-eval' https://*.msauth.net https://*.msftauth.net
+ https://*.msftauthimages.net https://*.msauthimages.net https://*.msidentity.com
+ https://*.microsoftonline-p.com https://*.microsoftazuread-sso.com https://*.azureedge.net
+ https://*.outlook.com https://*.office.com https://*.office365.com https://*.microsoft.com
+ https://*.bing.com 'report-sample'; report-uri https://csp.microsoft.com/report/ESTS-UX-All
+ Cross-Origin-Opener-Policy-Report-Only:
+ - same-origin; report-to="coop-endpoint"
+ Reporting-Endpoints:
+ - coop-endpoint="https://idux.azurewebsites.net/api/coopReport"
+ X-Xss-Protection:
+ - '0'
+ Set-Cookie:
+ - fpc=Ank1x6NXGP1Akxd5HwUH1UxZ-dCOAQAAAC-7beAOAAAA; expires=Thu, 30-Oct-2025
+ 11:51:12 GMT; path=/; secure; HttpOnly; SameSite=None, x-ms-gateway-slice=estsfd;
+ path=/; secure; samesite=none; httponly, stsservicecookie=estsfd; path=/;
+ secure; samesite=none; httponly
+ Date:
+ - Tue, 30 Sep 2025 11:51:11 GMT
+ Content-Length:
+ - '1932'
+ body:
+ encoding: UTF-8
+ string: '{"token_type":"Bearer","expires_in":3599,"ext_expires_in":3599,"access_token":"<ACCESS_TOKEN>"}'
+ recorded_at: Tue, 30 Sep 2025 11:51:12 GMT
+- request:
+ method: patch
+ uri: https://graph.microsoft.com/v1.0/drives/b!FeOZEMfQx0eGQKqVBLcP__BG8mq-4-9FuRqOyk3MXY8CfNaHr_0ERYs5kgmEWFrX/items/sith_have_yellow_light_sabers
+ body:
+ encoding: UTF-8
+ string: '{"name":"this_will_not_happen.png"}'
+ headers:
+ User-Agent:
+ - httpx.rb/1.6.1
+ Accept:
+ - "*/*"
+ Accept-Encoding:
+ - gzip, deflate
+ Content-Type:
+ - application/json; charset=utf-8
+ Content-Length:
+ - '35'
+ Authorization:
+ - Bearer <BEARER TOKEN>
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Cache-Control:
+ - no-store, no-cache
+ Content-Type:
+ - application/json
+ Content-Encoding:
+ - gzip
+ Vary:
+ - Accept-Encoding
+ Strict-Transport-Security:
+ - max-age=31536000
+ Request-Id:
+ - d38ffb1e-21d2-4fba-b5a5-3e3f96b580f0
+ Client-Request-Id:
+ - d38ffb1e-21d2-4fba-b5a5-3e3f96b580f0
+ X-Ms-Ags-Diagnostic:
+ - '{"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"4","ScaleUnit":"006","RoleInstance":"FR1PEPF00001FC5"}}'
+ Splogid:
+ - 33cacaa1-3047-0000-83a4-ae8b2e5d581b
+ Date:
+ - Tue, 30 Sep 2025 11:51:11 GMT
+ body:
+ encoding: UTF-8
+ string: '{"error":{"code":"itemNotFound","message":"Item not found","innerError":{"date":"2025-09-30T11:51:12","request-id":"d38ffb1e-21d2-4fba-b5a5-3e3f96b580f0","client-request-id":"d38ffb1e-21d2-4fba-b5a5-3e3f96b580f0"}}}'
+ recorded_at: Tue, 30 Sep 2025 11:51:12 GMT
+recorded_with: VCR 6.3.1
diff --git a/modules/storages/spec/support/fixtures/vcr_cassettes/sharepoint/rename_file_success.yml b/modules/storages/spec/support/fixtures/vcr_cassettes/sharepoint/rename_file_success.yml
new file mode 100644
index 00000000000..07d8f7646f0
--- /dev/null
+++ b/modules/storages/spec/support/fixtures/vcr_cassettes/sharepoint/rename_file_success.yml
@@ -0,0 +1,124 @@
+---
+http_interactions:
+- request:
+ method: post
+ uri: https://login.microsoftonline.com/e36f1dbc-fdae-427e-b61b-0d96ddfb81a4/oauth2/v2.0/token
+ body:
+ encoding: ASCII-8BIT
+ string: grant_type=client_credentials&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default+offline_access&client_id=404e0567-19a1-4a64-b2d1-d3b0c99f2ed9&client_secret=QRB8Q%7Ei.1rID_.MC9FTfRGq-FTE5SgWYsoeLacWf
+ headers:
+ User-Agent:
+ - httpx.rb/1.6.1
+ Accept:
+ - "*/*"
+ Accept-Encoding:
+ - gzip, deflate
+ Content-Type:
+ - application/x-www-form-urlencoded
+ Content-Length:
+ - '199'
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Cache-Control:
+ - no-store, no-cache
+ Pragma:
+ - no-cache
+ Content-Type:
+ - application/json; charset=utf-8
+ Expires:
+ - "-1"
+ Strict-Transport-Security:
+ - max-age=31536000; includeSubDomains
+ X-Content-Type-Options:
+ - nosniff
+ P3p:
+ - CP="DSP CUR OTPi IND OTRi ONL FIN"
+ X-Ms-Request-Id:
+ - e1a449bc-ea00-49ff-b15e-6edb00bf0800
+ X-Ms-Ests-Server:
+ - 2.1.21950.4 - SEC ProdSlices
+ X-Ms-Srs:
+ - 1.P
+ Content-Security-Policy-Report-Only:
+ - object-src 'none'; base-uri 'self'; script-src 'self' 'nonce-Bgq1rdxMfzPwHaYaR8jd4w'
+ 'unsafe-inline' 'unsafe-eval' https://*.msauth.net https://*.msftauth.net
+ https://*.msftauthimages.net https://*.msauthimages.net https://*.msidentity.com
+ https://*.microsoftonline-p.com https://*.microsoftazuread-sso.com https://*.azureedge.net
+ https://*.outlook.com https://*.office.com https://*.office365.com https://*.microsoft.com
+ https://*.bing.com 'report-sample'; report-uri https://csp.microsoft.com/report/ESTS-UX-All
+ Cross-Origin-Opener-Policy-Report-Only:
+ - same-origin; report-to="coop-endpoint"
+ Reporting-Endpoints:
+ - coop-endpoint="https://idux.azurewebsites.net/api/coopReport"
+ X-Xss-Protection:
+ - '0'
+ Set-Cookie:
+ - fpc=AkQEV5DyHpVKv714NceT3ntZ-dCOAQAAAC27beAOAAAA; expires=Thu, 30-Oct-2025
+ 11:51:10 GMT; path=/; secure; HttpOnly; SameSite=None, x-ms-gateway-slice=estsfd;
+ path=/; secure; samesite=none; httponly, stsservicecookie=estsfd; path=/;
+ secure; samesite=none; httponly
+ Date:
+ - Tue, 30 Sep 2025 11:51:09 GMT
+ Content-Length:
+ - '1932'
+ body:
+ encoding: UTF-8
+ string: '{"token_type":"Bearer","expires_in":3599,"ext_expires_in":3599,"access_token":"<ACCESS_TOKEN>"}'
+ recorded_at: Tue, 30 Sep 2025 11:51:10 GMT
+- request:
+ method: patch
+ uri: https://graph.microsoft.com/v1.0/drives/b!FeOZEMfQx0eGQKqVBLcP__BG8mq-4-9FuRqOyk3MXY8CfNaHr_0ERYs5kgmEWFrX/items/01ANJ53W7XPDQZRCOJK5CJC2M72EB6WKEG
+ body:
+ encoding: UTF-8
+ string: '{"name":"I am the senat"}'
+ headers:
+ User-Agent:
+ - httpx.rb/1.6.1
+ Accept:
+ - "*/*"
+ Accept-Encoding:
+ - gzip, deflate
+ Content-Type:
+ - application/json; charset=utf-8
+ Content-Length:
+ - '25'
+ Authorization:
+ - Bearer <BEARER TOKEN>
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Cache-Control:
+ - no-store, no-cache
+ Content-Type:
+ - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8
+ Content-Encoding:
+ - gzip
+ Vary:
+ - Accept-Encoding
+ Strict-Transport-Security:
+ - max-age=31536000
+ Request-Id:
+ - fd76c550-66fc-448e-9c40-bad7af489058
+ Client-Request-Id:
+ - fd76c550-66fc-448e-9c40-bad7af489058
+ X-Ms-Ags-Diagnostic:
+ - '{"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"4","ScaleUnit":"006","RoleInstance":"FR1PEPF000044A1"}}'
+ Splogid:
+ - 32cacaa1-30c8-0000-8a5a-60e7285579da
+ Odata-Version:
+ - '4.0'
+ Date:
+ - Tue, 30 Sep 2025 11:51:09 GMT
+ body:
+ encoding: UTF-8
+ string: '{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#drives(''b%21FeOZEMfQx0eGQKqVBLcP__BG8mq-4-9FuRqOyk3MXY8CfNaHr_0ERYs5kgmEWFrX'')/items/$entity","createdDateTime":"2025-09-23T11:12:56Z","eTag":"\"{98E178F7-C989-4457-9169-9FD103EB2886},2\"","id":"01ANJ53W7XPDQZRCOJK5CJC2M72EB6WKEG","lastModifiedDateTime":"2025-09-30T11:47:40Z","name":"I
+ am the senat","webUrl":"https://ymt6d.sharepoint.com/sites/OPTest/Marcello%20AMPF/I%20am%20the%20senat","cTag":"\"c:{98E178F7-C989-4457-9169-9FD103EB2886},0\"","size":331555,"createdBy":{"user":{"email":"[email protected]","id":"5b5a7dc4-4539-41ba-9fa9-100f0a26acb7","displayName":"Eric
+ Schubert"}},"lastModifiedBy":{"user":{"displayName":"SharePoint App"}},"parentReference":{"driveType":"documentLibrary","driveId":"b!FeOZEMfQx0eGQKqVBLcP__BG8mq-4-9FuRqOyk3MXY8CfNaHr_0ERYs5kgmEWFrX","id":"01ANJ53W56Y2GOVW7725BZO354PWSELRRZ","name":"Marcello
+ AMPF","path":"/drives/b!FeOZEMfQx0eGQKqVBLcP__BG8mq-4-9FuRqOyk3MXY8CfNaHr_0ERYs5kgmEWFrX/root:","siteId":"1099e315-d0c7-47c7-8640-aa9504b70fff"},"fileSystemInfo":{"createdDateTime":"2025-09-23T11:12:56Z","lastModifiedDateTime":"2025-09-30T11:47:40Z"},"folder":{"childCount":1},"shared":{"scope":"users"}}'
+ recorded_at: Tue, 30 Sep 2025 11:51:10 GMT
+recorded_with: VCR 6.3.1
diff --git a/modules/storages/spec/support/fixtures/vcr_cassettes/sharepoint/rename_file_with_location_success.yml b/modules/storages/spec/support/fixtures/vcr_cassettes/sharepoint/rename_file_with_location_success.yml
new file mode 100644
index 00000000000..4b5d3e106e2
--- /dev/null
+++ b/modules/storages/spec/support/fixtures/vcr_cassettes/sharepoint/rename_file_with_location_success.yml
@@ -0,0 +1,127 @@
+---
+http_interactions:
+- request:
+ method: post
+ uri: https://login.microsoftonline.com/e36f1dbc-fdae-427e-b61b-0d96ddfb81a4/oauth2/v2.0/token
+ body:
+ encoding: ASCII-8BIT
+ string: grant_type=client_credentials&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default+offline_access&client_id=404e0567-19a1-4a64-b2d1-d3b0c99f2ed9&client_secret=QRB8Q%7Ei.1rID_.MC9FTfRGq-FTE5SgWYsoeLacWf
+ headers:
+ User-Agent:
+ - httpx.rb/1.6.1
+ Accept:
+ - "*/*"
+ Accept-Encoding:
+ - gzip, deflate
+ Content-Type:
+ - application/x-www-form-urlencoded
+ Content-Length:
+ - '199'
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Cache-Control:
+ - no-store, no-cache
+ Pragma:
+ - no-cache
+ Content-Type:
+ - application/json; charset=utf-8
+ Expires:
+ - "-1"
+ Strict-Transport-Security:
+ - max-age=31536000; includeSubDomains
+ X-Content-Type-Options:
+ - nosniff
+ P3p:
+ - CP="DSP CUR OTPi IND OTRi ONL FIN"
+ X-Ms-Request-Id:
+ - 1ec259e7-7cd2-458c-9daf-9fb6fd131c00
+ X-Ms-Ests-Server:
+ - 2.1.21950.4 - FRC ProdSlices
+ X-Ms-Srs:
+ - 1.P
+ Content-Security-Policy-Report-Only:
+ - object-src 'none'; base-uri 'self'; script-src 'self' 'nonce-fe_p4LNLwwgKBN-z2ON30w'
+ 'unsafe-inline' 'unsafe-eval' https://*.msauth.net https://*.msftauth.net
+ https://*.msftauthimages.net https://*.msauthimages.net https://*.msidentity.com
+ https://*.microsoftonline-p.com https://*.microsoftazuread-sso.com https://*.azureedge.net
+ https://*.outlook.com https://*.office.com https://*.office365.com https://*.microsoft.com
+ https://*.bing.com 'report-sample'; report-uri https://csp.microsoft.com/report/ESTS-UX-All
+ Cross-Origin-Opener-Policy-Report-Only:
+ - same-origin; report-to="coop-endpoint"
+ Reporting-Endpoints:
+ - coop-endpoint="https://idux.azurewebsites.net/api/coopReport"
+ X-Xss-Protection:
+ - '0'
+ Set-Cookie:
+ - fpc=AkTzmlrwqSNJq_V9ZenzcdlZ-dCOAQAAAC67beAOAAAA; expires=Thu, 30-Oct-2025
+ 11:51:11 GMT; path=/; secure; HttpOnly; SameSite=None, x-ms-gateway-slice=estsfd;
+ path=/; secure; samesite=none; httponly, stsservicecookie=estsfd; path=/;
+ secure; samesite=none; httponly
+ Date:
+ - Tue, 30 Sep 2025 11:51:11 GMT
+ Content-Length:
+ - '1932'
+ body:
+ encoding: UTF-8
+ string: '{"token_type":"Bearer","expires_in":3599,"ext_expires_in":3599,"access_token":"<ACCESS_TOKEN>"}'
+ recorded_at: Tue, 30 Sep 2025 11:51:11 GMT
+- request:
+ method: patch
+ uri: https://graph.microsoft.com/v1.0/drives/b!FeOZEMfQx0eGQKqVBLcP__BG8mq-4-9FuRqOyk3MXY8CfNaHr_0ERYs5kgmEWFrX/items/01ANJ53W5WDLAMJBIRRVD3PK2MNCSGTJVD
+ body:
+ encoding: UTF-8
+ string: '{"name":"I❤️you death star.png"}'
+ headers:
+ User-Agent:
+ - httpx.rb/1.6.1
+ Accept:
+ - "*/*"
+ Accept-Encoding:
+ - gzip, deflate
+ Content-Type:
+ - application/json; charset=utf-8
+ Content-Length:
+ - '36'
+ Authorization:
+ - Bearer <BEARER TOKEN>
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Cache-Control:
+ - no-store, no-cache
+ Content-Type:
+ - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8
+ Content-Encoding:
+ - gzip
+ Vary:
+ - Accept-Encoding
+ Strict-Transport-Security:
+ - max-age=31536000
+ Request-Id:
+ - 15869c01-65c1-4aad-ac45-5a66346f5e79
+ Client-Request-Id:
+ - 15869c01-65c1-4aad-ac45-5a66346f5e79
+ X-Ms-Ags-Diagnostic:
+ - '{"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"4","ScaleUnit":"006","RoleInstance":"FR1PEPF000041E1"}}'
+ Splogid:
+ - 33cacaa1-200d-0000-8a5a-695159c898b8
+ Odata-Version:
+ - '4.0'
+ Date:
+ - Tue, 30 Sep 2025 11:51:11 GMT
+ body:
+ encoding: UTF-8
+ string: '{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#drives(''b%21FeOZEMfQx0eGQKqVBLcP__BG8mq-4-9FuRqOyk3MXY8CfNaHr_0ERYs5kgmEWFrX'')/items/$entity","@microsoft.graph.downloadUrl":"https://ymt6d.sharepoint.com/sites/OPTest/_layouts/15/download.aspx?UniqueId=c4c01ab6-1185-478d-b7ab-4c68a469a6a3&Translate=false&tempauth=v1.eyJzaXRlaWQiOiIxMDk5ZTMxNS1kMGM3LTQ3YzctODY0MC1hYTk1MDRiNzBmZmYiLCJhcHBfZGlzcGxheW5hbWUiOiJPUCBTZWxlY3RlZCIsIm5hbWVpZCI6IjQwNGUwNTY3LTE5YTEtNGE2NC1iMmQxLWQzYjBjOTlmMmVkOUBlMzZmMWRiYy1mZGFlLTQyN2UtYjYxYi0wZDk2ZGRmYjgxYTQiLCJhdWQiOiIwMDAwMDAwMy0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDAveW10NmQuc2hhcmVwb2ludC5jb21AZTM2ZjFkYmMtZmRhZS00MjdlLWI2MWItMGQ5NmRkZmI4MWE0IiwiZXhwIjoiMTc1OTIzNjY3MSJ9.CkAKDGVudHJhX2NsYWltcxIwQ0lPRzc4WUdFQUFhRmpVeGJrTklkRW80YWtWWFpISTFMVEpmVWsxalFVRXFBQT09CjIKCmFjdG9yYXBwaWQSJDAwMDAwMDAzLTAwMDAtMDAwMC1jMDAwLTAwMDAwMDAwMDAwMAoKCgRzbmlkEgI2NBILCOC0zO-1iMA-EAUaCzIwLjIwLjQxLjMzKix4TUt4eTZwYzRRUWdvMm5QVVBXSSs2QUdTWXNhZGFNdUdCT0JRSjBXelBBPTCBATgBQhChysozDSAAAIpaaVFZyJi4ShBoYXNoZWRwcm9vZnRva2VuegExugENc2VsZWN0ZWRzaXRlc8gBAQ.URpePpCVhRufh_huv6_UUewU33htg4v958irgi8pCAc&ApiVersion=2.0","createdDateTime":"2025-09-23T11:13:24Z","eTag":"\"{C4C01AB6-1185-478D-B7AB-4C68A469A6A3},7\"","id":"01ANJ53W5WDLAMJBIRRVD3PK2MNCSGTJVD","lastModifiedDateTime":"2025-09-30T11:47:41Z","name":"I❤️you
+ death star.png","webUrl":"https://ymt6d.sharepoint.com/sites/OPTest/Marcello%20AMPF/I%20am%20the%20senat/I%E2%9D%A4%EF%B8%8Fyou%20death%20star.png","cTag":"\"c:{C4C01AB6-1185-478D-B7AB-4C68A469A6A3},4\"","size":331555,"createdBy":{"application":{"id":"404e0567-19a1-4a64-b2d1-d3b0c99f2ed9","displayName":"OP
+ Selected"},"user":{"email":"[email protected]","id":"5b5a7dc4-4539-41ba-9fa9-100f0a26acb7","displayName":"Eric
+ Schubert"}},"lastModifiedBy":{"application":{"id":"404e0567-19a1-4a64-b2d1-d3b0c99f2ed9","displayName":"OP
+ Selected"},"user":{"displayName":"SharePoint App"}},"parentReference":{"driveType":"documentLibrary","driveId":"b!FeOZEMfQx0eGQKqVBLcP__BG8mq-4-9FuRqOyk3MXY8CfNaHr_0ERYs5kgmEWFrX","id":"01ANJ53W7XPDQZRCOJK5CJC2M72EB6WKEG","name":"I
+ am the senat","path":"/drives/b!FeOZEMfQx0eGQKqVBLcP__BG8mq-4-9FuRqOyk3MXY8CfNaHr_0ERYs5kgmEWFrX/root:/I
+ am the senat","siteId":"1099e315-d0c7-47c7-8640-aa9504b70fff"},"file":{"mimeType":"image/png","hashes":{"quickXorHash":"FmcZ5D++Y0ngYq2SasDHZHBiMx4="}},"fileSystemInfo":{"createdDateTime":"2025-09-23T11:13:24Z","lastModifiedDateTime":"2025-09-30T11:47:41Z"},"image":{"height":720,"width":1328},"photo":{},"shared":{"scope":"users"}}'
+ recorded_at: Tue, 30 Sep 2025 11:51:11 GMT
+recorded_with: VCR 6.3.1