Skip to content

Commit 6b1dbab

Browse files
SDK regenerated by CI server [ci skip]
1 parent 8017a0e commit 6b1dbab

File tree

6 files changed

+207
-4
lines changed

6 files changed

+207
-4
lines changed

Aspose.Words.Cloud.Sdk.Tests/Api/Document/LoadWebDocumentTests.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,29 @@ public async Task TestLoadWebDocument()
6565
Assert.NotNull(actual.SaveResult.DestDocument);
6666
Assert.AreEqual("google.doc", actual.SaveResult.DestDocument.Href);
6767
}
68+
69+
/// <summary>
70+
/// Test for loading web document online.
71+
/// </summary>
72+
[Test]
73+
public async Task TestLoadWebDocumentOnline()
74+
{
75+
var requestDataSaveOptions = new DocSaveOptionsData()
76+
{
77+
FileName = "google.doc",
78+
DmlEffectsRenderingMode = DocSaveOptionsData.DmlEffectsRenderingModeEnum.None,
79+
DmlRenderingMode = DocSaveOptionsData.DmlRenderingModeEnum.DrawingML,
80+
ZipOutput = false
81+
};
82+
var requestData = new LoadWebDocumentData()
83+
{
84+
LoadingDocumentUrl = "http://google.com",
85+
SaveOptions = requestDataSaveOptions
86+
};
87+
var request = new LoadWebDocumentOnlineRequest(
88+
data: requestData
89+
);
90+
var actual = await this.WordsApi.LoadWebDocumentOnline(request);
91+
}
6892
}
6993
}

Aspose.Words.Cloud.Sdk/Api/WordsApi.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2655,6 +2655,16 @@ public async Task<SaveResponse> LoadWebDocument(LoadWebDocumentRequest request)
26552655
return (SaveResponse)await request.DeserializeResponse(await this.apiInvoker.InvokeApi(async () => await request.CreateHttpRequest(this.configuration, this)));
26562656
}
26572657

2658+
/// <summary>
2659+
/// Downloads a document from the Web using URL and saves it to cloud storage in the specified format.
2660+
/// </summary>
2661+
/// <param name="request">Request. <see cref="LoadWebDocumentOnlineRequest" /></param>
2662+
/// <returns><see cref="LoadWebDocumentOnlineResponse" /></returns>
2663+
public async Task<LoadWebDocumentOnlineResponse> LoadWebDocumentOnline(LoadWebDocumentOnlineRequest request)
2664+
{
2665+
return (LoadWebDocumentOnlineResponse)await request.DeserializeResponse(await this.apiInvoker.InvokeApi(async () => await request.CreateHttpRequest(this.configuration, this)));
2666+
}
2667+
26582668
/// <summary>
26592669
/// Merge the section with the next one.
26602670
/// </summary>

Aspose.Words.Cloud.Sdk/Aspose.Words.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
<TargetFramework>netstandard2.0</TargetFramework>
5-
<AssemblyVersion>25.9.0.0</AssemblyVersion>
6-
<FileVersion>25.9.0.0</FileVersion>
7-
<Version>25.9.0.0</Version>
5+
<AssemblyVersion>25.10.0.0</AssemblyVersion>
6+
<FileVersion>25.10.0.0</FileVersion>
7+
<Version>25.10.0.0</Version>
88
<StyleCopTreatErrorsAsWarnings>false</StyleCopTreatErrorsAsWarnings>
99
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1010
</PropertyGroup>

