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": "ce65e1390549db1272ac3720a5ddfcea55be2c07",
"originGitCommit": "3f7f3c650bb91d9c5a4277c920bbd6fab7142f98",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"requestedVersion": "3.0.0.alpha.22",
"requestedVersion": "3.0.0.alpha.23",
"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.22",
"sdkVersion": "3.0.0.alpha.22",
"canonicalVersion": "3.0.0-next.23",
"sdkVersion": "3.0.0.alpha.23",
"source": {
"repository": "embedpdf/embed-pdf-viewer",
"openapi": "cloudpdf/contract/openapi.json",
"openapiSha256": "1f5aa976eec4d5fc4e2b22efe725df58a01389896733ec1870f96a6441b62859",
"gitCommit": "ce65e1390549db1272ac3720a5ddfcea55be2c07",
"openapiSha256": "82488f8cc7c2cd27aee3dc6000d59164467f7dd3899074e309f0574a027e4524",
"gitCommit": "3f7f3c650bb91d9c5a4277c920bbd6fab7142f98",
"gitCommitIsDirty": false
},
"fern": {
Expand Down
3 changes: 2 additions & 1 deletion lib/CloudPDF/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ def initialize(token:, base_url: nil, max_retries: 2)
base_url: base_url || CloudPDF::Environment::SAAS,
headers: {
"X-Fern-Language" => "Ruby",
Authorization: "Bearer #{token}"
Authorization: "Bearer #{token}",
"EmbedPDF-Version" => "3.0"
},
max_retries: max_retries
)
Expand Down
50 changes: 25 additions & 25 deletions lib/CloudPDF/doc/annotations/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def list_all(request_options: {}, **params)
end
code = response.code.to_i
if code.between?(200, 299)
(response.body.to_s.empty? ? nil : CloudPDF::Types::DocAnnotationsListAll200Response.load(response.body))
(response.body.to_s.empty? ? nil : CloudPDF::Types::DocAnnotationsListAllResponse.load(response.body))
else
error_class = CloudPDF::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
Expand Down Expand Up @@ -97,7 +97,7 @@ def list(request_options: {}, **params)
end
code = response.code.to_i
if code.between?(200, 299)
(response.body.to_s.empty? ? nil : CloudPDF::Types::DocAnnotationsList200Response.load(response.body))
(response.body.to_s.empty? ? nil : CloudPDF::Types::DocAnnotationsListResponse.load(response.body))
else
error_class = CloudPDF::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
Expand Down Expand Up @@ -130,7 +130,7 @@ def list(request_options: {}, **params)
# }
# )
#
# @return [CloudPDF::Types::DocAnnotationsCreate200Response]
# @return [CloudPDF::Types::DocAnnotationsCreateResponse]
def create(request_options: {}, **params)
params = CloudPDF::Internal::Types::Utils.normalize_keys(params)
path_param_names = %i[doc_id layer_name page_key]
Expand All @@ -155,7 +155,7 @@ def create(request_options: {}, **params)
end
code = response.code.to_i
if code.between?(200, 299)
(response.body.to_s.empty? ? nil : CloudPDF::Types::DocAnnotationsCreate200Response.load(response.body))
(response.body.to_s.empty? ? nil : CloudPDF::Types::DocAnnotationsCreateResponse.load(response.body))
else
error_class = CloudPDF::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
Expand All @@ -172,7 +172,7 @@ def create(request_options: {}, **params)
# @option params [String] :doc_id
# @option params [String] :layer_name
# @option params [String] :page_key
# @option params [String] :annot_key
# @option params [String] :annotation_key
# @option params [String, nil] :document_password
# @option params [String, nil] :idempotency_key
#
Expand All @@ -181,10 +181,10 @@ def create(request_options: {}, **params)
# doc_id: "docId",
# layer_name: "layerName",
# page_key: "pageKey",
# annot_key: "annotKey"
# annotation_key: "annotationKey"
# )
#
# @return [CloudPDF::Types::DocAnnotationsDelete200Response]
# @return [CloudPDF::Types::DocAnnotationsDeleteResponse]
def delete(request_options: {}, **params)
params = CloudPDF::Internal::Types::Utils.normalize_keys(params)
headers = {}
Expand All @@ -194,7 +194,7 @@ def delete(request_options: {}, **params)
request = CloudPDF::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "DELETE",
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[:page_key].to_s)}/items/#{URI.encode_uri_component(params[:annot_key].to_s)}",
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[:page_key].to_s)}/items/#{URI.encode_uri_component(params[:annotation_key].to_s)}",
headers: headers,
request_options: request_options
)
Expand All @@ -205,7 +205,7 @@ def delete(request_options: {}, **params)
end
code = response.code.to_i
if code.between?(200, 299)
(response.body.to_s.empty? ? nil : CloudPDF::Types::DocAnnotationsDelete200Response.load(response.body))
(response.body.to_s.empty? ? nil : CloudPDF::Types::DocAnnotationsDeleteResponse.load(response.body))
else
error_class = CloudPDF::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
Expand All @@ -222,7 +222,7 @@ def delete(request_options: {}, **params)
# @option params [String] :doc_id
# @option params [String] :layer_name
# @option params [String] :page_key
# @option params [String] :annot_key
# @option params [String] :annotation_key
# @option params [String, nil] :document_password
# @option params [String, nil] :idempotency_key
#
Expand All @@ -231,16 +231,16 @@ def delete(request_options: {}, **params)
# doc_id: "docId",
# layer_name: "layerName",
# page_key: "pageKey",
# annot_key: "annotKey",
# annotation_key: "annotationKey",
# request: {
# key: "value"
# }
# )
#
# @return [CloudPDF::Types::DocAnnotationsUpdate200Response]
# @return [CloudPDF::Types::DocAnnotationsUpdateResponse]
def update(request_options: {}, **params)
params = CloudPDF::Internal::Types::Utils.normalize_keys(params)
path_param_names = %i[doc_id layer_name page_key annot_key]
path_param_names = %i[doc_id layer_name page_key annotation_key]
body_params = params.except(*path_param_names)

