Skip to content

Commit e8549c1

Browse files
committed
Updated sources
1 parent 425e700 commit e8549c1

7 files changed

Lines changed: 244 additions & 7 deletions

File tree

src/GroupDocs.Annotation.Cloud.Sdk.Test/Api/AnnotationApiTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ public void TestExtract(string filePath)
5353

5454
[TestCase(@"cells\one-page.xlsx")]
5555
[TestCase(@"diagram\one-page.vsd")]
56-
[TestCase(@"email\one-page.emlx")]
5756
[TestCase(@"images\one-page.png")]
5857
[TestCase(@"pdf\one-page.pdf")]
5958
[TestCase(@"slides\one-page.pptx")]
@@ -111,7 +110,6 @@ public void TestRemoveAnnotations(string filePath)
111110

112111
[TestCase(@"cells\one-page.xlsx")]
113112
[TestCase(@"diagram\one-page.vsd")]
114-
[TestCase(@"email\one-page.emlx")]
115113
[TestCase(@"images\one-page.png")]
116114
[TestCase(@"pdf\one-page.pdf")]
117115
[TestCase(@"slides\one-page.pptx")]

src/GroupDocs.Annotation.Cloud.Sdk.Test/GroupDocs.Annotation.Cloud.Sdk.Test.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="NUnit" Version="3.12.0" />
8+
<PackageReference Include="NUnit" Version="3.13.2" />
9+
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
910
</ItemGroup>
1011

1112
<ItemGroup>
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
// --------------------------------------------------------------------------------------------------------------------
2+
// <copyright company="Aspose Pty Ltd" file="LicenseApi.cs">
3+
// Copyright (c) 2003-2021 Aspose Pty Ltd
4+
// </copyright>
5+
// <summary>
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files (the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions:
12+
//
13+
// The above copyright notice and this permission notice shall be included in all
14+
// copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
// SOFTWARE.
23+
// </summary>
24+
// --------------------------------------------------------------------------------------------------------------------
25+
26+
namespace GroupDocs.Annotation.Cloud.Sdk.Api
27+
{
28+
using System.Collections.Generic;
29+
using System.Text.RegularExpressions;
30+
using GroupDocs.Annotation.Cloud.Sdk.Client;
31+
using GroupDocs.Annotation.Cloud.Sdk.Client.RequestHandlers;
32+
using GroupDocs.Annotation.Cloud.Sdk.Model;
33+
using GroupDocs.Annotation.Cloud.Sdk.Model.Requests;
34+
35+
/// <summary>
36+
/// GroupDocs.Annotation.Cloud.Sdk API.
37+
/// </summary>
38+
public class LicenseApi
39+
{
40+
private readonly ApiInvoker apiInvoker;
41+
private readonly Configuration configuration;
42+
43+
/// <summary>
44+
/// Initializes a new instance of the <see cref="LicenseApi"/> class.
45+
/// </summary>
46+
/// <param name="appSid">Application identifier (App SID)</param>
47+
/// <param name="appKey">Application private key (App Key)</param>
48+
public LicenseApi(string appSid, string appKey)
49+
: this(new Configuration(appSid, appKey))
50+
{
51+
}
52+
53+
/// <summary>
54+
/// Initializes a new instance of the <see cref="LicenseApi"/> class.
55+
/// </summary>
56+
/// <param name="configuration">Configuration settings</param>
57+
public LicenseApi(Configuration configuration)
58+
{
59+
this.configuration = configuration;
60+
61+
var requestHandlers = new List<IRequestHandler>();
62+
requestHandlers.Add(new AuthRequestHandler(this.configuration));
63+
requestHandlers.Add(new DebugLogRequestHandler(this.configuration));
64+
requestHandlers.Add(new ApiExceptionRequestHandler());
65+
this.apiInvoker = new ApiInvoker(requestHandlers, this.configuration.Timeout);
66+
}
67+
68+
/// <summary>
69+
/// Get license consumption
70+
/// </summary>
71+
/// <returns><see cref="ConsumptionResult"/></returns>
72+
public ConsumptionResult GetConsumptionCredit()
73+
{
74+
// create path and map variables
75+
var resourcePath = this.configuration.GetServerUrl() + "/annotation/consumption";
76+
resourcePath = Regex
77+
.Replace(resourcePath, "\\*", string.Empty)
78+
.Replace("&amp;", "&")
79+
.Replace("/?", "?");
80+
81+
var response = this.apiInvoker.InvokeApi(
82+
resourcePath,
83+
"GET",
84+
null,
85+
null,
86+
null);
87+
88+
if (response != null)
89+
{
90+
return (ConsumptionResult)SerializationHelper.Deserialize(response, typeof(ConsumptionResult));
91+
}
92+
93+
return null;
94+
}
95+
}
96+
}

src/GroupDocs.Annotation.Cloud.Sdk/GroupDocs.Annotation.Cloud.Sdk.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
44
<TargetFrameworks>netstandard2.0;net20</TargetFrameworks>
5-
<AssemblyVersion>21.6.0.0</AssemblyVersion>
6-
<FileVersion>21.6.0.0</FileVersion>
7-
<Version>21.6</Version>
5+
<AssemblyVersion>22.2.0.0</AssemblyVersion>
6+
<FileVersion>22.2.0.0</FileVersion>
7+
<Version>22.2</Version>
88
<StyleCopTreatErrorsAsWarnings>false</StyleCopTreatErrorsAsWarnings>
99
<Company>GroupDocs</Company>
1010
<Authors>GroupDocs Product Team</Authors>

src/GroupDocs.Annotation.Cloud.Sdk/GroupDocs.Annotation.Cloud.Sdk.xml

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/GroupDocs.Annotation.Cloud.Sdk/Model/AnnotationInfo.cs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,12 @@ public enum TypeEnum
184184
/// <summary>
185185
/// Enum Image for "Image"
186186
/// </summary>
187-
Image
187+
Image,
188+
189+
/// <summary>
190+
/// Enum TextSquiggly for "TextSquiggly"
191+
/// </summary>
192+
TextSquiggly
188193
}
189194