Aspose.Words.Cloud.Sdk/Internal/ApiInvoker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ internal class ApiInvoker
5858
public ApiInvoker(List<IRequestHandler> requestHandlers, int timeout)
5959
{
6060
this.AddDefaultHeader(AsposeClientHeaderName, ".net sdk");
61-
this.AddDefaultHeader(AsposeClientVersionHeaderName, "25.9");
61+
this.AddDefaultHeader(AsposeClientVersionHeaderName, "25.10");
6262
this.requestHandlers = requestHandlers;
6363
this.HttpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(timeout), };
6464
}
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
// --------------------------------------------------------------------------------------------------------------------
2+
// <copyright company="Aspose" file="LoadWebDocumentOnlineRequest.cs">
3+
// Copyright (c) 2025 Aspose.Words for Cloud
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 Aspose.Words.Cloud.Sdk.Model.Requests
27+
{
28+
using System;
29+
using System.Collections.Generic;
30+
using System.IO;
31+
using System.Net.Http;
32+
using System.Text.RegularExpressions;
33+
using System.Threading.Tasks;
34+
using System.Security.Cryptography;
35+
using Aspose.Words.Cloud.Sdk.Model;
36+
using Aspose.Words.Cloud.Sdk.Model.Responses;
37+
38+
/// <summary>
39+
/// Request model for <see cref="Aspose.Words.Cloud.Sdk.Api.WordsApi.LoadWebDocumentOnline" /> operation.
40+
/// </summary>
41+
public class LoadWebDocumentOnlineRequest : IRequestModel
42+
{
43+
/// <summary>
44+
/// Initializes a new instance of the <see cref="LoadWebDocumentOnlineRequest"/> class.
45+
/// </summary>
46+
public LoadWebDocumentOnlineRequest()
47+
{
48+
}
49+
50+
/// <summary>
51+
/// Initializes a new instance of the <see cref="LoadWebDocumentOnlineRequest"/> class.
52+
/// </summary>
53+
/// <param name="data">The properties of data downloading.</param>
54+
public LoadWebDocumentOnlineRequest(LoadWebDocumentData data)
55+
{
56+
this.Data = data;
57+
}
58+
59+
/// <summary>
60+
/// The properties of data downloading.
61+
/// </summary>
62+
public LoadWebDocumentData Data { get; set; }
63+
64+
/// <summary>
65+
/// Creates the http request based on this request.
66+
/// </summary>
67+
/// <param name="configuration">SDK configuration.</param>
68+
/// <param name="encryptor">password encyptor.</param>
69+
/// <returns>The http request instance.</returns>
70+
public async Task<HttpRequestMessage> CreateHttpRequest(Configuration configuration, IEncryptor encryptor)
71+
{
72+
// verify the required parameter 'data' is set
73+
if (this.Data == null)
74+
{
75+
throw new ApiException(400, "Missing required parameter 'data' when calling LoadWebDocumentOnline");
76+
}
77+
78+
this.Data?.Validate();
79+
80+
var path = configuration.GetApiRootUrl() + "/words/online/put/loadWebDocument";
81+
path = Regex
82+
.Replace(path, "\\*", string.Empty)
83+
.Replace("&amp;", "&")
84+
.Replace("/?", "?");
85+
86+
var formData = new List< Tuple<string, object> >();
87+
var result = new HttpRequestMessage(HttpMethod.Put, path);
88+
if (this.Data != null)
89+
{
90+
formData.Add(new Tuple<string, object>("Data", this.Data));
91+
}
92+
93+
result.Content = await ApiInvoker.GetRequestContent(formData, encryptor);
94+
return result;
95+
}
96+
97+
/// <summary>
98+
/// Deserialize response object.
99+
/// </summary>
100+
/// <param name="message">Response message.</param>
101+
/// <returns>Response type.</returns>
102+
public async Task<object> DeserializeResponse(HttpResponseMessage message)
103+
{
104+
var multipart = await ApiInvoker.ToMultipartForm(message);
105+
return new LoadWebDocumentOnlineResponse(
106+
model: (SaveResponse)SerializationHelper.Deserialize(
107+
await new StreamReader(multipart["Model"].Content, System.Text.Encoding.UTF8).ReadToEndAsync(),
108+
typeof(SaveResponse)),
109+
document: await SerializationHelper.DeserializeFilesCollection(multipart["Document"])
110+
);
111+
}
112+
}
113+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// --------------------------------------------------------------------------------------------------------------------
2+
// <copyright company="Aspose" file="LoadWebDocumentOnlineResponse.cs">
3+
// Copyright (c) 2025 Aspose.Words for Cloud
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 Aspose.Words.Cloud.Sdk.Model.Responses
27+
{
28+
using Aspose.Words.Cloud.Sdk.Model;
29+
30+
/// <summary>
31+
/// Response model for <see cref="Aspose.Words.Cloud.Sdk.Api.WordsApi.LoadWebDocumentOnline" /> operation.
32+
/// </summary>
33+
public class LoadWebDocumentOnlineResponse
34+
{
35+
/// <summary>
36+
/// Initializes a new instance of the <see cref="LoadWebDocumentOnlineResponse"/> class.
37+
/// </summary>
38+
/// <param name="model">The REST response with a save result.</param>
39+
/// <param name="document">The document after modification.</param>
40+
public LoadWebDocumentOnlineResponse(SaveResponse model, System.Collections.Generic.Dictionary<string, System.IO.Stream> document)
41+
{
42+
this.Model = model;
43+
this.Document = document;
44+
}
45+
46+
/// <summary>
47+
/// The REST response with a save result.
48+
/// </summary>
49+
public SaveResponse Model { get; private set; }
50+
51+
/// <summary>
52+
/// The document after modification.
53+
/// </summary>
54+
public System.Collections.Generic.Dictionary<string, System.IO.Stream> Document { get; private set; }
55+
}
56+
}

0 commit comments

Comments
 (0)