headers = {}
Expand All @@ -250,7 +250,7 @@ def update(request_options: {}, **params)
request = CloudPDF::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "PATCH",
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[:page_key].to_s)}/items/#{URI.encode_uri_component(params[:annot_key].to_s)}",
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[:page_key].to_s)}/items/#{URI.encode_uri_component(params[:annotation_key].to_s)}",
headers: headers,
body: body_params,
request_options: request_options
Expand All @@ -262,7 +262,7 @@ def update(request_options: {}, **params)
end
code = response.code.to_i
if code.between?(200, 299)
(response.body.to_s.empty? ? nil : CloudPDF::Types::DocAnnotationsUpdate200Response.load(response.body))
(response.body.to_s.empty? ? nil : CloudPDF::Types::DocAnnotationsUpdateResponse.load(response.body))
else
error_class = CloudPDF::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
Expand All @@ -279,15 +279,15 @@ def update(request_options: {}, **params)
# @option params [String] :doc_id
# @option params [String] :layer_name
# @option params [String] :page_key
# @option params [String] :annot_key
# @option params [String] :annotation_key
# @option params [String, nil] :document_password
#
# @example
# client.doc.annotations.read_appearance(
# doc_id: "docId",
# layer_name: "layerName",
# page_key: "pageKey",
# annot_key: "annotKey"
# annotation_key: "annotationKey"
# )
#
# @return [untyped]
Expand All @@ -299,7 +299,7 @@ def read_appearance(request_options: {}, **params)
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/pages/#{URI.encode_uri_component(params[:page_key].to_s)}/items/#{URI.encode_uri_component(params[:annot_key].to_s)}/resources/appearance",
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[:page_key].to_s)}/items/#{URI.encode_uri_component(params[:annotation_key].to_s)}/resources/appearance",
headers: headers,
request_options: request_options
)
Expand Down Expand Up @@ -327,15 +327,15 @@ def read_appearance(request_options: {}, **params)
# @option params [String] :doc_id
# @option params [String] :layer_name
# @option params [String] :page_key
# @option params [String] :annot_key
# @option params [String] :annotation_key
# @option params [String, nil] :document_password
#
# @example
# client.doc.annotations.read_file(
# doc_id: "docId",
# layer_name: "layerName",
# page_key: "pageKey",
# annot_key: "annotKey"
# annotation_key: "annotationKey"
# )
#
# @return [untyped]
Expand All @@ -347,7 +347,7 @@ def read_file(request_options: {}, **params)
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/pages/#{URI.encode_uri_component(params[:page_key].to_s)}/items/#{URI.encode_uri_component(params[:annot_key].to_s)}/resources/file",
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[:page_key].to_s)}/items/#{URI.encode_uri_component(params[:annotation_key].to_s)}/resources/file",
headers: headers,
request_options: request_options
)
Expand Down Expand Up @@ -439,7 +439,7 @@ def export_appearance(request_options: {}, **params)
# }
# )
#
# @return [CloudPDF::Types::DocAnnotationsFlatten200Response]
# @return [CloudPDF::Types::DocAnnotationsFlattenResponse]
def flatten(request_options: {}, **params)
params = CloudPDF::Internal::Types::Utils.normalize_keys(params)
path_param_names = %i[doc_id layer_name page_key]
Expand All @@ -464,7 +464,7 @@ def flatten(request_options: {}, **params)
end
code = response.code.to_i
if code.between?(200, 299)
(response.body.to_s.empty? ? nil : CloudPDF::Types::DocAnnotationsFlatten200Response.load(response.body))
(response.body.to_s.empty? ? nil : CloudPDF::Types::DocAnnotationsFlattenResponse.load(response.body))
else
error_class = CloudPDF::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
Expand Down Expand Up @@ -493,7 +493,7 @@ def flatten(request_options: {}, **params)
# position: "start"
# )
#
# @return [CloudPDF::Types::DocAnnotationsReorder200Response]
# @return [CloudPDF::Types::DocAnnotationsReorderResponse]
def reorder(request_options: {}, **params)
params = CloudPDF::Internal::Types::Utils.normalize_keys(params)
request_data = CloudPDF::Doc::Annotations::Types::DocAnnotationsReorderRequest.new(params).to_h
Expand All @@ -519,7 +519,7 @@ def reorder(request_options: {}, **params)
end
code = response.code.to_i
if code.between?(200, 299)
(response.body.to_s.empty? ? nil : CloudPDF::Types::DocAnnotationsReorder200Response.load(response.body))
(response.body.to_s.empty? ? nil : CloudPDF::Types::DocAnnotationsReorderResponse.load(response.body))
else
error_class = CloudPDF::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class DeleteAnnotationsRequest < Internal::Types::Model

