Skip to content

Commit bc95a43

Browse files
SDK version 20.1.1 generated
1 parent 9037eac commit bc95a43

21 files changed

+1242
-1
lines changed

Api/EmailApi.cs

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3398,6 +3398,224 @@ await apiInvoker.InvokeApiAsync(
33983398
}
33993399
#endif
34003400

3401+
/// <summary>
3402+
/// Discover email accounts by email address. Does not validate discovered accounts.
3403+
/// </summary>
3404+
/// <param name="request">Request. <see cref="DiscoverEmailConfigRequest" /></param>
3405+
/// <returns><see cref="EmailAccountConfigList"/></returns>
3406+
public EmailAccountConfigList DiscoverEmailConfig(Model.Requests.DiscoverEmailConfigRequest request)
3407+
{
3408+
// verify the required parameter 'address' is set
3409+
if (request.address == null)
3410+
{
3411+
throw new ApiException(400,
3412+
"Missing required parameter 'address' when calling DiscoverEmailConfig");
3413+
}
3414+
3415+
// create path and map variables
3416+
var resourcePath = this.configuration.GetApiRootUrl() + "/email/config/discover";
3417+
resourcePath = Regex
3418+
.Replace(resourcePath, "\\*", string.Empty)
3419+
.Replace("&amp;", "&")
3420+
.Replace("/?", "?");
3421+
resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "address", request.address);
3422+
resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "fastProcessing", request.fastProcessing);
3423+
var response = apiInvoker.InvokeApi(
3424+
resourcePath,
3425+
"GET",
3426+
null,
3427+
null,
3428+
null);
3429+
if (response != null)
3430+
{
3431+
return SerializationHelper.Deserialize<EmailAccountConfigList>(response);
3432+
}
3433+
3434+
return null;
3435+
}
3436+
3437+
#if (NET452 || NETSTANDARD2_0)
3438+
/// <summary>
3439+
/// Discover email accounts by email address. Does not validate discovered accounts.
3440+
/// </summary>
3441+
/// <param name="request">Request. <see cref="DiscoverEmailConfigRequest" /></param>
3442+
/// <returns><see cref="EmailAccountConfigList"/></returns>
3443+
public async Task<EmailAccountConfigList> DiscoverEmailConfigAsync(Model.Requests.DiscoverEmailConfigRequest request)
3444+
{
3445+
// verify the required parameter 'address' is set
3446+
if (request.address == null)
3447+
{
3448+
throw new ApiException(400,
3449+
"Missing required parameter 'address' when calling DiscoverEmailConfig");
3450+
}
3451+
3452+
// create path and map variables
3453+
var resourcePath = this.configuration.GetApiRootUrl() + "/email/config/discover";
3454+
resourcePath = Regex
3455+
.Replace(resourcePath, "\\*", string.Empty)
3456+
.Replace("&amp;", "&")
3457+
.Replace("/?", "?");
3458+
resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "address", request.address);
3459+
resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "fastProcessing", request.fastProcessing);
3460+
var response = await apiInvoker.InvokeApiAsync(
3461+
resourcePath,
3462+
"GET",
3463+
null,
3464+
null,
3465+
null);
3466+
if (response != null)
3467+
{
3468+
return SerializationHelper.Deserialize<EmailAccountConfigList>(response);
3469+
}
3470+
3471+
return null;
3472+
}
3473+
#endif
3474+
3475+
/// <summary>
3476+
/// Discover email accounts by email address. Validates discovered accounts using OAuth 2.0.
3477+
/// </summary>
3478+
/// <param name="request">Request. <see cref="DiscoverEmailConfigOauthRequest" /></param>
3479+
/// <returns><see cref="EmailAccountConfigList"/></returns>
3480+
public EmailAccountConfigList DiscoverEmailConfigOauth(Model.Requests.DiscoverEmailConfigOauthRequest request)
3481+
{
3482+
// verify the required parameter 'rq' is set
3483+
if (request.rq == null)
3484+
{
3485+
throw new ApiException(400,
3486+
"Missing required parameter 'rq' when calling DiscoverEmailConfigOauth");
3487+
}
3488+
3489+
// create path and map variables
3490+
var resourcePath = this.configuration.GetApiRootUrl() + "/email/config/discover/oauth";
3491+
resourcePath = Regex
3492+
.Replace(resourcePath, "\\*", string.Empty)
3493+
.Replace("&amp;", "&")
3494+
.Replace("/?", "?");
3495+
var postBody = SerializationHelper.Serialize(request.rq); // http body (model) parameter
3496+
var response = apiInvoker.InvokeApi(
3497+
resourcePath,
3498+
"POST",
3499+
postBody,
3500+
null,
3501+
null);
3502+
if (response != null)
3503+
{
3504+
return SerializationHelper.Deserialize<EmailAccountConfigList>(response);
3505+
}
3506+
3507+
return null;
3508+
}
3509+
3510+
#if (NET452 || NETSTANDARD2_0)
3511+
/// <summary>
3512+
/// Discover email accounts by email address. Validates discovered accounts using OAuth 2.0.
3513+
/// </summary>
3514+
/// <param name="request">Request. <see cref="DiscoverEmailConfigOauthRequest" /></param>
3515+
/// <returns><see cref="EmailAccountConfigList"/></returns>
3516+
public async Task<EmailAccountConfigList> DiscoverEmailConfigOauthAsync(Model.Requests.DiscoverEmailConfigOauthRequest request)
3517+
{
3518+
// verify the required parameter 'rq' is set
3519+
if (request.rq == null)
3520+
{
3521+
throw new ApiException(400,
3522+
"Missing required parameter 'rq' when calling DiscoverEmailConfigOauth");
3523+
}
3524+
3525+
// create path and map variables
3526+
var resourcePath = this.configuration.GetApiRootUrl() + "/email/config/discover/oauth";
3527+
resourcePath = Regex
3528+
.Replace(resourcePath, "\\*", string.Empty)
3529+
.Replace("&amp;", "&")
3530+
.Replace("/?", "?");
3531+
var postBody = SerializationHelper.Serialize(request.rq); // http body (model) parameter
3532+
var response = await apiInvoker.InvokeApiAsync(
3533+
resourcePath,
3534+
"POST",
3535+
postBody,
3536+
null,
3537+
null);
3538+
if (response != null)
3539+
{
3540+
return SerializationHelper.Deserialize<EmailAccountConfigList>(response);
3541+
}
3542+
3543+
return null;
3544+
}
3545+
#endif
3546+
3547+
/// <summary>
3548+
/// Discover email accounts by email address. Validates discovered accounts using login and password.
3549+
/// </summary>
3550+
/// <param name="request">Request. <see cref="DiscoverEmailConfigPasswordRequest" /></param>
3551+
/// <returns><see cref="EmailAccountConfigList"/></returns>
3552+
public EmailAccountConfigList DiscoverEmailConfigPassword(Model.Requests.DiscoverEmailConfigPasswordRequest request)
3553+
{
3554+
// verify the required parameter 'rq' is set
3555+
if (request.rq == null)
3556+
{
3557+
throw new ApiException(400,
3558+
"Missing required parameter 'rq' when calling DiscoverEmailConfigPassword");
3559+
}
3560+
3561+
// create path and map variables
3562+
var resourcePath = this.configuration.GetApiRootUrl() + "/email/config/discover/password";
3563+
resourcePath = Regex
3564+
.Replace(resourcePath, "\\*", string.Empty)
3565+
.Replace("&amp;", "&")
3566+
.Replace("/?", "?");
3567+
var postBody = SerializationHelper.Serialize(request.rq); // http body (model) parameter
3568+
var response = apiInvoker.InvokeApi(
3569+
resourcePath,
3570+
"POST",
3571+
postBody,
3572+
null,
3573+
null);
3574+
if (response != null)
3575+
{
3576+
return SerializationHelper.Deserialize<EmailAccountConfigList>(response);
3577+
}
3578+
3579+
return null;
3580+
}
3581+
3582+
#if (NET452 || NETSTANDARD2_0)
3583+
/// <summary>
3584+
/// Discover email accounts by email address. Validates discovered accounts using login and password.
3585+
/// </summary>
3586+
/// <param name="request">Request. <see cref="DiscoverEmailConfigPasswordRequest" /></param>
3587+
/// <returns><see cref="EmailAccountConfigList"/></returns>
3588+
public async Task<EmailAccountConfigList> DiscoverEmailConfigPasswordAsync(Model.Requests.DiscoverEmailConfigPasswordRequest request)
3589+
{
3590+
// verify the required parameter 'rq' is set
3591+
if (request.rq == null)
3592+
{
3593+
throw new ApiException(400,
3594+
"Missing required parameter 'rq' when calling DiscoverEmailConfigPassword");
3595+
}
3596+
3597+
// create path and map variables
3598+
var resourcePath = this.configuration.GetApiRootUrl() + "/email/config/discover/password";
3599+
resourcePath = Regex
3600+
.Replace(resourcePath, "\\*", string.Empty)
3601+
.Replace("&amp;", "&")
3602+
.Replace("/?", "?");
3603+
var postBody = SerializationHelper.Serialize(request.rq); // http body (model) parameter
3604+
var response = await apiInvoker.InvokeApiAsync(
3605+
resourcePath,
3606+
"POST",
3607+
postBody,
3608+
null,
3609+
null);
3610+
if (response != null)
3611+
{
3612+
return SerializationHelper.Deserialize<EmailAccountConfigList>(response);
3613+
}
3614+
3615+
return null;
3616+
}
3617+
#endif
3618+
34013619
/// <summary>
34023620
/// Download file
34033621
/// </summary>

