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
Jump to file
Failed to load files.
Loading
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": "08782e4eef6cd6ccce4b6a6883408d9915a2d7c4",
"originGitCommit": "b0888bd6ca83627cb07ea05c440e35c183cebbd0",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"requestedVersion": "3.0.0.alpha.11",
"requestedVersion": "3.0.0.alpha.12",
"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.11",
"sdkVersion": "3.0.0.alpha.11",
"canonicalVersion": "3.0.0-next.12",
"sdkVersion": "3.0.0.alpha.12",
"source": {
"repository": "embedpdf/embed-pdf-viewer",
"openapi": "cloudpdf/contract/openapi.json",
"openapiSha256": "7bc0eea37724b3e359b0437edc3102b137e3d3f499293c89bb2b3293c6e3b614",
"gitCommit": "08782e4eef6cd6ccce4b6a6883408d9915a2d7c4",
"openapiSha256": "501ec54f2f28089dc8a3cf3a8d2ff3ade44c6c35d47977a3dfa47465fb83a049",
"gitCommit": "b0888bd6ca83627cb07ea05c440e35c183cebbd0",
"gitCommitIsDirty": false
},
"fern": {
Expand Down
106 changes: 106 additions & 0 deletions lib/CloudPDF/doc/annotations/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,112 @@ def update(request_options: {}, **params)
raise error_class.new(response.body, code: code)
end
end

# @param request_options [Hash]
# @param params [CloudPDF::Types::DocAnnotationsExportAppearanceRequest]
# @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 [Integer] :pon
# @option params [String, nil] :document_password
#
# @example
# client.doc.annotations.export_appearance(
# doc_id: "docId",
# layer_name: "layerName",
# pon: 1,
# request: {
# string: {
# key: "value"
# }
# }
# )
#
# @return [untyped]
def export_appearance(request_options: {}, **params)
params = CloudPDF::Internal::Types::Utils.normalize_keys(params)
path_param_names = %i[doc_id layer_name pon]
body_params = params.except(*path_param_names)

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: "POST",
path: "v1/docs/#{URI.encode_uri_component(params[:doc_id].to_s)}/layers/#{URI.encode_uri_component(params[:layer_name].to_s)}/annotations/pages/#{URI.encode_uri_component(params[:pon].to_s)}/items/appearance",
headers: headers,
body: body_params,
request_options: request_options
)
begin
response = @client.send(request)
rescue Net::HTTPRequestTimeout
raise CloudPDF::Errors::TimeoutError
end
code = response.code.to_i
return if code.between?(200, 299)

error_class = CloudPDF::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
end

# @param request_options [Hash]
# @param params [CloudPDF::Types::DocAnnotationsFlattenRequest]
# @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 [Integer] :pon
# @option params [String, nil] :document_password
#
# @example
# client.doc.annotations.flatten(
# doc_id: "docId",
# layer_name: "layerName",
# pon: 1,
# request: {
# key: "value"
# }
# )
#
# @return [CloudPDF::Types::DocAnnotationsFlatten200Response]
def flatten(request_options: {}, **params)
params = CloudPDF::Internal::Types::Utils.normalize_keys(params)
path_param_names = %i[doc_id layer_name pon]
body_params = params.except(*path_param_names)

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: "POST",
path: "v1/docs/#{URI.encode_uri_component(params[:doc_id].to_s)}/layers/#{URI.encode_uri_component(params[:layer_name].to_s)}/annotations/pages/#{URI.encode_uri_component(params[:pon].to_s)}/items/flatten",
headers: headers,
body: body_params,
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::DocAnnotationsFlatten200Response.load(response.body)
else
error_class = CloudPDF::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
end
end
end
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

module CloudPDF
module Doc
module Annotations
module Types
class ExportAppearanceAnnotationsRequest < 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 :pon, -> { Integer }, optional: false, nullable: false

field :document_password, -> { String }, optional: true, nullable: false, api_name: "X-Document-Password"

field :body, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
end
end
end
end
end
21 changes: 21 additions & 0 deletions lib/CloudPDF/doc/annotations/types/flatten_annotations_request.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

module CloudPDF
module Doc
module Annotations
module Types
class FlattenAnnotationsRequest < 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 :pon, -> { Integer }, optional: false, nullable: false

field :document_password, -> { String }, optional: true, nullable: false, api_name: "X-Document-Password"

