|
| 1 | +/* |
| 2 | + * CyberSource Merged Spec |
| 3 | + * |
| 4 | + * All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html |
| 5 | + * |
| 6 | + * OpenAPI spec version: 0.0.1 |
| 7 | + * |
| 8 | + * Generated by: https://github.com/swagger-api/swagger-codegen.git |
| 9 | + */ |
| 10 | + |
| 11 | +using System; |
| 12 | +using System.Collections.Generic; |
| 13 | +using System.Collections.ObjectModel; |
| 14 | +using System.Linq; |
| 15 | +using RestSharp; |
| 16 | +using CyberSource.Client; |
| 17 | + |
| 18 | +namespace CyberSource.Api |
| 19 | +{ |
| 20 | + /// <summary> |
| 21 | + /// Represents a collection of functions to interact with the API endpoints |
| 22 | + /// </summary> |
| 23 | + public interface IDownloadDTDApi : IApiAccessor |
| 24 | + { |
| 25 | + #region Synchronous Operations |
| 26 | + /// <summary> |
| 27 | + /// Used to download DTDs for reports |
| 28 | + /// </summary> |
| 29 | + /// <remarks> |
| 30 | + /// Downloads DTDs for reports on no-auth. |
| 31 | + /// </remarks> |
| 32 | + /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception> |
| 33 | + /// <param name="reportDefinitionNameVersion">Name and version of DTD file to download. Some DTDs only have one version. In that case version name is not needed. Some example values are ctdr-1.0, tdr, pbdr-1.1</param> |
| 34 | + /// <returns></returns> |
| 35 | + void GetDTDV2 (string reportDefinitionNameVersion); |
| 36 | + |
| 37 | + /// <summary> |
| 38 | + /// Used to download DTDs for reports |
| 39 | + /// </summary> |
| 40 | + /// <remarks> |
| 41 | + /// Downloads DTDs for reports on no-auth. |
| 42 | + /// </remarks> |
| 43 | + /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception> |
| 44 | + /// <param name="reportDefinitionNameVersion">Name and version of DTD file to download. Some DTDs only have one version. In that case version name is not needed. Some example values are ctdr-1.0, tdr, pbdr-1.1</param> |
| 45 | + /// <returns>ApiResponse of Object(void)</returns> |
| 46 | + ApiResponse<Object> GetDTDV2WithHttpInfo (string reportDefinitionNameVersion); |
| 47 | + #endregion Synchronous Operations |
| 48 | + #region Asynchronous Operations |
| 49 | + /// <summary> |
| 50 | + /// Used to download DTDs for reports |
| 51 | + /// </summary> |
| 52 | + /// <remarks> |
| 53 | + /// Downloads DTDs for reports on no-auth. |
| 54 | + /// </remarks> |
| 55 | + /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception> |
| 56 | + /// <param name="reportDefinitionNameVersion">Name and version of DTD file to download. Some DTDs only have one version. In that case version name is not needed. Some example values are ctdr-1.0, tdr, pbdr-1.1</param> |
| 57 | + /// <returns>Task of void</returns> |
| 58 | + System.Threading.Tasks.Task GetDTDV2Async (string reportDefinitionNameVersion); |
| 59 | + |
| 60 | + /// <summary> |
| 61 | + /// Used to download DTDs for reports |
| 62 | + /// </summary> |
| 63 | + /// <remarks> |
| 64 | + /// Downloads DTDs for reports on no-auth. |
| 65 | + /// </remarks> |
| 66 | + /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception> |
| 67 | + /// <param name="reportDefinitionNameVersion">Name and version of DTD file to download. Some DTDs only have one version. In that case version name is not needed. Some example values are ctdr-1.0, tdr, pbdr-1.1</param> |
| 68 | + /// <returns>Task of ApiResponse</returns> |
| 69 | + System.Threading.Tasks.Task<ApiResponse<Object>> GetDTDV2AsyncWithHttpInfo (string reportDefinitionNameVersion); |
| 70 | + #endregion Asynchronous Operations |
| 71 | + } |
| 72 | + |
| 73 | + /// <summary> |
| 74 | + /// Represents a collection of functions to interact with the API endpoints |
| 75 | + /// </summary> |
| 76 | + public partial class DownloadDTDApi : IDownloadDTDApi |
| 77 | + { |
| 78 | + private CyberSource.Client.ExceptionFactory _exceptionFactory = (name, response) => null; |
| 79 | + |
| 80 | + /// <summary> |
| 81 | + /// Initializes a new instance of the <see cref="DownloadDTDApi"/> class. |
| 82 | + /// </summary> |
| 83 | + /// <returns></returns> |
| 84 | + public DownloadDTDApi(String basePath) |
| 85 | + { |
| 86 | + this.Configuration = new Configuration(new ApiClient(basePath)); |
| 87 | + |
| 88 | + ExceptionFactory = CyberSource.Client.Configuration.DefaultExceptionFactory; |
| 89 | + |
| 90 | + // ensure API client has configuration ready |
| 91 | + if (Configuration.ApiClient.Configuration == null) |
| 92 | + { |
| 93 | + this.Configuration.ApiClient.Configuration = this.Configuration; |
| 94 | + } |
| 95 | + } |
| 96 | + |
| 97 | + /// <summary> |
| 98 | + /// Initializes a new instance of the <see cref="DownloadDTDApi"/> class |
| 99 | + /// using Configuration object |
| 100 | + /// </summary> |
| 101 | + /// <param name="configuration">An instance of Configuration</param> |
| 102 | + /// <returns></returns> |
| 103 | + public DownloadDTDApi(Configuration configuration = null) |
| 104 | + { |
| 105 | + if (configuration == null) // use the default one in Configuration |
| 106 | + this.Configuration = Configuration.Default; |
| 107 | + else |
| 108 | + this.Configuration = configuration; |
| 109 | + |
| 110 | + ExceptionFactory = CyberSource.Client.Configuration.DefaultExceptionFactory; |
| 111 | + |
| 112 | + this.Configuration.ApiClient.Configuration = this.Configuration; |
| 113 | + } |
| 114 | + |
| 115 | + /// <summary> |
| 116 | + /// Gets the base path of the API client. |
| 117 | + /// </summary> |
| 118 | + /// <value>The base path</value> |
| 119 | + public String GetBasePath() |
| 120 | + { |
| 121 | + return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); |
| 122 | + } |
| 123 | + |
| 124 | + /// <summary> |
| 125 | + /// Sets the base path of the API client. |
| 126 | + /// </summary> |
| 127 | + /// <value>The base path</value> |
| 128 | + [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] |
| 129 | + public void SetBasePath(String basePath) |
| 130 | + { |
| 131 | + // do nothing |
| 132 | + } |
| 133 | + |
| 134 | + /// <summary> |
| 135 | + /// Gets or sets the configuration object |
| 136 | + /// </summary> |
| 137 | + /// <value>An instance of the Configuration</value> |
| 138 | + public Configuration Configuration {get; set;} |
| 139 | + |
| 140 | + /// <summary> |
| 141 | + /// Provides a factory method hook for the creation of exceptions. |
| 142 | + /// </summary> |
| 143 | + public CyberSource.Client.ExceptionFactory ExceptionFactory |
| 144 | + { |
| 145 | + get |
| 146 | + { |
| 147 | + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) |
| 148 | + { |
| 149 | + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); |
| 150 | + } |
| 151 | + return _exceptionFactory; |
| 152 | + } |
| 153 | + set { _exceptionFactory = value; } |
| 154 | + } |
| 155 | + |
| 156 | + /// <summary> |
| 157 | + /// Gets the default header. |
| 158 | + /// </summary> |
| 159 | + /// <returns>Dictionary of HTTP header</returns> |
| 160 | + [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] |
| 161 | + public Dictionary<String, String> DefaultHeader() |
| 162 | + { |
| 163 | + return this.Configuration.DefaultHeader; |
| 164 | + } |
| 165 | + |
| 166 | + /// <summary> |
| 167 | + /// Add default header. |
| 168 | + /// </summary> |
| 169 | + /// <param name="key">Header field name.</param> |
| 170 | + /// <param name="value">Header field value.</param> |
| 171 | + /// <returns></returns> |
| 172 | + [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] |
| 173 | + public void AddDefaultHeader(string key, string value) |
| 174 | + { |
| 175 | + this.Configuration.AddDefaultHeader(key, value); |
| 176 | + } |
| 177 | + |
| 178 | + /// <summary> |
| 179 | + /// Used to download DTDs for reports Downloads DTDs for reports on no-auth. |
| 180 | + /// </summary> |
| 181 | + /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception> |
| 182 | + /// <param name="reportDefinitionNameVersion">Name and version of DTD file to download. Some DTDs only have one version. In that case version name is not needed. Some example values are ctdr-1.0, tdr, pbdr-1.1</param> |
| 183 | + /// <returns></returns> |
| 184 | + public void GetDTDV2 (string reportDefinitionNameVersion) |
| 185 | + { |
| 186 | + GetDTDV2WithHttpInfo(reportDefinitionNameVersion); |
| 187 | + } |
| 188 | + |
| 189 | + /// <summary> |
| 190 | + /// Used to download DTDs for reports Downloads DTDs for reports on no-auth. |
| 191 | + /// </summary> |
| 192 | + /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception> |
| 193 | + /// <param name="reportDefinitionNameVersion">Name and version of DTD file to download. Some DTDs only have one version. In that case version name is not needed. Some example values are ctdr-1.0, tdr, pbdr-1.1</param> |
| 194 | + /// <returns>ApiResponse of Object(void)</returns> |
| 195 | + public ApiResponse<Object> GetDTDV2WithHttpInfo (string reportDefinitionNameVersion) |
| 196 | + { |
| 197 | + // verify the required parameter 'reportDefinitionNameVersion' is set |
| 198 | + if (reportDefinitionNameVersion == null) |
| 199 | + throw new ApiException(400, "Missing required parameter 'reportDefinitionNameVersion' when calling DownloadDTDApi->GetDTDV2"); |
| 200 | + |
| 201 | + var localVarPath = $"/dtds/{reportDefinitionNameVersion}"; |
| 202 | + var localVarPathParams = new Dictionary<String, String>(); |
| 203 | + var localVarQueryParams = new Dictionary<String, String>(); |
| 204 | + var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader); |
| 205 | + var localVarFormParams = new Dictionary<String, String>(); |
| 206 | + var localVarFileParams = new Dictionary<String, FileParameter>(); |
| 207 | + Object localVarPostBody = null; |
| 208 | + |
| 209 | + // to determine the Content-Type header |
| 210 | + String[] localVarHttpContentTypes = new String[] { |
| 211 | + "application/json;charset=utf-8" |
| 212 | + }; |
| 213 | + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); |
| 214 | + |
| 215 | + // to determine the Accept header |
| 216 | + String[] localVarHttpHeaderAccepts = new String[] { |
| 217 | + "application/xml-dtd" |
| 218 | + }; |
| 219 | + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); |
| 220 | + if (localVarHttpHeaderAccept != null) |
| 221 | + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); |
| 222 | + |
| 223 | + if (reportDefinitionNameVersion != null) localVarPathParams.Add("reportDefinitionNameVersion", Configuration.ApiClient.ParameterToString(reportDefinitionNameVersion)); // path parameter |
| 224 | + |
| 225 | + |
| 226 | + // make the HTTP request |
| 227 | + IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, |
| 228 | + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, |
| 229 | + localVarPathParams, localVarHttpContentType); |
| 230 | + |
| 231 | + int localVarStatusCode = (int) localVarResponse.StatusCode; |
| 232 | + |
| 233 | + if (ExceptionFactory != null) |
| 234 | + { |
| 235 | + Exception exception = ExceptionFactory("GetDTDV2", localVarResponse); |
| 236 | + if (exception != null) throw exception; |
| 237 | + } |
| 238 | + |
| 239 | + return new ApiResponse<Object>(localVarStatusCode, |
| 240 | + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), |
| 241 | + null); |
| 242 | + } |
| 243 | + |
| 244 | + /// <summary> |
| 245 | + /// Used to download DTDs for reports Downloads DTDs for reports on no-auth. |
| 246 | + /// </summary> |
| 247 | + /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception> |
| 248 | + /// <param name="reportDefinitionNameVersion">Name and version of DTD file to download. Some DTDs only have one version. In that case version name is not needed. Some example values are ctdr-1.0, tdr, pbdr-1.1</param> |
| 249 | + /// <returns>Task of void</returns> |
| 250 | + public async System.Threading.Tasks.Task GetDTDV2Async (string reportDefinitionNameVersion) |
| 251 | + { |
| 252 | + await GetDTDV2AsyncWithHttpInfo(reportDefinitionNameVersion); |
| 253 | + |
| 254 | + } |
| 255 | + |
| 256 | + /// <summary> |
| 257 | + /// Used to download DTDs for reports Downloads DTDs for reports on no-auth. |
| 258 | + /// </summary> |
| 259 | + /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception> |
| 260 | + /// <param name="reportDefinitionNameVersion">Name and version of DTD file to download. Some DTDs only have one version. In that case version name is not needed. Some example values are ctdr-1.0, tdr, pbdr-1.1</param> |
| 261 | + /// <returns>Task of ApiResponse</returns> |
| 262 | + public async System.Threading.Tasks.Task<ApiResponse<Object>> GetDTDV2AsyncWithHttpInfo (string reportDefinitionNameVersion) |
| 263 | + { |
| 264 | + // verify the required parameter 'reportDefinitionNameVersion' is set |
| 265 | + if (reportDefinitionNameVersion == null) |
| 266 | + throw new ApiException(400, "Missing required parameter 'reportDefinitionNameVersion' when calling DownloadDTDApi->GetDTDV2"); |
| 267 | + |
| 268 | + var localVarPath = $"/dtds/{reportDefinitionNameVersion}"; |
| 269 | + var localVarPathParams = new Dictionary<String, String>(); |
| 270 | + var localVarQueryParams = new Dictionary<String, String>(); |
| 271 | + var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader); |
| 272 | + var localVarFormParams = new Dictionary<String, String>(); |
| 273 | + var localVarFileParams = new Dictionary<String, FileParameter>(); |
| 274 | + Object localVarPostBody = null; |
| 275 | + |
| 276 | + // to determine the Content-Type header |
| 277 | + String[] localVarHttpContentTypes = new String[] { |
| 278 | + "application/json;charset=utf-8" |
| 279 | + }; |
| 280 | + String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); |
| 281 | + |
| 282 | + // to determine the Accept header |
| 283 | + String[] localVarHttpHeaderAccepts = new String[] { |
| 284 | + "application/xml-dtd" |
| 285 | + }; |
| 286 | + String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); |
| 287 | + if (localVarHttpHeaderAccept != null) |
| 288 | + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); |
| 289 | + |
| 290 | + if (reportDefinitionNameVersion != null) localVarPathParams.Add("reportDefinitionNameVersion", Configuration.ApiClient.ParameterToString(reportDefinitionNameVersion)); // path parameter |
| 291 | + |
| 292 | + |
| 293 | + // make the HTTP request |
| 294 | + IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, |
| 295 | + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, |
| 296 | + localVarPathParams, localVarHttpContentType); |
| 297 | + |
| 298 | + int localVarStatusCode = (int) localVarResponse.StatusCode; |
| 299 | + |
| 300 | + if (ExceptionFactory != null) |
| 301 | + { |
| 302 | + Exception exception = ExceptionFactory("GetDTDV2", localVarResponse); |
| 303 | + if (exception != null) throw exception; |
| 304 | + } |
| 305 | + |
| 306 | + return new ApiResponse<Object>(localVarStatusCode, |
| 307 | + localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), |
| 308 | + null); |
| 309 | + } |
| 310 | + |
| 311 | + } |
| 312 | +} |
0 commit comments