Aspose.Email-Cloud.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<RepositoryUrl>https://github.com/aspose-email-cloud/aspose-email-cloud-dotnet</RepositoryUrl>
1313
<PackageTags>ASPOSE EMAIL CLOUD SDK Outlook MSG EML MHT</PackageTags>
1414
<RootNamespace>Aspose.Email.Cloud.Sdk</RootNamespace>
15-
<Version>20.1.0</Version>
15+
<Version>20.1.1</Version>
1616
</PropertyGroup>
1717
<ItemGroup Condition=" '$(TargetFramework)' == 'Xamarin.iOS10' OR '$(TargetFramework)' == 'Xamarin.Mac20' OR '$(TargetFramework)' == 'MonoAndroid60'">
1818
<PackageReference Include="Newtonsoft.Json" Version="8.0.3" />

Model/DiscoverEmailConfigOauth.cs

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
// --------------------------------------------------------------------------------------------------------------------
2+
// <copyright company="Aspose" file="DiscoverEmailConfigOauth.cs">
3+
// Copyright (c) 2016 Aspose.Email 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.Email.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+
/// <summary>
36+
///
37+
/// </summary>
38+
public class DiscoverEmailConfigOauth : DiscoverEmailConfigRequest
39+
{
40+
/// <summary>
41+
/// OAuth client id.
42+
/// </summary>
43+
public string ClientId { get; set; }
44+
45+
/// <summary>
46+
/// OAuth client secret.
47+
/// </summary>
48+
public string ClientSecret { get; set; }
49+
50+
/// <summary>
51+
/// OAuth refresh token.
52+
/// </summary>
53+
public string RefreshToken { get; set; }
54+
55+
/// <summary>
56+
/// The url to obtain access token. If not specified, will be discovered from email configuration.
57+
/// </summary>
58+
public string RequestUrl { get; set; }
59+
60+
/// <summary>DiscoverEmailConfigOauth constructor</summary>
61+
public DiscoverEmailConfigOauth() {}
62+
63+
/// <summary>DiscoverEmailConfigOauth constructor</summary>
64+
/// <param name="address">Email address to discover. </param>
65+
/// <param name="fastProcessing">Turns on fast processing. All discover systems will run in parallel. First discovered result will be returned. </param>
66+
/// <param name="login">Email account login. If not specified, address used as a login. </param>
67+
/// <param name="clientId">OAuth client id. </param>
68+
/// <param name="clientSecret">OAuth client secret. </param>
69+
/// <param name="refreshToken">OAuth refresh token. </param>
70+
/// <param name="requestUrl">The url to obtain access token. If not specified, will be discovered from email configuration. </param>
71+
public DiscoverEmailConfigOauth(string address, bool? fastProcessing, string login, string clientId, string clientSecret, string refreshToken, string requestUrl)
72+
{
73+
Address = address;
74+
FastProcessing = fastProcessing;
75+
Login = login;
76+
ClientId = clientId;
77+
ClientSecret = clientSecret;
78+
RefreshToken = refreshToken;
79+
RequestUrl = requestUrl;
80+
}
81+
/// <summary>
82+
/// Get the string presentation of the object
83+
/// </summary>
84+
/// <returns>String presentation of the object</returns>
85+
public override string ToString()
86+
{
87+
var sb = new StringBuilder();
88+
sb.Append("class DiscoverEmailConfigOauth {\n");
89+
sb.Append(" Address: ").Append(this.Address).Append("\n");
90+
sb.Append(" FastProcessing: ").Append(this.FastProcessing).Append("\n");
91+
sb.Append(" Login: ").Append(this.Login).Append("\n");
92+
sb.Append(" ClientId: ").Append(this.ClientId).Append("\n");
93+
sb.Append(" ClientSecret: ").Append(this.ClientSecret).Append("\n");
94+
sb.Append(" RefreshToken: ").Append(this.RefreshToken).Append("\n");
95+
sb.Append(" RequestUrl: ").Append(this.RequestUrl).Append("\n");
96+
sb.Append("}\n");
97+
return sb.ToString();
98+
}
99+
}
100+
}

0 commit comments

Comments
 (0)