Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"generatorConfig": {
"moduleName": "CloudPDF"
},
"originGitCommit": "e5cd0731cb3a1f2ed5821f8d60191bd58934c3dd",
"originGitCommit": "31a712963c171ce9ebd6815e873c9895e389afc2",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"requestedVersion": "3.0.0.alpha.9",
"requestedVersion": "3.0.0.alpha.10",
"ciProvider": "github"
}
8 changes: 4 additions & 4 deletions cloudpdf-generation.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"language": "ruby",
"canonicalVersion": "3.0.0-next.9",
"sdkVersion": "3.0.0.alpha.9",
"canonicalVersion": "3.0.0-next.10",
"sdkVersion": "3.0.0.alpha.10",
"source": {
"repository": "embedpdf/embed-pdf-viewer",
"openapi": "cloudpdf/contract/openapi.json",
"openapiSha256": "4ee27900dbb0b13408ce00a0e80d606444ab81e9d5a76186fa984c8c8dfe09fe",
"gitCommit": "e5cd0731cb3a1f2ed5821f8d60191bd58934c3dd",
"openapiSha256": "9d6c7cdd459982ba9e718a3842c969003b466e3fd73883fef7783dc78e12cdfe",
"gitCommit": "31a712963c171ce9ebd6815e873c9895e389afc2",
"gitCommitIsDirty": false
},
"fern": {
Expand Down
47 changes: 47 additions & 0 deletions lib/CloudPDF/doc/annotations/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,53 @@ def initialize(client:)
@client = client
end

# Returns one entry per page plus the audit-log cursor for reconciling subsequent document events. Page order is
# unspecified; join by `pageState.pageObjectNumber` when display order matters.
#
# @param request_options [Hash]
# @param params [Hash]
# @option request_options [String] :base_url
# @option request_options [Hash{String => Object}] :additional_headers
# @option request_options [Hash{String => Object}] :additional_query_parameters
# @option request_options [Hash{String => Object}] :additional_body_parameters
# @option request_options [Integer] :timeout_in_seconds
# @option params [String] :doc_id
# @option params [String] :layer_name
# @option params [String, nil] :document_password
#
# @example
# client.doc.annotations.list_all(
# doc_id: "docId",
# layer_name: "layerName"
# )
#
# @return [CloudPDF::Types::DocAnnotationsListAll200Response]
def list_all(request_options: {}, **params)
params = CloudPDF::Internal::Types::Utils.normalize_keys(params)
headers = {}
headers["X-Document-Password"] = params[:document_password] if params[:document_password]

request = CloudPDF::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "GET",
path: "v1/docs/#{URI.encode_uri_component(params[:doc_id].to_s)}/layers/#{URI.encode_uri_component(params[:layer_name].to_s)}/annotations/items",
headers: headers,
request_options: request_options
)
begin
response = @client.send(request)
rescue Net::HTTPRequestTimeout
raise CloudPDF::Errors::TimeoutError
end
code = response.code.to_i
if code.between?(200, 299)
CloudPDF::Types::DocAnnotationsListAll200Response.load(response.body)
else
error_class = CloudPDF::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
end
end

# @param request_options [Hash]
# @param params [Hash]
# @option request_options [String] :base_url
Expand Down
17 changes: 17 additions & 0 deletions lib/CloudPDF/doc/annotations/types/list_all_annotations_request.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

module CloudPDF
module Doc
module Annotations
module Types
class ListAllAnnotationsRequest < Internal::Types::Model
field :doc_id, -> { String }, optional: false, nullable: false, api_name: "docId"

field :layer_name, -> { String }, optional: false, nullable: false, api_name: "layerName"

field :document_password, -> { String }, optional: true, nullable: false, api_name: "X-Document-Password"
end
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class DocAnnotationsCreate200ResponseMetaCacheDelta < Internal::Types::Model

field :doc_version, -> { Integer }, optional: false, nullable: false, api_name: "docVersion"

field :annotations_version, -> { Integer }, optional: true, nullable: false, api_name: "annotationsVersion"

field :pages, -> { Internal::Types::Array[CloudPDF::Types::DocAnnotationsCreate200ResponseMetaCacheDeltaPagesItem] }, optional: false, nullable: false
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class DocAnnotationsDelete200ResponseMetaCacheDelta < Internal::Types::Model

field :doc_version, -> { Integer }, optional: false, nullable: false, api_name: "docVersion"

field :annotations_version, -> { Integer }, optional: true, nullable: false, api_name: "annotationsVersion"

