|
| 1 | +// -------------------------------------------------------------------------------------------------------------------- |
| 2 | +// <copyright company="Aspose" file="SpecRequest.cs"> |
| 3 | +// Copyright (c) 2025 Aspose.Cells 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.Cells.Cloud.SDK.Request |
| 27 | +{ |
| 28 | + using Aspose.Cells.Cloud.SDK.Model; |
| 29 | + using Newtonsoft.Json; |
| 30 | + using System.Collections.Generic; |
| 31 | + using System.Net; |
| 32 | + using System.Text.RegularExpressions; |
| 33 | + |
| 34 | + /// <summary> |
| 35 | + /// Request model for <see cref="Aspose.Cells.Cloud.SDK.Api.CellsApi.Spec" /> operation. |
| 36 | + /// </summary> |
| 37 | + public class SpecRequest : IRequestModel |
| 38 | + { |
| 39 | + |
| 40 | + /// <summary> |
| 41 | + /// Initializes a new instance of the <see cref="SpecRequest"/> class. |
| 42 | + /// </summary> |
| 43 | + public SpecRequest() |
| 44 | + { |
| 45 | + |
| 46 | + } |
| 47 | + /// <summary> |
| 48 | + /// Initializes a new instance of the <see cref="SpecRequest"/> class. |
| 49 | + /// </summary> |
| 50 | + /// <param name="version"></param> |
| 51 | + /// <param name="regoin">The spreadsheet region setting.</param> |
| 52 | + /// <param name="password">The password for opening spreadsheet file.</param> |
| 53 | + public SpecRequest(string version, string regoin = null, string password = null) |
| 54 | + { |
| 55 | + this.version = version; |
| 56 | + this.regoin = regoin; |
| 57 | + this.password = password; |
| 58 | + } |
| 59 | + |
| 60 | + /// <summary> |
| 61 | + /// Gets or sets version. |
| 62 | + /// </summary> |
| 63 | + public string version { get; set; } |
| 64 | + |
| 65 | + |
| 66 | + /// <summary> |
| 67 | + /// The spreadsheet region setting. |
| 68 | + /// </summary> |
| 69 | + public string regoin { get; set; } |
| 70 | + |
| 71 | + |
| 72 | + /// <summary> |
| 73 | + /// The password for opening spreadsheet file. |
| 74 | + /// </summary> |
| 75 | + public string password { get; set; } |
| 76 | + |
| 77 | + |
| 78 | + /// <summary> |
| 79 | + /// Gets or sets extendQueryParameterMap. |
| 80 | + /// </summary> |
| 81 | + public IDictionary<string, string> extendQueryParameterMap ; |
| 82 | + |
| 83 | + /// <summary> |
| 84 | + /// Creates the http request based on this request. |
| 85 | + /// </summary> |
| 86 | + /// <param name="baseUri">Api base uri.</param> |
| 87 | + /// <returns>The http request instance.</returns> |
| 88 | + public HttpWebRequest CreateHttpRequest(string baseUri,IDictionary<string, string> defaultHeaderMap, List<Invoker.IRequestHandler> requestHandlers) |
| 89 | + { |
| 90 | + var localVarHeaderParams = new Dictionary<string, string>(); |
| 91 | + var localVarFileParams = new Dictionary<string, object>(); |
| 92 | + string localVarPostBody =""; |
| 93 | + string localVarHttpContentType = "application/json"; |
| 94 | + // verify the required parameter 'version' is set |
| 95 | + if (string.IsNullOrEmpty (this.version )) |
| 96 | + { |
| 97 | + throw new ApiException(400, "Missing required parameter 'version' when calling Spec"); |
| 98 | + } |
| 99 | + |
| 100 | + var path = baseUri + "/cells/swagger/spec"; |
| 101 | + path = Regex |
| 102 | + .Replace(path, "\\*", string.Empty) |
| 103 | + .Replace("&", "&") |
| 104 | + .Replace("/?", "?"); |
| 105 | + |
| 106 | + path = UrlHelper.AddQueryParameterToUrl(path, "version", this.version); |
| 107 | + if (!string.IsNullOrEmpty(this.regoin)) path = UrlHelper.AddQueryParameterToUrl(path, "regoin", this.regoin); |
| 108 | + if (!string.IsNullOrEmpty(this.password)) path = UrlHelper.AddQueryParameterToUrl(path, "password", this.password); |
| 109 | + if (this.extendQueryParameterMap != null) |
| 110 | + { |
| 111 | + foreach (KeyValuePair<string, string> kvp in extendQueryParameterMap) |
| 112 | + { |
| 113 | + path = UrlHelper.AddQueryParameterToUrl(path, kvp.Key, kvp.Value); |
| 114 | + } |
| 115 | + } |
| 116 | + |
| 117 | + |
| 118 | + return UrlHelper.PrepareRequest(path, "GET", localVarFileParams, localVarHeaderParams, localVarPostBody, localVarHttpContentType, defaultHeaderMap, requestHandlers); |
| 119 | + } |
| 120 | + } |
| 121 | +} |
0 commit comments