field :body, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
end
end
end
end
end
102 changes: 102 additions & 0 deletions lib/CloudPDF/doc/pages/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,108 @@ def move(request_options: {}, **params)
end
end

# @param request_options [Hash]
# @param params [CloudPDF::Types::DocPagesSetNameRequest]
# @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.pages.set_name(
# doc_id: "docId",
# layer_name: "layerName",
# request: {
# key: "value"
# }
# )
#
# @return [CloudPDF::Types::DocPagesSetName200Response]
def set_name(request_options: {}, **params)
params = CloudPDF::Internal::Types::Utils.normalize_keys(params)
path_param_names = %i[doc_id layer_name]
body_params = params.except(*path_param_names)

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: "POST",
path: "v1/docs/#{URI.encode_uri_component(params[:doc_id].to_s)}/layers/#{URI.encode_uri_component(params[:layer_name].to_s)}/pages/names",
headers: headers,
body: body_params,
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::DocPagesSetName200Response.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 [CloudPDF::Types::DocPagesRemoveNameRequest]
# @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.pages.remove_name(
# doc_id: "docId",
# layer_name: "layerName",
# request: {
# key: "value"
# }
# )
#
# @return [CloudPDF::Types::DocPagesRemoveName200Response]
def remove_name(request_options: {}, **params)
params = CloudPDF::Internal::Types::Utils.normalize_keys(params)
path_param_names = %i[doc_id layer_name]
body_params = params.except(*path_param_names)

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: "POST",
path: "v1/docs/#{URI.encode_uri_component(params[:doc_id].to_s)}/layers/#{URI.encode_uri_component(params[:layer_name].to_s)}/pages/names/delete",
headers: headers,
body: body_params,
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::DocPagesRemoveName200Response.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 [CloudPDF::Types::DocPagesRotateRequest]
# @option request_options [String] :base_url
Expand Down
19 changes: 19 additions & 0 deletions lib/CloudPDF/doc/pages/types/remove_name_pages_request.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

module CloudPDF
module Doc
module Pages
module Types
class RemoveNamePagesRequest < 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"

field :body, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
end
end
end
end
end
19 changes: 19 additions & 0 deletions lib/CloudPDF/doc/pages/types/set_name_pages_request.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

module CloudPDF
module Doc
module Pages
module Types
class SetNamePagesRequest < 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"

field :body, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
end
end
end
end
end
15 changes: 15 additions & 0 deletions lib/CloudPDF/types/doc_annotations_export_appearance400response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

module CloudPDF
module Types
class DocAnnotationsExportAppearance400Response < Internal::Types::Model
field :name, -> { CloudPDF::Types::DocAnnotationsExportAppearance400ResponseName }, optional: false, nullable: false

field :code, -> { CloudPDF::Types::DocAnnotationsExportAppearance400ResponseCode }, optional: false, nullable: false

field :message, -> { String }, optional: false, nullable: false

field :details, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# frozen_string_literal: true

module CloudPDF
module Types
module DocAnnotationsExportAppearance400ResponseCode
extend CloudPDF::Internal::Types::Enum

UNKNOWN = "Unknown"
INVALID_ARG = "InvalidArg"
DOC_NOT_OPEN = "DocNotOpen"
DOC_OPEN_FAILED = "DocOpenFailed"
DOC_PASSWORD_REQUIRED = "DocPasswordRequired"
DOC_PASSWORD_INCORRECT = "DocPasswordIncorrect"
SHARE_PASSWORD_REQUIRED = "SharePasswordRequired"
ABORTED = "Aborted"
NETWORK = "Network"
UNAUTHENTICATED = "Unauthenticated"
FORBIDDEN = "Forbidden"
NOT_FOUND = "NotFound"
WIRE_FORMAT = "WireFormat"
RUNTIME_UNAVAILABLE = "RuntimeUnavailable"
INVALID_REFERENCE = "InvalidReference"
WEAK_ANNOTATION_SESSION_CONFLICT = "WeakAnnotationSessionConflict"
LAYER_VERSION_CONFLICT = "LayerVersionConflict"
NOT_IMPLEMENTED = "NotImplemented"
MALFORMED_PDF = "MalformedPdf"
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
module DocAnnotationsExportAppearance400ResponseName
extend CloudPDF::Internal::Types::Enum

ENGINE_ERROR = "EngineError"
end
end
end
Loading
Loading