field :pages, -> { Internal::Types::Array[CloudPDF::Types::DocAnnotationsDelete200ResponseMetaCacheDeltaPagesItem] }, optional: false, nullable: false
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class DocAnnotationsList200ResponseAnnotationsItemCaret < Internal::Types::Model

field :contents, -> { String }, optional: false, nullable: true

field :subject, -> { String }, optional: false, nullable: true

field :author, -> { String }, optional: false, nullable: true

field :created, -> { String }, optional: false, nullable: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class DocAnnotationsList200ResponseAnnotationsItemCircle < Internal::Types::Mode

field :contents, -> { String }, optional: false, nullable: true

field :subject, -> { String }, optional: false, nullable: true

field :author, -> { String }, optional: false, nullable: true

field :created, -> { String }, optional: false, nullable: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class DocAnnotationsList200ResponseAnnotationsItemFileAttachment < Internal::Typ

field :contents, -> { String }, optional: false, nullable: true

field :subject, -> { String }, optional: false, nullable: true

field :author, -> { String }, optional: false, nullable: true

field :created, -> { String }, optional: false, nullable: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class DocAnnotationsList200ResponseAnnotationsItemFreeText < Internal::Types::Mo

field :contents, -> { String }, optional: false, nullable: true

field :subject, -> { String }, optional: false, nullable: true

field :author, -> { String }, optional: false, nullable: true

field :created, -> { String }, optional: false, nullable: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class DocAnnotationsList200ResponseAnnotationsItemHighlight < Internal::Types::M

field :contents, -> { String }, optional: false, nullable: true

field :subject, -> { String }, optional: false, nullable: true

field :author, -> { String }, optional: false, nullable: true

field :created, -> { String }, optional: false, nullable: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class DocAnnotationsList200ResponseAnnotationsItemInk < Internal::Types::Model

field :contents, -> { String }, optional: false, nullable: true

field :subject, -> { String }, optional: false, nullable: true

field :author, -> { String }, optional: false, nullable: true

field :created, -> { String }, optional: false, nullable: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class DocAnnotationsList200ResponseAnnotationsItemLine < Internal::Types::Model

field :contents, -> { String }, optional: false, nullable: true

field :subject, -> { String }, optional: false, nullable: true

field :author, -> { String }, optional: false, nullable: true

field :created, -> { String }, optional: false, nullable: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class DocAnnotationsList200ResponseAnnotationsItemLink < Internal::Types::Model

field :contents, -> { String }, optional: false, nullable: true

field :subject, -> { String }, optional: false, nullable: true

field :author, -> { String }, optional: false, nullable: true

field :created, -> { String }, optional: false, nullable: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class DocAnnotationsList200ResponseAnnotationsItemPolygon < Internal::Types::Mod

field :contents, -> { String }, optional: false, nullable: true

field :subject, -> { String }, optional: false, nullable: true

field :author, -> { String }, optional: false, nullable: true

field :created, -> { String }, optional: false, nullable: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class DocAnnotationsList200ResponseAnnotationsItemPolyline < Internal::Types::Mo

field :contents, -> { String }, optional: false, nullable: true

field :subject, -> { String }, optional: false, nullable: true

field :author, -> { String }, optional: false, nullable: true

field :created, -> { String }, optional: false, nullable: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class DocAnnotationsList200ResponseAnnotationsItemRedact < Internal::Types::Mode

field :contents, -> { String }, optional: false, nullable: true

field :subject, -> { String }, optional: false, nullable: true

field :author, -> { String }, optional: false, nullable: true

field :created, -> { String }, optional: false, nullable: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class DocAnnotationsList200ResponseAnnotationsItemSquare < Internal::Types::Mode

field :contents, -> { String }, optional: false, nullable: true

field :subject, -> { String }, optional: false, nullable: true

field :author, -> { String }, optional: false, nullable: true

field :created, -> { String }, optional: false, nullable: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class DocAnnotationsList200ResponseAnnotationsItemSquiggly < Internal::Types::Mo

field :contents, -> { String }, optional: false, nullable: true

field :subject, -> { String }, optional: false, nullable: true

field :author, -> { String }, optional: false, nullable: true

field :created, -> { String }, optional: false, nullable: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class DocAnnotationsList200ResponseAnnotationsItemStamp < Internal::Types::Model

field :contents, -> { String }, optional: false, nullable: true

field :subject, -> { String }, optional: false, nullable: true

field :author, -> { String }, optional: false, nullable: true

field :created, -> { String }, optional: false, nullable: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class DocAnnotationsList200ResponseAnnotationsItemStrikeout < Internal::Types::M

field :contents, -> { String }, optional: false, nullable: true

field :subject, -> { String }, optional: false, nullable: true

