From 8ce42809996430c4848c096af89754fa8c675bce Mon Sep 17 00:00:00 2001 From: John Lannon Date: Wed, 11 Feb 2026 20:49:10 -0600 Subject: [PATCH 1/3] chore: add DocumentSection#upload_status Adds the ability to get the a document section upload's status See https://developers.pandadoc.com/reference/document-section-upload-status This endpoint responds with an object that implements the DocumentSection interface and adds an optional info_message attribute. Note that the status attribute behaves just like DocumentStatus. Values are `document_sections_upload.UPLOADED`, `document_sections_upload.PROCESSED`, and `document_sections_upload.ERROR`, which will be normalized and coerced to `UPLOADED`, `PROCESSED`, and `ERROR`. --- lib/panda_doc/document_section.rb | 7 +++++++ lib/panda_doc/objects/document_section.rb | 1 + spec/document_section_spec.rb | 24 +++++++++++++++++++++++ 3 files changed, 32 insertions(+) diff --git a/lib/panda_doc/document_section.rb b/lib/panda_doc/document_section.rb index 1c2fbff..ab4fd89 100644 --- a/lib/panda_doc/document_section.rb +++ b/lib/panda_doc/document_section.rb @@ -25,6 +25,13 @@ def delete(document_uuid, section_uuid) ) end + def upload_status(document_uuid, upload_uuid) + respond( + ApiClient.request(:get, "/documents/#{document_uuid}/sections/uploads/#{upload_uuid}"), + type: :document_section + ) + end + private def respond(response, type: :document) diff --git a/lib/panda_doc/objects/document_section.rb b/lib/panda_doc/objects/document_section.rb index 5a79a55..2cd1e9f 100644 --- a/lib/panda_doc/objects/document_section.rb +++ b/lib/panda_doc/objects/document_section.rb @@ -5,6 +5,7 @@ class DocumentSection < Base attribute? :document_uuid, Types::String attribute? :status, Types::Custom::DocumentStatus attribute :name, Types::String + attribute? :info_message, Types::String attribute? :date_created, Types::Params::DateTime attribute? :date_modified, Types::Params::DateTime diff --git a/spec/document_section_spec.rb b/spec/document_section_spec.rb index 3c9926d..3cec069 100644 --- a/spec/document_section_spec.rb +++ b/spec/document_section_spec.rb @@ -128,4 +128,28 @@ end end end + + describe ".upload_status" do + let(:upload_uuid) { "UPLOAD_UUID" } + subject { described_class.upload_status(document_uuid, upload_uuid) } + + before do + allow(PandaDoc::ApiClient).to receive(:request) + .with(:get, "/documents/#{document_uuid}/sections/uploads/#{upload_uuid}") + .and_return(response) + end + + context "with failed response" do + let(:response) { failed_response } + + it_behaves_like "a document section failure result" + end + + context "with successful response" do + let(:response) { successful_response } + let(:body) { document_body } + + it_behaves_like "a document section object interface" + end + end end From 0a6257000e5bbd9860810c56067e32ff0c72af9e Mon Sep 17 00:00:00 2001 From: John Lannon Date: Wed, 11 Feb 2026 21:04:10 -0600 Subject: [PATCH 2/3] chore: remove `info_message` --- lib/panda_doc/objects/document_section.rb | 1 - spec/document_section_spec.rb | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/panda_doc/objects/document_section.rb b/lib/panda_doc/objects/document_section.rb index 2cd1e9f..5a79a55 100644 --- a/lib/panda_doc/objects/document_section.rb +++ b/lib/panda_doc/objects/document_section.rb @@ -5,7 +5,6 @@ class DocumentSection < Base attribute? :document_uuid, Types::String attribute? :status, Types::Custom::DocumentStatus attribute :name, Types::String - attribute? :info_message, Types::String attribute? :date_created, Types::Params::DateTime attribute? :date_modified, Types::Params::DateTime diff --git a/spec/document_section_spec.rb b/spec/document_section_spec.rb index 3cec069..84c1ce0 100644 --- a/spec/document_section_spec.rb +++ b/spec/document_section_spec.rb @@ -46,8 +46,7 @@ "status" => "document_sections_upload.UPLOADED", "name" => "null", "date_created" => "2023-08-28T15:48:09.379860Z", - "date_modified" => "2023-08-28T15:48:09.379860Z", - "info_message" => "You need to poll the Document Sections Upload Status method until the status will be changed to document_sections_upload.PROCESSED" + "date_modified" => "2023-08-28T15:48:09.379860Z" } end From 98cce5ca15c45ef8e4cf0af8627f388f72f24351 Mon Sep 17 00:00:00 2001 From: John Lannon Date: Wed, 11 Feb 2026 21:05:18 -0600 Subject: [PATCH 3/3] chore: re-add info_message to response --- spec/document_section_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/document_section_spec.rb b/spec/document_section_spec.rb index 84c1ce0..3cec069 100644 --- a/spec/document_section_spec.rb +++ b/spec/document_section_spec.rb @@ -46,7 +46,8 @@ "status" => "document_sections_upload.UPLOADED", "name" => "null", "date_created" => "2023-08-28T15:48:09.379860Z", - "date_modified" => "2023-08-28T15:48:09.379860Z" + "date_modified" => "2023-08-28T15:48:09.379860Z", + "info_message" => "You need to poll the Document Sections Upload Status method until the status will be changed to document_sections_upload.PROCESSED" } end