cloudpdf 3.0.0.alpha.16 → 3.0.0.alpha.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.fern/metadata.json +2 -2
- data/lib/CloudPDF/doc/client.rb +55 -0
- data/lib/CloudPDF/doc/types/doc_download_link_request.rb +17 -0
- data/lib/CloudPDF/documents/client.rb +5 -0
- data/lib/CloudPDF/documents/layers/client.rb +103 -0
- data/lib/CloudPDF/documents/layers/types/delete_layers_request.rb +17 -0
- data/lib/CloudPDF/documents/layers/types/list_layers_request.rb +21 -0
- data/lib/CloudPDF/shares/client.rb +56 -1
- data/lib/CloudPDF/shares/types/archive_shares_request.rb +13 -0
- data/lib/CloudPDF/shares/types/list_shares_request.rb +2 -0
- data/lib/CloudPDF/shares/types/shares_create_request.rb +8 -0
- data/lib/CloudPDF/shares/types/shares_create_request_layer_mode.rb +14 -0
- data/lib/CloudPDF/shares/types/shares_create_request_visitor_identity.rb +17 -0
- data/lib/CloudPDF/shares/types/shares_create_request_visitor_identity_ask.rb +14 -0
- data/lib/CloudPDF/shares/types/shares_create_request_visitor_identity_fields.rb +19 -0
- data/lib/CloudPDF/shares/types/shares_create_request_visitor_identity_fields_display_name.rb +14 -0
- data/lib/CloudPDF/shares/types/shares_create_request_visitor_identity_fields_email.rb +14 -0
- data/lib/CloudPDF/shares/types/shares_create_request_visitor_identity_fields_organization.rb +14 -0
- data/lib/CloudPDF/shares/types/shares_create_request_visitor_identity_fields_organizational_unit.rb +14 -0
- data/lib/CloudPDF/shares/types/shares_create_request_visitor_identity_fields_title.rb +14 -0
- data/lib/CloudPDF/shares/types/shares_exchange_request.rb +6 -0
- data/lib/CloudPDF/shares/types/shares_exchange_request_visitor_identity.rb +19 -0
- data/lib/CloudPDF/shares/types/shares_update_request.rb +10 -0
- data/lib/CloudPDF/shares/types/shares_update_request_layer_mode.rb +14 -0
- data/lib/CloudPDF/shares/types/shares_update_request_visitor_identity.rb +17 -0
- data/lib/CloudPDF/shares/types/shares_update_request_visitor_identity_ask.rb +14 -0
- data/lib/CloudPDF/shares/types/shares_update_request_visitor_identity_fields.rb +19 -0
- data/lib/CloudPDF/shares/types/shares_update_request_visitor_identity_fields_display_name.rb +14 -0
- data/lib/CloudPDF/shares/types/shares_update_request_visitor_identity_fields_email.rb +14 -0
- data/lib/CloudPDF/shares/types/shares_update_request_visitor_identity_fields_organization.rb +14 -0
- data/lib/CloudPDF/shares/types/shares_update_request_visitor_identity_fields_organizational_unit.rb +14 -0
- data/lib/CloudPDF/shares/types/shares_update_request_visitor_identity_fields_title.rb +14 -0
- data/lib/CloudPDF/shares/visitors/client.rb +106 -0
- data/lib/CloudPDF/shares/visitors/types/delete_visitors_request.rb +17 -0
- data/lib/CloudPDF/shares/visitors/types/list_visitors_request.rb +19 -0
- data/lib/CloudPDF/types/admin_error_payload_error.rb +2 -0
- data/lib/CloudPDF/types/doc_download_link200response.rb +11 -0
- data/lib/CloudPDF/types/doc_download_link404response.rb +23 -0
- data/lib/CloudPDF/types/doc_download_link501response.rb +23 -0
- data/lib/CloudPDF/types/documents_layers_delete403response.rb +23 -0
- data/lib/CloudPDF/types/documents_layers_delete404response.rb +23 -0
- data/lib/CloudPDF/types/documents_layers_delete409response.rb +23 -0
- data/lib/CloudPDF/types/documents_layers_list200response.rb +11 -0
- data/lib/CloudPDF/types/documents_layers_list200response_layers_item.rb +23 -0
- data/lib/CloudPDF/types/documents_layers_list400response.rb +23 -0
- data/lib/CloudPDF/types/documents_layers_list403response.rb +23 -0
- data/lib/CloudPDF/types/documents_layers_list404response.rb +23 -0
- data/lib/CloudPDF/types/engine_error_payload_code.rb +2 -0
- data/lib/CloudPDF/types/shares_archive200response.rb +9 -0
- data/lib/CloudPDF/types/shares_archive200response_share.rb +47 -0
- data/lib/CloudPDF/types/shares_archive200response_share_layer_mode.rb +12 -0
- data/lib/CloudPDF/types/shares_archive200response_share_visitor_identity.rb +15 -0
- data/lib/CloudPDF/types/shares_archive200response_share_visitor_identity_ask.rb +12 -0
- data/lib/CloudPDF/types/shares_archive200response_share_visitor_identity_fields.rb +17 -0
- data/lib/CloudPDF/types/shares_archive200response_share_visitor_identity_fields_display_name.rb +12 -0
- data/lib/CloudPDF/types/shares_archive200response_share_visitor_identity_fields_email.rb +12 -0
- data/lib/CloudPDF/types/shares_archive200response_share_visitor_identity_fields_organization.rb +12 -0
- data/lib/CloudPDF/types/shares_archive200response_share_visitor_identity_fields_organizational_unit.rb +12 -0
- data/lib/CloudPDF/types/shares_archive200response_share_visitor_identity_fields_title.rb +12 -0
- data/lib/CloudPDF/types/shares_archive404response.rb +23 -0
- data/lib/CloudPDF/types/shares_create200response_share.rb +11 -1
- data/lib/CloudPDF/types/shares_create200response_share_layer_mode.rb +12 -0
- data/lib/CloudPDF/types/shares_create200response_share_visitor_identity.rb +15 -0
- data/lib/CloudPDF/types/shares_create200response_share_visitor_identity_ask.rb +12 -0
- data/lib/CloudPDF/types/shares_create200response_share_visitor_identity_fields.rb +17 -0
- data/lib/CloudPDF/types/shares_create200response_share_visitor_identity_fields_display_name.rb +12 -0
- data/lib/CloudPDF/types/shares_create200response_share_visitor_identity_fields_email.rb +12 -0
- data/lib/CloudPDF/types/shares_create200response_share_visitor_identity_fields_organization.rb +12 -0
- data/lib/CloudPDF/types/shares_create200response_share_visitor_identity_fields_organizational_unit.rb +12 -0
- data/lib/CloudPDF/types/shares_create200response_share_visitor_identity_fields_title.rb +12 -0
- data/lib/CloudPDF/types/{shares_delete_response.rb → shares_delete404response.rb} +2 -2
- data/lib/CloudPDF/types/shares_delete409response.rb +23 -0
- data/lib/CloudPDF/types/shares_exchange200response.rb +4 -0
- data/lib/CloudPDF/types/shares_exchange200response_layer_mode.rb +12 -0
- data/lib/CloudPDF/types/shares_exchange200response_visitor.rb +13 -0
- data/lib/CloudPDF/types/shares_exchange200response_visitor_identity_request.rb +17 -0
- data/lib/CloudPDF/types/shares_exchange200response_visitor_identity_request_fields.rb +17 -0
- data/lib/CloudPDF/types/shares_exchange200response_visitor_identity_request_fields_display_name.rb +12 -0
- data/lib/CloudPDF/types/shares_exchange200response_visitor_identity_request_fields_email.rb +12 -0
- data/lib/CloudPDF/types/shares_exchange200response_visitor_identity_request_fields_organization.rb +12 -0
- data/lib/CloudPDF/types/shares_exchange200response_visitor_identity_request_fields_organizational_unit.rb +12 -0
- data/lib/CloudPDF/types/shares_exchange200response_visitor_identity_request_fields_title.rb +12 -0
- data/lib/CloudPDF/types/shares_exchange200response_visitor_identity_request_invalid_item.rb +15 -0
- data/lib/CloudPDF/types/shares_exchange200response_visitor_identity_request_missing_item.rb +15 -0
- data/lib/CloudPDF/types/shares_get200response_share.rb +11 -1
- data/lib/CloudPDF/types/shares_get200response_share_layer_mode.rb +12 -0
- data/lib/CloudPDF/types/shares_get200response_share_visitor_identity.rb +15 -0
- data/lib/CloudPDF/types/shares_get200response_share_visitor_identity_ask.rb +12 -0
- data/lib/CloudPDF/types/shares_get200response_share_visitor_identity_fields.rb +17 -0
- data/lib/CloudPDF/types/shares_get200response_share_visitor_identity_fields_display_name.rb +12 -0
- data/lib/CloudPDF/types/shares_get200response_share_visitor_identity_fields_email.rb +12 -0
- data/lib/CloudPDF/types/shares_get200response_share_visitor_identity_fields_organization.rb +12 -0
- data/lib/CloudPDF/types/shares_get200response_share_visitor_identity_fields_organizational_unit.rb +12 -0
- data/lib/CloudPDF/types/shares_get200response_share_visitor_identity_fields_title.rb +12 -0
- data/lib/CloudPDF/types/shares_list200response_shares_item.rb +11 -1
- data/lib/CloudPDF/types/shares_list200response_shares_item_layer_mode.rb +12 -0
- data/lib/CloudPDF/types/shares_list200response_shares_item_visitor_identity.rb +15 -0
- data/lib/CloudPDF/types/shares_list200response_shares_item_visitor_identity_ask.rb +12 -0
- data/lib/CloudPDF/types/shares_list200response_shares_item_visitor_identity_fields.rb +17 -0
- data/lib/CloudPDF/types/shares_list200response_shares_item_visitor_identity_fields_display_name.rb +12 -0
- data/lib/CloudPDF/types/shares_list200response_shares_item_visitor_identity_fields_email.rb +12 -0
- data/lib/CloudPDF/types/shares_list200response_shares_item_visitor_identity_fields_organization.rb +12 -0
- data/lib/CloudPDF/types/shares_list200response_shares_item_visitor_identity_fields_organizational_unit.rb +12 -0
- data/lib/CloudPDF/types/shares_list200response_shares_item_visitor_identity_fields_title.rb +12 -0
- data/lib/CloudPDF/types/shares_update200response_share.rb +11 -1
- data/lib/CloudPDF/types/shares_update200response_share_layer_mode.rb +12 -0
- data/lib/CloudPDF/types/shares_update200response_share_visitor_identity.rb +15 -0
- data/lib/CloudPDF/types/shares_update200response_share_visitor_identity_ask.rb +12 -0
- data/lib/CloudPDF/types/shares_update200response_share_visitor_identity_fields.rb +17 -0
- data/lib/CloudPDF/types/shares_update200response_share_visitor_identity_fields_display_name.rb +12 -0
- data/lib/CloudPDF/types/shares_update200response_share_visitor_identity_fields_email.rb +12 -0
- data/lib/CloudPDF/types/shares_update200response_share_visitor_identity_fields_organization.rb +12 -0
- data/lib/CloudPDF/types/shares_update200response_share_visitor_identity_fields_organizational_unit.rb +12 -0
- data/lib/CloudPDF/types/shares_update200response_share_visitor_identity_fields_title.rb +12 -0
- data/lib/CloudPDF/types/shares_update409response.rb +23 -0
- data/lib/CloudPDF/types/shares_visitors_delete_response.rb +23 -0
- data/lib/CloudPDF/types/shares_visitors_list200response.rb +11 -0
- data/lib/CloudPDF/types/shares_visitors_list200response_visitors_item.rb +21 -0
- data/lib/CloudPDF/types/shares_visitors_list200response_visitors_item_answers.rb +17 -0
- data/lib/CloudPDF/types/shares_visitors_list200response_visitors_item_layer.rb +11 -0
- data/lib/CloudPDF/types/shares_visitors_list400response.rb +23 -0
- data/lib/CloudPDF/types/shares_visitors_list404response.rb +23 -0
- data/lib/CloudPDF/version.rb +1 -1
- data/lib/cloudpdf.rb +107 -1
- data/reference.md +591 -1
- metadata +109 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6e95ed59ffc794a7e8f609249f54ae8776c826a6fa0b9ab2924339ff7021c5ca
|
|
4
|
+
data.tar.gz: b029d01ffb43183c13b30f52c9a854e0ee8ae4796bf922a722fc43a695eabba8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 47c9670feae8fd960afb50c873552be12bd6698666f384a36ec4e1ebe8415ea97f6e714e4a630dd0c8694e75578122520f8adf983842b5e2b453a6db2dbf2845
|
|
7
|
+
data.tar.gz: 05e5c4076118baa3cba478feb0f59a0d088b142e795ecb80e02e112adb25c97ed9fb9161886982f4b0884351a4511101cafba8e1c5ccfd8b102b5d8f63ede18d
|
data/.fern/metadata.json
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
"generatorConfig": {
|
|
6
6
|
"moduleName": "CloudPDF"
|
|
7
7
|
},
|
|
8
|
-
"originGitCommit": "
|
|
8
|
+
"originGitCommit": "07aa3f26c82243b36a5ec94f7072130c7298d977",
|
|
9
9
|
"originGitCommitIsDirty": false,
|
|
10
10
|
"invokedBy": "ci",
|
|
11
|
-
"requestedVersion": "3.0.0.alpha.
|
|
11
|
+
"requestedVersion": "3.0.0.alpha.17",
|
|
12
12
|
"ciProvider": "github"
|
|
13
13
|
}
|
data/lib/CloudPDF/doc/client.rb
CHANGED
|
@@ -157,6 +157,61 @@ module CloudPDF
|
|
|
157
157
|
raise error_class.new(response.body, code: code)
|
|
158
158
|
end
|
|
159
159
|
|
|
160
|
+
# The link opens the layer as it is when created: once the layer changes, it answers 404, so create it right
|
|
161
|
+
# before handing it over. It downloads that one file and nothing else, and a password-protected document is
|
|
162
|
+
# checked when the link is created. Deployments that verify tokens with their own keys (JWKS) mint links on their
|
|
163
|
+
# backend: a doc token with `layer_name`, a `download: { docVersion, mode: "incremental" }` claim and a short
|
|
164
|
+
# `exp`, passed as `link` on the versioned download URL.
|
|
165
|
+
#
|
|
166
|
+
# @param request_options [Hash]
|
|
167
|
+
# @param params [CloudPDF::Doc::Types::DocDownloadLinkRequest]
|
|
168
|
+
# @option request_options [String] :base_url
|
|
169
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
170
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
171
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
172
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
173
|
+
# @option params [String] :doc_id
|
|
174
|
+
# @option params [String] :layer_name
|
|
175
|
+
# @option params [String, nil] :document_password
|
|
176
|
+
#
|
|
177
|
+
# @example
|
|
178
|
+
# client.doc.download_link(
|
|
179
|
+
# doc_id: "docId",
|
|
180
|
+
# layer_name: "layerName"
|
|
181
|
+
# )
|
|
182
|
+
#
|
|
183
|
+
# @return [CloudPDF::Types::DocDownloadLink200Response]
|
|
184
|
+
def download_link(request_options: {}, **params)
|
|
185
|
+
params = CloudPDF::Internal::Types::Utils.normalize_keys(params)
|
|
186
|
+
request_data = CloudPDF::Doc::Types::DocDownloadLinkRequest.new(params).to_h
|
|
187
|
+
non_body_param_names = %w[docId layerName X-Document-Password]
|
|
188
|
+
body = request_data.except(*non_body_param_names)
|
|
189
|
+
|
|
190
|
+
headers = {}
|
|
191
|
+
headers["X-Document-Password"] = params[:document_password] if params[:document_password]
|
|
192
|
+
|
|
193
|
+
request = CloudPDF::Internal::JSON::Request.new(
|
|
194
|
+
base_url: request_options[:base_url],
|
|
195
|
+
method: "POST",
|
|
196
|
+
path: "v1/docs/#{URI.encode_uri_component(params[:doc_id].to_s)}/layers/#{URI.encode_uri_component(params[:layer_name].to_s)}/download-link",
|
|
197
|
+
headers: headers,
|
|
198
|
+
body: body,
|
|
199
|
+
request_options: request_options
|
|
200
|
+
)
|
|
201
|
+
begin
|
|
202
|
+
response = @client.send(request)
|
|
203
|
+
rescue Net::HTTPRequestTimeout
|
|
204
|
+
raise CloudPDF::Errors::TimeoutError
|
|
205
|
+
end
|
|
206
|
+
code = response.code.to_i
|
|
207
|
+
if code.between?(200, 299)
|
|
208
|
+
(response.body.to_s.empty? ? nil : CloudPDF::Types::DocDownloadLink200Response.load(response.body))
|
|
209
|
+
else
|
|
210
|
+
error_class = CloudPDF::Errors::ResponseError.subclass_for_code(code)
|
|
211
|
+
raise error_class.new(response.body, code: code)
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
|
|
160
215
|
# @param request_options [Hash]
|
|
161
216
|
# @param params [Hash]
|
|
162
217
|
# @option request_options [String] :base_url
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CloudPDF
|
|
4
|
+
module Doc
|
|
5
|
+
module Types
|
|
6
|
+
class DocDownloadLinkRequest < Internal::Types::Model
|
|
7
|
+
field :doc_id, -> { String }, optional: false, nullable: false, api_name: "docId"
|
|
8
|
+
|
|
9
|
+
field :layer_name, -> { String }, optional: false, nullable: false, api_name: "layerName"
|
|
10
|
+
|
|
11
|
+
field :document_password, -> { String }, optional: true, nullable: false, api_name: "X-Document-Password"
|
|
12
|
+
|
|
13
|
+
field :expires_in, -> { Integer }, optional: true, nullable: false, api_name: "expiresIn"
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -392,6 +392,11 @@ module CloudPDF
|
|
|
392
392
|
raise error_class.new(response.body, code: code)
|
|
393
393
|
end
|
|
394
394
|
end
|
|
395
|
+
|
|
396
|
+
# @return [CloudPDF::Layers::Client]
|
|
397
|
+
def layers
|
|
398
|
+
@layers ||= CloudPDF::Documents::Layers::Client.new(client: @client)
|
|
399
|
+
end
|
|
395
400
|
end
|
|
396
401
|
end
|
|
397
402
|
end
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CloudPDF
|
|
4
|
+
module Documents
|
|
5
|
+
module Layers
|
|
6
|
+
class Client
|
|
7
|
+
# @param client [CloudPDF::Internal::Http::RawClient]
|
|
8
|
+
#
|
|
9
|
+
# @return [void]
|
|
10
|
+
def initialize(client:)
|
|
11
|
+
@client = client
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# @param request_options [Hash]
|
|
15
|
+
# @param params [Hash]
|
|
16
|
+
# @option request_options [String] :base_url
|
|
17
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
18
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
19
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
20
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
21
|
+
# @option params [String] :tenant_id
|
|
22
|
+
# @option params [String] :id
|
|
23
|
+
# @option params [Integer, nil] :limit
|
|
24
|
+
# @option params [String, nil] :cursor
|
|
25
|
+
# @option params [String, nil] :share_id
|
|
26
|
+
#
|
|
27
|
+
# @example
|
|
28
|
+
# client.documents.layers.list(
|
|
29
|
+
# tenant_id: "tenantId",
|
|
30
|
+
# id: "id"
|
|
31
|
+
# )
|
|
32
|
+
#
|
|
33
|
+
# @return [CloudPDF::Types::DocumentsLayersList200Response]
|
|
34
|
+
def list(request_options: {}, **params)
|
|
35
|
+
params = CloudPDF::Internal::Types::Utils.normalize_keys(params)
|
|
36
|
+
query_params = {}
|
|
37
|
+
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
38
|
+
query_params["cursor"] = params[:cursor] if params.key?(:cursor)
|
|
39
|
+
query_params["shareId"] = params[:share_id] if params.key?(:share_id)
|
|
40
|
+
|
|
41
|
+
request = CloudPDF::Internal::JSON::Request.new(
|
|
42
|
+
base_url: request_options[:base_url],
|
|
43
|
+
method: "GET",
|
|
44
|
+
path: "v1/tenants/#{URI.encode_uri_component(params[:tenant_id].to_s)}/documents/#{URI.encode_uri_component(params[:id].to_s)}/layers",
|
|
45
|
+
query: query_params,
|
|
46
|
+
request_options: request_options
|
|
47
|
+
)
|
|
48
|
+
begin
|
|
49
|
+
response = @client.send(request)
|
|
50
|
+
rescue Net::HTTPRequestTimeout
|
|
51
|
+
raise CloudPDF::Errors::TimeoutError
|
|
52
|
+
end
|
|
53
|
+
code = response.code.to_i
|
|
54
|
+
if code.between?(200, 299)
|
|
55
|
+
(response.body.to_s.empty? ? nil : CloudPDF::Types::DocumentsLayersList200Response.load(response.body))
|
|
56
|
+
else
|
|
57
|
+
error_class = CloudPDF::Errors::ResponseError.subclass_for_code(code)
|
|
58
|
+
raise error_class.new(response.body, code: code)
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# @param request_options [Hash]
|
|
63
|
+
# @param params [Hash]
|
|
64
|
+
# @option request_options [String] :base_url
|
|
65
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
66
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
67
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
68
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
69
|
+
# @option params [String] :tenant_id
|
|
70
|
+
# @option params [String] :id
|
|
71
|
+
# @option params [String] :layer_name
|
|
72
|
+
#
|
|
73
|
+
# @example
|
|
74
|
+
# client.documents.layers.delete(
|
|
75
|
+
# tenant_id: "tenantId",
|
|
76
|
+
# id: "id",
|
|
77
|
+
# layer_name: "layerName"
|
|
78
|
+
# )
|
|
79
|
+
#
|
|
80
|
+
# @return [untyped]
|
|
81
|
+
def delete(request_options: {}, **params)
|
|
82
|
+
params = CloudPDF::Internal::Types::Utils.normalize_keys(params)
|
|
83
|
+
request = CloudPDF::Internal::JSON::Request.new(
|
|
84
|
+
base_url: request_options[:base_url],
|
|
85
|
+
method: "DELETE",
|
|
86
|
+
path: "v1/tenants/#{URI.encode_uri_component(params[:tenant_id].to_s)}/documents/#{URI.encode_uri_component(params[:id].to_s)}/layers/#{URI.encode_uri_component(params[:layer_name].to_s)}",
|
|
87
|
+
request_options: request_options
|
|
88
|
+
)
|
|
89
|
+
begin
|
|
90
|
+
response = @client.send(request)
|
|
91
|
+
rescue Net::HTTPRequestTimeout
|
|
92
|
+
raise CloudPDF::Errors::TimeoutError
|
|
93
|
+
end
|
|
94
|
+
code = response.code.to_i
|
|
95
|
+
return if code.between?(200, 299)
|
|
96
|
+
|
|
97
|
+
error_class = CloudPDF::Errors::ResponseError.subclass_for_code(code)
|
|
98
|
+
raise error_class.new(response.body, code: code)
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CloudPDF
|
|
4
|
+
module Documents
|
|
5
|
+
module Layers
|
|
6
|
+
module Types
|
|
7
|
+
class DeleteLayersRequest < Internal::Types::Model
|
|
8
|
+
field :tenant_id, -> { String }, optional: false, nullable: false, api_name: "tenantId"
|
|
9
|
+
|
|
10
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :layer_name, -> { String }, optional: false, nullable: false, api_name: "layerName"
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CloudPDF
|
|
4
|
+
module Documents
|
|
5
|
+
module Layers
|
|
6
|
+
module Types
|
|
7
|
+
class ListLayersRequest < Internal::Types::Model
|
|
8
|
+
field :tenant_id, -> { String }, optional: false, nullable: false, api_name: "tenantId"
|
|
9
|
+
|
|
10
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :limit, -> { Integer }, optional: true, nullable: false
|
|
13
|
+
|
|
14
|
+
field :cursor, -> { String }, optional: true, nullable: false
|
|
15
|
+
|
|
16
|
+
field :share_id, -> { String }, optional: true, nullable: false, api_name: "shareId"
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -12,7 +12,12 @@ module CloudPDF
|
|
|
12
12
|
|
|
13
13
|
# Unauthenticated, but requires a browser Origin header, checked against the grant allowlist. Unknown, revoked,
|
|
14
14
|
# and disabled tokens are indistinguishable (404). Passphrase-protected grants return 422 SharePasswordRequired
|
|
15
|
-
# until `password` is supplied.
|
|
15
|
+
# until `password` is supplied. A link that asks its visitors who they are on open returns 422
|
|
16
|
+
# VisitorIdentityRequired until the required answers are given; `error.details` carries `fields` (what the link
|
|
17
|
+
# asks), `missing`, `invalid`, `purpose` and `privacyUrl`. A link that asks before the first change issues the
|
|
18
|
+
# session at once with `visitor.identityRequest`, and writes answer 403 VisitorIdentityRequired with the same
|
|
19
|
+
# details until the visitor exchanges again with their answers. Answers that can not be taken answer 422 on any
|
|
20
|
+
# link. Mounted only when the deployment can sign (HS256 mode).
|
|
16
21
|
#
|
|
17
22
|
# @param request_options [Hash]
|
|
18
23
|
# @param params [CloudPDF::Shares::Types::SharesExchangeRequest]
|
|
@@ -60,6 +65,7 @@ module CloudPDF
|
|
|
60
65
|
# @option params [Integer, nil] :limit
|
|
61
66
|
# @option params [String, nil] :cursor
|
|
62
67
|
# @option params [String, nil] :doc_id
|
|
68
|
+
# @option params [Boolean, nil] :archived
|
|
63
69
|
#
|
|
64
70
|
# @example
|
|
65
71
|
# client.shares.list(tenant_id: "tenantId")
|
|
@@ -71,6 +77,7 @@ module CloudPDF
|
|
|
71
77
|
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
72
78
|
query_params["cursor"] = params[:cursor] if params.key?(:cursor)
|
|
73
79
|
query_params["docId"] = params[:doc_id] if params.key?(:doc_id)
|
|
80
|
+
query_params["archived"] = params[:archived] if params.key?(:archived)
|
|
74
81
|
|
|
75
82
|
request = CloudPDF::Internal::JSON::Request.new(
|
|
76
83
|
base_url: request_options[:base_url],
|
|
@@ -259,6 +266,54 @@ module CloudPDF
|
|
|
259
266
|
raise error_class.new(response.body, code: code)
|
|
260
267
|
end
|
|
261
268
|
end
|
|
269
|
+
|
|
270
|
+
# Archiving is final: an archived link never exchanges again, and to share again you create a new link. Pausing
|
|
271
|
+
# (`disabled`) is the reversible stop. An archived link no longer counts as using its shared layer, so that layer
|
|
272
|
+
# can be deleted.
|
|
273
|
+
#
|
|
274
|
+
# @param request_options [Hash]
|
|
275
|
+
# @param params [Hash]
|
|
276
|
+
# @option request_options [String] :base_url
|
|
277
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
278
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
279
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
280
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
281
|
+
# @option params [String] :tenant_id
|
|
282
|
+
# @option params [String] :share_id
|
|
283
|
+
#
|
|
284
|
+
# @example
|
|
285
|
+
# client.shares.archive(
|
|
286
|
+
# tenant_id: "tenantId",
|
|
287
|
+
# share_id: "shareId"
|
|
288
|
+
# )
|
|
289
|
+
#
|
|
290
|
+
# @return [CloudPDF::Types::SharesArchive200Response]
|
|
291
|
+
def archive(request_options: {}, **params)
|
|
292
|
+
params = CloudPDF::Internal::Types::Utils.normalize_keys(params)
|
|
293
|
+
request = CloudPDF::Internal::JSON::Request.new(
|
|
294
|
+
base_url: request_options[:base_url],
|
|
295
|
+
method: "POST",
|
|
296
|
+
path: "v1/tenants/#{URI.encode_uri_component(params[:tenant_id].to_s)}/shares/#{URI.encode_uri_component(params[:share_id].to_s)}/archive",
|
|
297
|
+
request_options: request_options
|
|
298
|
+
)
|
|
299
|
+
begin
|
|
300
|
+
response = @client.send(request)
|
|
301
|
+
rescue Net::HTTPRequestTimeout
|
|
302
|
+
raise CloudPDF::Errors::TimeoutError
|
|
303
|
+
end
|
|
304
|
+
code = response.code.to_i
|
|
305
|
+
if code.between?(200, 299)
|
|
306
|
+
(response.body.to_s.empty? ? nil : CloudPDF::Types::SharesArchive200Response.load(response.body))
|
|
307
|
+
else
|
|
308
|
+
error_class = CloudPDF::Errors::ResponseError.subclass_for_code(code)
|
|
309
|
+
raise error_class.new(response.body, code: code)
|
|
310
|
+
end
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
# @return [CloudPDF::Visitors::Client]
|
|
314
|
+
def visitors
|
|
315
|
+
@visitors ||= CloudPDF::Shares::Visitors::Client.new(client: @client)
|
|
316
|
+
end
|
|
262
317
|
end
|
|
263
318
|
end
|
|
264
319
|
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CloudPDF
|
|
4
|
+
module Shares
|
|
5
|
+
module Types
|
|
6
|
+
class ArchiveSharesRequest < Internal::Types::Model
|
|
7
|
+
field :tenant_id, -> { String }, optional: false, nullable: false, api_name: "tenantId"
|
|
8
|
+
|
|
9
|
+
field :share_id, -> { String }, optional: false, nullable: false, api_name: "shareId"
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -11,6 +11,8 @@ module CloudPDF
|
|
|
11
11
|
field :cursor, -> { String }, optional: true, nullable: false
|
|
12
12
|
|
|
13
13
|
field :doc_id, -> { String }, optional: true, nullable: false, api_name: "docId"
|
|
14
|
+
|
|
15
|
+
field :archived, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
14
16
|
end
|
|
15
17
|
end
|
|
16
18
|
end
|
|
@@ -8,8 +8,16 @@ module CloudPDF
|
|
|
8
8
|
|
|
9
9
|
field :doc_id, -> { String }, optional: false, nullable: false, api_name: "docId"
|
|
10
10
|
|
|
11
|
+
field :layer_mode, -> { CloudPDF::Shares::Types::SharesCreateRequestLayerMode }, optional: true, nullable: false, api_name: "layerMode"
|
|
12
|
+
|
|
11
13
|
field :layer_name, -> { String }, optional: true, nullable: false, api_name: "layerName"
|
|
12
14
|
|
|
15
|
+
field :keep_visitor_layers, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "keepVisitorLayers"
|
|
16
|
+
|
|
17
|
+
field :visitor_idle_seconds, -> { Integer }, optional: true, nullable: false, api_name: "visitorIdleSeconds"
|
|
18
|
+
|
|
19
|
+
field :visitor_identity, -> { CloudPDF::Shares::Types::SharesCreateRequestVisitorIdentity }, optional: true, nullable: false, api_name: "visitorIdentity"
|
|
20
|
+
|
|
13
21
|
field :scope, -> { Internal::Types::Array[String] }, optional: false, nullable: false
|
|
14
22
|
|
|
15
23
|
field :origins, -> { Internal::Types::Array[String] }, optional: true, nullable: false
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CloudPDF
|
|
4
|
+
module Shares
|
|
5
|
+
module Types
|
|
6
|
+
class SharesCreateRequestVisitorIdentity < Internal::Types::Model
|
|
7
|
+
field :fields, -> { CloudPDF::Shares::Types::SharesCreateRequestVisitorIdentityFields }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :ask, -> { CloudPDF::Shares::Types::SharesCreateRequestVisitorIdentityAsk }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :purpose, -> { String }, optional: true, nullable: false
|
|
12
|
+
|
|
13
|
+
field :privacy_url, -> { String }, optional: true, nullable: false, api_name: "privacyUrl"
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CloudPDF
|
|
4
|
+
module Shares
|
|
5
|
+
module Types
|
|
6
|
+
module SharesCreateRequestVisitorIdentityAsk
|
|
7
|
+
extend CloudPDF::Internal::Types::Enum
|
|
8
|
+
|
|
9
|
+
ON_OPEN = "on-open"
|
|
10
|
+
BEFORE_FIRST_CHANGE = "before-first-change"
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CloudPDF
|
|
4
|
+
module Shares
|
|
5
|
+
module Types
|
|
6
|
+
class SharesCreateRequestVisitorIdentityFields < Internal::Types::Model
|
|
7
|
+
field :display_name, -> { CloudPDF::Shares::Types::SharesCreateRequestVisitorIdentityFieldsDisplayName }, optional: true, nullable: false, api_name: "displayName"
|
|
8
|
+
|
|
9
|
+
field :email, -> { CloudPDF::Shares::Types::SharesCreateRequestVisitorIdentityFieldsEmail }, optional: true, nullable: false
|
|
10
|
+
|
|
11
|
+
field :title, -> { CloudPDF::Shares::Types::SharesCreateRequestVisitorIdentityFieldsTitle }, optional: true, nullable: false
|
|
12
|
+
|
|
13
|
+
field :organization, -> { CloudPDF::Shares::Types::SharesCreateRequestVisitorIdentityFieldsOrganization }, optional: true, nullable: false
|
|
14
|
+
|
|
15
|
+
field :organizational_unit, -> { CloudPDF::Shares::Types::SharesCreateRequestVisitorIdentityFieldsOrganizationalUnit }, optional: true, nullable: false, api_name: "organizationalUnit"
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CloudPDF
|
|
4
|
+
module Shares
|
|
5
|
+
module Types
|
|
6
|
+
module SharesCreateRequestVisitorIdentityFieldsDisplayName
|
|
7
|
+
extend CloudPDF::Internal::Types::Enum
|
|
8
|
+
|
|
9
|
+
REQUIRED = "required"
|
|
10
|
+
OPTIONAL = "optional"
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CloudPDF
|
|
4
|
+
module Shares
|
|
5
|
+
module Types
|
|
6
|
+
module SharesCreateRequestVisitorIdentityFieldsEmail
|
|
7
|
+
extend CloudPDF::Internal::Types::Enum
|
|
8
|
+
|
|
9
|
+
REQUIRED = "required"
|
|
10
|
+
OPTIONAL = "optional"
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CloudPDF
|
|
4
|
+
module Shares
|
|
5
|
+
module Types
|
|
6
|
+
module SharesCreateRequestVisitorIdentityFieldsOrganization
|
|
7
|
+
extend CloudPDF::Internal::Types::Enum
|
|
8
|
+
|
|
9
|
+
REQUIRED = "required"
|
|
10
|
+
OPTIONAL = "optional"
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
data/lib/CloudPDF/shares/types/shares_create_request_visitor_identity_fields_organizational_unit.rb
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CloudPDF
|
|
4
|
+
module Shares
|
|
5
|
+
module Types
|
|
6
|
+
module SharesCreateRequestVisitorIdentityFieldsOrganizationalUnit
|
|
7
|
+
extend CloudPDF::Internal::Types::Enum
|
|
8
|
+
|
|
9
|
+
REQUIRED = "required"
|
|
10
|
+
OPTIONAL = "optional"
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CloudPDF
|
|
4
|
+
module Shares
|
|
5
|
+
module Types
|
|
6
|
+
module SharesCreateRequestVisitorIdentityFieldsTitle
|
|
7
|
+
extend CloudPDF::Internal::Types::Enum
|
|
8
|
+
|
|
9
|
+
REQUIRED = "required"
|
|
10
|
+
OPTIONAL = "optional"
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -7,6 +7,12 @@ module CloudPDF
|
|
|
7
7
|
field :share_token, -> { String }, optional: false, nullable: false, api_name: "shareToken"
|
|
8
8
|
|
|
9
9
|
field :password, -> { String }, optional: true, nullable: false
|
|
10
|
+
|
|
11
|
+
field :visitor_handle, -> { String }, optional: true, nullable: false, api_name: "visitorHandle"
|
|
12
|
+
|
|
13
|
+
field :restart, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
14
|
+
|
|
15
|
+
field :visitor_identity, -> { CloudPDF::Shares::Types::SharesExchangeRequestVisitorIdentity }, optional: true, nullable: false, api_name: "visitorIdentity"
|
|
10
16
|
end
|
|
11
17
|
end
|
|
12
18
|
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CloudPDF
|
|
4
|
+
module Shares
|
|
5
|
+
module Types
|
|
6
|
+
class SharesExchangeRequestVisitorIdentity < Internal::Types::Model
|
|
7
|
+
field :display_name, -> { String }, optional: true, nullable: false, api_name: "displayName"
|
|
8
|
+
|
|
9
|
+
field :email, -> { String }, optional: true, nullable: false
|
|
10
|
+
|
|
11
|
+
field :title, -> { String }, optional: true, nullable: false
|
|
12
|
+
|
|
13
|
+
field :organization, -> { String }, optional: true, nullable: false
|
|
14
|
+
|
|
15
|
+
field :organizational_unit, -> { String }, optional: true, nullable: false, api_name: "organizationalUnit"
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -8,6 +8,16 @@ module CloudPDF
|
|
|
8
8
|
|
|
9
9
|
field :share_id, -> { String }, optional: false, nullable: false, api_name: "shareId"
|
|
10
10
|
|
|
11
|
+
field :layer_mode, -> { CloudPDF::Shares::Types::SharesUpdateRequestLayerMode }, optional: true, nullable: false, api_name: "layerMode"
|
|
12
|
+
|
|
13
|
+
field :layer_name, -> { String }, optional: true, nullable: false, api_name: "layerName"
|
|
14
|
+
|
|
15
|
+
field :keep_visitor_layers, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "keepVisitorLayers"
|
|
16
|
+
|
|
17
|
+
field :visitor_idle_seconds, -> { Integer }, optional: true, nullable: false, api_name: "visitorIdleSeconds"
|
|
18
|
+
|
|
19
|
+
field :visitor_identity, -> { CloudPDF::Shares::Types::SharesUpdateRequestVisitorIdentity }, optional: true, nullable: false, api_name: "visitorIdentity"
|
|
20
|
+
|
|
11
21
|
field :scope, -> { Internal::Types::Array[String] }, optional: true, nullable: false
|
|
12
22
|
|
|
13
23
|
field :origins, -> { Internal::Types::Array[String] }, optional: true, nullable: false
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CloudPDF
|
|
4
|
+
module Shares
|
|
5
|
+
module Types
|
|
6
|
+
class SharesUpdateRequestVisitorIdentity < Internal::Types::Model
|
|
7
|
+
field :fields, -> { CloudPDF::Shares::Types::SharesUpdateRequestVisitorIdentityFields }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :ask, -> { CloudPDF::Shares::Types::SharesUpdateRequestVisitorIdentityAsk }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :purpose, -> { String }, optional: true, nullable: false
|
|
12
|
+
|
|
13
|
+
field :privacy_url, -> { String }, optional: true, nullable: false, api_name: "privacyUrl"
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CloudPDF
|
|
4
|
+
module Shares
|
|
5
|
+
module Types
|
|
6
|
+
module SharesUpdateRequestVisitorIdentityAsk
|
|
7
|
+
extend CloudPDF::Internal::Types::Enum
|
|
8
|
+
|
|
9
|
+
ON_OPEN = "on-open"
|
|
10
|
+
BEFORE_FIRST_CHANGE = "before-first-change"
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CloudPDF
|
|
4
|
+
module Shares
|
|
5
|
+
module Types
|
|
6
|
+
class SharesUpdateRequestVisitorIdentityFields < Internal::Types::Model
|
|
7
|
+
field :display_name, -> { CloudPDF::Shares::Types::SharesUpdateRequestVisitorIdentityFieldsDisplayName }, optional: true, nullable: false, api_name: "displayName"
|
|
8
|
+
|
|
9
|
+
field :email, -> { CloudPDF::Shares::Types::SharesUpdateRequestVisitorIdentityFieldsEmail }, optional: true, nullable: false
|
|
10
|
+
|
|
11
|
+
field :title, -> { CloudPDF::Shares::Types::SharesUpdateRequestVisitorIdentityFieldsTitle }, optional: true, nullable: false
|
|
12
|
+
|
|
13
|
+
field :organization, -> { CloudPDF::Shares::Types::SharesUpdateRequestVisitorIdentityFieldsOrganization }, optional: true, nullable: false
|
|
14
|
+
|
|
15
|
+
field :organizational_unit, -> { CloudPDF::Shares::Types::SharesUpdateRequestVisitorIdentityFieldsOrganizationalUnit }, optional: true, nullable: false, api_name: "organizationalUnit"
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|