field :author, -> { String }, optional: false, nullable: true

field :created, -> { String }, optional: false, nullable: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class DocAnnotationsList200ResponseAnnotationsItemText < Internal::Types::Model

field :contents, -> { String }, optional: false, nullable: true

field :subject, -> { String }, optional: false, nullable: true

field :author, -> { String }, optional: false, nullable: true

field :created, -> { String }, optional: false, nullable: true
Expand Down Expand Up @@ -46,6 +48,10 @@ class DocAnnotationsList200ResponseAnnotationsItemText < Internal::Types::Model
field :opacity, -> { Integer }, optional: false, nullable: false

field :icon, -> { CloudPDF::Types::DocAnnotationsList200ResponseAnnotationsItemTextIcon }, optional: false, nullable: false

field :state, -> { String }, optional: false, nullable: true

field :state_model, -> { String }, optional: false, nullable: true, api_name: "stateModel"
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class DocAnnotationsList200ResponseAnnotationsItemUnderline < Internal::Types::M

field :contents, -> { String }, optional: false, nullable: true

field :subject, -> { String }, optional: false, nullable: true

field :author, -> { String }, optional: false, nullable: true

field :created, -> { String }, optional: false, nullable: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class DocAnnotationsList200ResponseAnnotationsItemUnsupported < Internal::Types:

field :contents, -> { String }, optional: false, nullable: true

field :subject, -> { String }, optional: false, nullable: true

field :author, -> { String }, optional: false, nullable: true

field :created, -> { String }, optional: false, nullable: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class DocAnnotationsList200ResponseAnnotationsItemWidget < Internal::Types::Mode

field :contents, -> { String }, optional: false, nullable: true

field :subject, -> { String }, optional: false, nullable: true

field :author, -> { String }, optional: false, nullable: true

field :created, -> { String }, optional: false, nullable: true
Expand Down
11 changes: 11 additions & 0 deletions lib/CloudPDF/types/doc_annotations_list_all200response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

module CloudPDF
module Types
class DocAnnotationsListAll200Response < Internal::Types::Model
field :pages, -> { Internal::Types::Array[CloudPDF::Types::DocAnnotationsListAll200ResponsePagesItem] }, optional: false, nullable: false

field :audit_head, -> { Integer }, optional: true, nullable: false, api_name: "auditHead"
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

module CloudPDF
module Types
class DocAnnotationsListAll200ResponsePagesItem < Internal::Types::Model
field :page_state, -> { CloudPDF::Types::DocAnnotationsListAll200ResponsePagesItemPageState }, optional: false, nullable: false, api_name: "pageState"

field :annotations, -> { Internal::Types::Array[CloudPDF::Types::DocAnnotationsListAll200ResponsePagesItemAnnotationsItem] }, optional: false, nullable: false
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# frozen_string_literal: true

module CloudPDF
module Types
class DocAnnotationsListAll200ResponsePagesItemAnnotationsItem < Internal::Types::Model
extend CloudPDF::Internal::Types::Union

discriminant :subtype

member -> { CloudPDF::Types::DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlight }, key: "HIGHLIGHT"

member -> { CloudPDF::Types::DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderline }, key: "UNDERLINE"

member -> { CloudPDF::Types::DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquiggly }, key: "SQUIGGLY"

member -> { CloudPDF::Types::DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeout }, key: "STRIKEOUT"

member -> { CloudPDF::Types::DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircle }, key: "CIRCLE"

member -> { CloudPDF::Types::DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquare }, key: "SQUARE"

member -> { CloudPDF::Types::DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygon }, key: "POLYGON"

member -> { CloudPDF::Types::DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolyline }, key: "POLYLINE"

member -> { CloudPDF::Types::DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLine }, key: "LINE"

member -> { CloudPDF::Types::DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLink }, key: "LINK"

member -> { CloudPDF::Types::DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInk }, key: "INK"

member -> { CloudPDF::Types::DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeText }, key: "FREE_TEXT"

member -> { CloudPDF::Types::DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaret }, key: "CARET"

member -> { CloudPDF::Types::DocAnnotationsListAll200ResponsePagesItemAnnotationsItemText }, key: "TEXT"

member -> { CloudPDF::Types::DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStamp }, key: "STAMP"

member -> { CloudPDF::Types::DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachment }, key: "FILE_ATTACHMENT"

member -> { CloudPDF::Types::DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidget }, key: "WIDGET"

member -> { CloudPDF::Types::DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedact }, key: "REDACT"

member -> { CloudPDF::Types::DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupported }, key: "UNSUPPORTED"
end
end
end
Loading
Loading