Skip to content

Commit 6680b75

Browse files
Merge pull request #2 from kaferi/master
Add Storage methods
2 parents b4cf86b + 4559266 commit 6680b75

File tree

255 files changed

+2252
-456
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

255 files changed

+2252
-456
lines changed

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Aspose.PDF Cloud
22
- API version: 2.0
3-
- Package version: 18.11.0
3+
- Package version: 18.12.0
44

55
[Aspose.PDF Cloud](https://products.aspose.cloud/pdf) is a true REST API that enables you to perform a wide range of document processing operations including creation, manipulation, conversion and rendering of PDF documents in the cloud.
66

@@ -55,6 +55,8 @@ Class | Method | HTTP request | Description
5555
*PdfApi* | [**DeleteDocumentAnnotations**](docs/PdfApi.md#deletedocumentannotations) | **Delete** /pdf/{name}/annotations | Delete all annotations from the document
5656
*PdfApi* | [**DeleteDocumentLinkAnnotations**](docs/PdfApi.md#deletedocumentlinkannotations) | **Delete** /pdf/{name}/links | Delete all link annotations from the document
5757
*PdfApi* | [**DeleteField**](docs/PdfApi.md#deletefield) | **Delete** /pdf/{name}/fields/{fieldName} | Delete document field by name.
58+
*PdfApi* | [**DeleteFile**](docs/PdfApi.md#deletefile) | **Delete** /storage/file | Remove a specific file
59+
*PdfApi* | [**DeleteFolder**](docs/PdfApi.md#deletefolder) | **Delete** /storage/folder | Remove a specific folder
5860
*PdfApi* | [**DeleteImage**](docs/PdfApi.md#deleteimage) | **Delete** /pdf/{name}/images/{imageId} | Delete image from document page.
5961
*PdfApi* | [**DeleteLinkAnnotation**](docs/PdfApi.md#deletelinkannotation) | **Delete** /pdf/{name}/links/{linkId} | Delete document page link annotation by ID
6062
*PdfApi* | [**DeletePage**](docs/PdfApi.md#deletepage) | **Delete** /pdf/{name}/pages/{pageNumber} | Delete document page by its number.
@@ -64,6 +66,7 @@ Class | Method | HTTP request | Description
6466
*PdfApi* | [**DeleteProperty**](docs/PdfApi.md#deleteproperty) | **Delete** /pdf/{name}/documentproperties/{propertyName} | Delete document property.
6567
*PdfApi* | [**GetCaretAnnotation**](docs/PdfApi.md#getcaretannotation) | **Get** /pdf/{name}/annotations/caret/{annotationId} | Read document page caret annotation by ID.
6668
*PdfApi* | [**GetCircleAnnotation**](docs/PdfApi.md#getcircleannotation) | **Get** /pdf/{name}/annotations/circle/{annotationId} | Read document page circle annotation by ID.
69+
*PdfApi* | [**GetDiscUsage**](docs/PdfApi.md#getdiscusage) | **Get** /storage/disc | Check the disk usage of the current account
6770
*PdfApi* | [**GetDocument**](docs/PdfApi.md#getdocument) | **Get** /pdf/{name} | Read common document info.
6871
*PdfApi* | [**GetDocumentAnnotations**](docs/PdfApi.md#getdocumentannotations) | **Get** /pdf/{name}/annotations | Read documant page annotations. Returns only FreeTextAnnotations, TextAnnotations, other annotations will implemented next releases.
6972
*PdfApi* | [**GetDocumentAttachmentByIndex**](docs/PdfApi.md#getdocumentattachmentbyindex) | **Get** /pdf/{name}/attachments/{attachmentIndex} | Read document attachment info by its index.
@@ -101,9 +104,12 @@ Class | Method | HTTP request | Description
101104
*PdfApi* | [**GetImageExtractAsTiff**](docs/PdfApi.md#getimageextractastiff) | **Get** /pdf/{name}/images/{imageId}/extract/tiff | Extract document image in TIFF format
102105
*PdfApi* | [**GetImages**](docs/PdfApi.md#getimages) | **Get** /pdf/{name}/pages/{pageNumber}/images | Read document images.
103106
*PdfApi* | [**GetInkAnnotation**](docs/PdfApi.md#getinkannotation) | **Get** /pdf/{name}/annotations/ink/{annotationId} | Read document page ink annotation by ID.
107+
*PdfApi* | [**GetIsExist**](docs/PdfApi.md#getisexist) | **Get** /storage/exist | Check if a specific file or folder exists
108+
*PdfApi* | [**GetIsStorageExist**](docs/PdfApi.md#getisstorageexist) | **Get** /storage/{name}/exist | Check if storage exists
104109
*PdfApi* | [**GetLaTeXInStorageToPdf**](docs/PdfApi.md#getlatexinstoragetopdf) | **Get** /pdf/create/latex | Convert LaTeX file (located on storage) to PDF format and return resulting file in response.
105110
*PdfApi* | [**GetLineAnnotation**](docs/PdfApi.md#getlineannotation) | **Get** /pdf/{name}/annotations/line/{annotationId} | Read document page line annotation by ID.
106111
*PdfApi* | [**GetLinkAnnotation**](docs/PdfApi.md#getlinkannotation) | **Get** /pdf/{name}/links/{linkId} | Read document link annotation by ID.
112+
*PdfApi* | [**GetListFileVersions**](docs/PdfApi.md#getlistfileversions) | **Get** /storage/version | Get the file's versions list
107113
*PdfApi* | [**GetListFiles**](docs/PdfApi.md#getlistfiles) | **Get** /storage/folder | Get the file listing of a specific folder
108114
*PdfApi* | [**GetMhtInStorageToPdf**](docs/PdfApi.md#getmhtinstoragetopdf) | **Get** /pdf/create/mht | Convert MHT file (located on storage) to PDF format and return resulting file in response.
109115
*PdfApi* | [**GetPage**](docs/PdfApi.md#getpage) | **Get** /pdf/{name}/pages/{pageNumber} | Read document page info.
@@ -166,7 +172,10 @@ Class | Method | HTTP request | Description
166172
*PdfApi* | [**PostAppendDocument**](docs/PdfApi.md#postappenddocument) | **Post** /pdf/{name}/appendDocument | Append document to existing one.
167173
*PdfApi* | [**PostCreateField**](docs/PdfApi.md#postcreatefield) | **Post** /pdf/{name}/fields | Create field.
168174
*PdfApi* | [**PostDocumentTextReplace**](docs/PdfApi.md#postdocumenttextreplace) | **Post** /pdf/{name}/text/replace | Document's replace text method.
175+
*PdfApi* | [**PostFlattenDocument**](docs/PdfApi.md#postflattendocument) | **Post** /pdf/{name}/flatten | Removes all fields from the document and place their values instead.
169176
*PdfApi* | [**PostInsertImage**](docs/PdfApi.md#postinsertimage) | **Post** /pdf/{name}/pages/{pageNumber}/images | Insert image to document page.
177+
*PdfApi* | [**PostMoveFile**](docs/PdfApi.md#postmovefile) | **Post** /storage/file | Move a specific file
178+
*PdfApi* | [**PostMoveFolder**](docs/PdfApi.md#postmovefolder) | **Post** /storage/folder | Move a specific folder
170179
*PdfApi* | [**PostMovePage**](docs/PdfApi.md#postmovepage) | **Post** /pdf/{name}/pages/{pageNumber}/movePage | Move page to new position.
171180
*PdfApi* | [**PostOptimizeDocument**](docs/PdfApi.md#postoptimizedocument) | **Post** /pdf/{name}/optimize | Optimize document.
172181
*PdfApi* | [**PostPageCaretAnnotations**](docs/PdfApi.md#postpagecaretannotations) | **Post** /pdf/{name}/pages/{pageNumber}/annotations/caret | Add document page caret annotations.
@@ -194,6 +203,7 @@ Class | Method | HTTP request | Description
194203
*PdfApi* | [**PutCircleAnnotation**](docs/PdfApi.md#putcircleannotation) | **Put** /pdf/{name}/annotations/circle/{annotationId} | Replace document circle annotation
195204
*PdfApi* | [**PutCreate**](docs/PdfApi.md#putcreate) | **Put** /storage/file | Upload a specific file
196205
*PdfApi* | [**PutCreateDocument**](docs/PdfApi.md#putcreatedocument) | **Put** /pdf/{name} | Create empty document.
206+
*PdfApi* | [**PutCreateFolder**](docs/PdfApi.md#putcreatefolder) | **Put** /storage/folder | Create the folder
197207
*PdfApi* | [**PutEpubInStorageToPdf**](docs/PdfApi.md#putepubinstoragetopdf) | **Put** /pdf/{name}/create/epub | Convert EPUB file (located on storage) to PDF format and upload resulting file to storage.
198208
*PdfApi* | [**PutFieldsFlatten**](docs/PdfApi.md#putfieldsflatten) | **Put** /pdf/{name}/fields/flatten | Flatten form fields in document.
199209
*PdfApi* | [**PutFreeTextAnnotation**](docs/PdfApi.md#putfreetextannotation) | **Put** /pdf/{name}/annotations/freetext/{annotationId} | Replace document free text annotation
@@ -284,12 +294,14 @@ Class | Method | HTTP request | Description
284294
- [Color](docs/Color.md)
285295
- [ColorDepth](docs/ColorDepth.md)
286296
- [CompressionType](docs/CompressionType.md)
297+
- [DiscUsage](docs/DiscUsage.md)
287298
- [DocFormat](docs/DocFormat.md)
288299
- [DocRecognitionMode](docs/DocRecognitionMode.md)
289300
- [DocumentPrivilege](docs/DocumentPrivilege.md)
290301
- [EpubRecognitionMode](docs/EpubRecognitionMode.md)
291302
- [FieldType](docs/FieldType.md)
292303
- [File](docs/File.md)
304+
- [FileExist](docs/FileExist.md)
293305
- [FontEncodingRules](docs/FontEncodingRules.md)
294306
- [FontSavingModes](docs/FontSavingModes.md)
295307
- [FontStyles](docs/FontStyles.md)
@@ -319,7 +331,7 @@ Class | Method | HTTP request | Description
319331
- [Point](docs/Point.md)
320332
- [PolyIntent](docs/PolyIntent.md)
321333
- [RasterImagesSavingModes](docs/RasterImagesSavingModes.md)
322-
- [RectanglePdf](docs/RectanglePdf.md)
334+
- [Rectangle](docs/Rectangle.md)
323335
- [Rotation](docs/Rotation.md)
324336
- [Segment](docs/Segment.md)
325337
- [ShapeType](docs/ShapeType.md)
@@ -353,6 +365,7 @@ Class | Method | HTTP request | Description
353365
- [CircleAnnotationResponse](docs/CircleAnnotationResponse.md)
354366
- [CircleAnnotations](docs/CircleAnnotations.md)
355367
- [CircleAnnotationsResponse](docs/CircleAnnotationsResponse.md)
368+
- [DiscUsageResponse](docs/DiscUsageResponse.md)
356369
- [Document](docs/Document.md)
357370
- [DocumentPageResponse](docs/DocumentPageResponse.md)
358371
- [DocumentPagesResponse](docs/DocumentPagesResponse.md)
@@ -365,6 +378,9 @@ Class | Method | HTTP request | Description
365378
- [FieldResponse](docs/FieldResponse.md)
366379
- [Fields](docs/Fields.md)
367380
- [FieldsResponse](docs/FieldsResponse.md)
381+
- [FileExistResponse](docs/FileExistResponse.md)
382+
- [FileVersion](docs/FileVersion.md)
383+
- [FileVersionsResponse](docs/FileVersionsResponse.md)
368384
- [FilesResponse](docs/FilesResponse.md)
369385
- [FreeTextAnnotationResponse](docs/FreeTextAnnotationResponse.md)
370386
- [FreeTextAnnotations](docs/FreeTextAnnotations.md)
@@ -406,6 +422,7 @@ Class | Method | HTTP request | Description
406422
- [SquigglyAnnotationResponse](docs/SquigglyAnnotationResponse.md)
407423
- [SquigglyAnnotations](docs/SquigglyAnnotations.md)
408424
- [SquigglyAnnotationsResponse](docs/SquigglyAnnotationsResponse.md)
425+
- [StorageExistResponse](docs/StorageExistResponse.md)
409426
- [StrikeOutAnnotationResponse](docs/StrikeOutAnnotationResponse.md)
410427
- [StrikeOutAnnotations](docs/StrikeOutAnnotations.md)
411428
- [StrikeOutAnnotationsResponse](docs/StrikeOutAnnotationsResponse.md)

annotation.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ package asposepdfcloud
2424
type Annotation struct {
2525
// Link to the document.
2626
Links []Link `json:"Links,omitempty"`
27+
// Color of the annotation.
28+
Color *Color `json:"Color,omitempty"`
2729
// Get the annotation content.
2830
Contents string `json:"Contents,omitempty"`
2931
// The date and time when the annotation was last modified.
@@ -35,7 +37,7 @@ type Annotation struct {
3537
// Gets Name of the annotation.
3638
Name string `json:"Name,omitempty"`
3739
// Gets Rect of the annotation.
38-
Rect *RectanglePdf `json:"Rect,omitempty"`
40+
Rect *Rectangle `json:"Rect,omitempty"`
3941
// Gets PageIndex of the annotation.
4042
PageIndex int32 `json:"PageIndex,omitempty"`
4143
// Gets ZIndex of the annotation.

annotation_info.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ package asposepdfcloud
2424
type AnnotationInfo struct {
2525
// Link to the document.
2626
Links []Link `json:"Links,omitempty"`
27+
// Color of the annotation.
28+
Color *Color `json:"Color,omitempty"`
2729
// Get the annotation content.
2830
Contents string `json:"Contents,omitempty"`
2931
// The date and time when the annotation was last modified.
@@ -35,7 +37,7 @@ type AnnotationInfo struct {
3537
// Gets Name of the annotation.
3638
Name string `json:"Name,omitempty"`
3739
// Gets Rect of the annotation.
38-
Rect *RectanglePdf `json:"Rect,omitempty"`
40+
Rect *Rectangle `json:"Rect,omitempty"`
3941
// Gets PageIndex of the annotation.
4042
PageIndex int32 `json:"PageIndex,omitempty"`
4143
// Gets ZIndex of the annotation.

annotations_info.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
*/
2121
package asposepdfcloud
2222

23-
// List of annotations.
23+
// Object representing a list of annotation info objects.
2424
type AnnotationsInfo struct {
2525
// Link to the document.
2626
Links []Link `json:"Links,omitempty"`
27+
// List of annotation info objects.
2728
List []AnnotationInfo `json:"List,omitempty"`
2829
}

annotations_info_response.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020
*/
2121
package asposepdfcloud
2222

23+
// Represents multiple annotations info reponse
2324
type AnnotationsInfoResponse struct {
2425
// Response status code.
2526
Code int32 `json:"Code"`
2627
// Response status.
2728
Status string `json:"Status,omitempty"`
29+
// Annotations info
2830
Annotations *AnnotationsInfo `json:"Annotations,omitempty"`
2931
}

api_client.go

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,35 @@ func deserializeDTO(readCloser io.Reader, successPayload interface{}) error {
465465
ret.Files[index] = f
466466
}
467467

468+
} else if strings.Contains(dtoType, "FileVersionsResponse") {
469+
var temp FileVersionsResponse_
470+
ret := successPayload.(*FileVersionsResponse)
471+
if err := json.NewDecoder(readCloser).Decode(&temp); err != nil {
472+
return err
473+
}
474+
ret.Code = temp.Code
475+
ret.Status = temp.Status
476+
ret.FileVersions = make([]FileVersion, len(temp.FileVersions))
477+
re := regexp.MustCompile("\\/Date\\((\\d+?)000\\+0000\\)\\/")
478+
479+
for index, fileVersion := range temp.FileVersions {
480+
res := re.FindAllStringSubmatch(fileVersion.ModifiedDate, -1)
481+
var f FileVersion
482+
f.Name = fileVersion.Name
483+
f.IsFolder = fileVersion.IsFolder
484+
f.Size = fileVersion.Size
485+
f.Path = fileVersion.Path
486+
f.IsLatest = fileVersion.IsLatest
487+
f.VersionId = fileVersion.VersionId
488+
if res != nil {
489+
i, err := strconv.ParseInt(res[0][1], 10, 64)
490+
if err == nil {
491+
f.ModifiedDate = time.Unix(i, 0)
492+
}
493+
}
494+
ret.FileVersions[index] = f
495+
}
496+
468497
} else {
469498
return json.NewDecoder(readCloser).Decode(&successPayload)
470499
}
@@ -487,6 +516,24 @@ type File_ struct {
487516
Path string `json:"Path,omitempty"`
488517
}
489518

519+
type FileVersionsResponse_ struct {
520+
// Response status code.
521+
Code int32 `json:"Code"`
522+
// Response status.
523+
Status string `json:"Status,omitempty"`
524+
FileVersions []FileVersion_ `json:"FileVersions,omitempty"`
525+
}
526+
527+
type FileVersion_ struct {
528+
Name string `json:"Name,omitempty"`
529+
IsFolder bool `json:"IsFolder"`
530+
ModifiedDate string `json:"ModifiedDate,omitempty"`
531+
Size int64 `json:"Size"`
532+
Path string `json:"Path,omitempty"`
533+
VersionId string `json:"VersionId,omitempty"`
534+
IsLatest bool `json:"IsLatest,omitempty"`
535+
}
536+
490537
// TokenResp represents data returned by GetAccessToken and RefreshToken as HTTP response body.
491538
type TokenResp struct {
492539
AccessToken string `json:"access_token"`

attachment_response.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020
*/
2121
package asposepdfcloud
2222

23+
// Represents response containing single attachment info
2324
type AttachmentResponse struct {
2425
// Response status code.
2526
Code int32 `json:"Code"`
2627
// Response status.
2728
Status string `json:"Status,omitempty"`
29+
// Attachment object
2830
Attachment *Attachment `json:"Attachment,omitempty"`
2931
}

attachments.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
*/
2121
package asposepdfcloud
2222

23-
// List of attachment.
23+
// Represents list of attachment.
2424
type Attachments struct {
2525
// Link to the document.
2626
Links []Link `json:"Links,omitempty"`
27+
// List of annotations.
2728
List []LinkElement `json:"List,omitempty"`
2829
}

attachments_response.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020
*/
2121
package asposepdfcloud
2222

23+
// Represents response containing multiple attachments info
2324
type AttachmentsResponse struct {
2425
// Response status code.
2526
Code int32 `json:"Code"`
2627
// Response status.
2728
Status string `json:"Status,omitempty"`
29+
// Attachments object
2830
Attachments *Attachments `json:"Attachments,omitempty"`
2931
}

caret_annotation.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ package asposepdfcloud
2424
type CaretAnnotation struct {
2525
// Link to the document.
2626
Links []Link `json:"Links,omitempty"`
27+
// Color of the annotation.
28+
Color *Color `json:"Color,omitempty"`
2729
// Get the annotation content.
2830
Contents string `json:"Contents,omitempty"`
2931
// The date and time when the annotation was last modified.
@@ -35,7 +37,7 @@ type CaretAnnotation struct {
3537
// Gets Name of the annotation.
3638
Name string `json:"Name,omitempty"`
3739
// Gets Rect of the annotation.
38-
Rect *RectanglePdf `json:"Rect,omitempty"`
40+
Rect *Rectangle `json:"Rect,omitempty"`
3941
// Gets PageIndex of the annotation.
4042
PageIndex int32 `json:"PageIndex,omitempty"`
4143
// Gets ZIndex of the annotation.
@@ -52,10 +54,8 @@ type CaretAnnotation struct {
5254
Title string `json:"Title,omitempty"`
5355
// Get the annotation RichText.
5456
RichText string `json:"RichText,omitempty"`
55-
// Color of the annotation.
56-
Color *Color `json:"Color,omitempty"`
5757
// Gets or sets caret rectangle.
58-
Frame *RectanglePdf `json:"Frame,omitempty"`
58+
Frame *Rectangle `json:"Frame,omitempty"`
5959
// Gets or sets symbol associated with caret.
6060
Symbol CaretSymbol `json:"Symbol,omitempty"`
6161
}

0 commit comments

Comments
 (0)