190195
/// <summary>
@@ -330,6 +335,11 @@ public enum PenStyleEnum
330335
/// </summary>
331336
public int? BackgroundColor { get; set; }
332337

338+
/// <summary>
339+
/// Gets or sets annotation color
340+
/// </summary>
341+
public int? SquigglyColor { get; set; }
342+
333343
/// <summary>
334344
/// Gets or sets the annotation's font family
335345
/// </summary>
@@ -365,6 +375,11 @@ public enum PenStyleEnum
365375
/// </summary>
366376
public string ImagePath { get; set; }
367377

378+
/// <summary>
379+
/// Sets auto scale for watermark annotation
380+
/// </summary>
381+
public bool? AutoScale { get; set; }
382+
368383
/// <summary>
369384
/// Get the string presentation of the object
370385
/// </summary>
@@ -394,13 +409,15 @@ public override string ToString()
394409
sb.Append(" PenWidth: ").Append(this.PenWidth).Append("\n");
395410
sb.Append(" PenStyle: ").Append(this.PenStyle).Append("\n");
396411
sb.Append(" BackgroundColor: ").Append(this.BackgroundColor).Append("\n");
412+
sb.Append(" SquigglyColor: ").Append(this.SquigglyColor).Append("\n");
397413
sb.Append(" FontFamily: ").Append(this.FontFamily).Append("\n");
398414
sb.Append(" FontSize: ").Append(this.FontSize).Append("\n");
399415
sb.Append(" Opacity: ").Append(this.Opacity).Append("\n");
400416
sb.Append(" Angle: ").Append(this.Angle).Append("\n");
401417
sb.Append(" ZIndex: ").Append(this.ZIndex).Append("\n");
402418
sb.Append(" Url: ").Append(this.Url).Append("\n");
403419
sb.Append(" ImagePath: ").Append(this.ImagePath).Append("\n");
420+
sb.Append(" AutoScale: ").Append(this.AutoScale).Append("\n");
404421
sb.Append("}\n");
405422
return sb.ToString();
406423
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// --------------------------------------------------------------------------------------------------------------------
2+
// <copyright company="Aspose Pty Ltd" file="ConsumptionResult.cs">
3+
// Copyright (c) 2003-2021 Aspose Pty Ltd
4+
// </copyright>
5+
// <summary>
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files (the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions:
12+
//
13+
// The above copyright notice and this permission notice shall be included in all
14+
// copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
// SOFTWARE.
23+
// </summary>
24+
// --------------------------------------------------------------------------------------------------------------------
25+
26+
namespace GroupDocs.Annotation.Cloud.Sdk.Model
27+
{
28+
using System;
29+
using System.Collections;
30+
using System.Collections.Generic;
31+
using System.Runtime.Serialization;
32+
using System.Text;
33+
using Newtonsoft.Json;
34+
using Newtonsoft.Json.Converters;
35+
36+
/// <summary>
37+
/// Metered license consumption information
38+
/// </summary>
39+
public class ConsumptionResult
40+
{
41+
/// <summary>
42+
/// Amount of used credits
43+
/// </summary>
44+
public decimal? Credit { get; set; }
45+
46+
/// <summary>
47+
/// Amount of MBs processed
48+
/// </summary>
49+
public decimal? Quantity { get; set; }
50+
51+
/// <summary>
52+
/// Get the string presentation of the object
53+
/// </summary>
54+
/// <returns>String presentation of the object</returns>
55+
public override string ToString()
56+
{
57+
var sb = new StringBuilder();
58+
sb.Append("class ConsumptionResult {\n");
59+
sb.Append(" Credit: ").Append(this.Credit).Append("\n");
60+
sb.Append(" Quantity: ").Append(this.Quantity).Append("\n");
61+
sb.Append("}\n");
62+
return sb.ToString();
63+
}
64+
}
65+
}

0 commit comments

Comments
 (0)