field :page_key, -> { String }, optional: false, nullable: false, api_name: "pageKey"

field :annot_key, -> { String }, optional: false, nullable: false, api_name: "annotKey"
field :annotation_key, -> { String }, optional: false, nullable: false, api_name: "annotationKey"

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ReadAppearanceAnnotationsRequest < Internal::Types::Model

field :page_key, -> { String }, optional: false, nullable: false, api_name: "pageKey"

field :annot_key, -> { String }, optional: false, nullable: false, api_name: "annotKey"
field :annotation_key, -> { String }, optional: false, nullable: false, api_name: "annotationKey"

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

field :page_key, -> { String }, optional: false, nullable: false, api_name: "pageKey"

field :annot_key, -> { String }, optional: false, nullable: false, api_name: "annotKey"
field :annotation_key, -> { String }, optional: false, nullable: false, api_name: "annotationKey"

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

field :page_key, -> { String }, optional: false, nullable: false, api_name: "pageKey"

field :annot_key, -> { String }, optional: false, nullable: false, api_name: "annotKey"
field :annotation_key, -> { String }, optional: false, nullable: false, api_name: "annotationKey"

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

Expand Down
2 changes: 1 addition & 1 deletion lib/CloudPDF/doc/attachments/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def list(request_options: {}, **params)
end
code = response.code.to_i
if code.between?(200, 299)
(response.body.to_s.empty? ? nil : CloudPDF::Types::DocAttachmentsList200Response.load(response.body))
(response.body.to_s.empty? ? nil : CloudPDF::Types::DocAttachmentsListResponse.load(response.body))
else
error_class = CloudPDF::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
Expand Down
Loading
Loading