Skip to content

Commit

Permalink
Add VerifyUserIdentity & UserHasExistsByUsername
Browse files Browse the repository at this point in the history
  • Loading branch information
MahdiyarGHD committed Nov 9, 2023
1 parent 96f7c81 commit 86c9d32
Show file tree
Hide file tree
Showing 4 changed files with 379 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4723,6 +4723,162 @@ public string BaseUrl
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder);
partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response);

/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<MessageContract> UserHasExistsByUsernameAsync(UserHasExistsByUsernameRequestContract body)
{
return UserHasExistsByUsernameAsync(body, System.Threading.CancellationToken.None);
}

/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<MessageContract> UserHasExistsByUsernameAsync(UserHasExistsByUsernameRequestContract body, System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Users/UserHasExistsByUsername");

var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
var content_ = new System.Net.Http.StringContent(json_);
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
request_.Content = content_;
request_.Method = new System.Net.Http.HttpMethod("POST");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));

PrepareRequest(client_, request_, urlBuilder_);

var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

PrepareRequest(client_, request_, url_);

var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
{
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
if (response_.Content != null && response_.Content.Headers != null)
{
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}

ProcessResponse(client_, response_);

var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
var objectResponse_ = await ReadObjectResponseAsync<MessageContract>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
return objectResponse_.Object;
}
else
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
finally
{
if (disposeResponse_)
response_.Dispose();
}
}
}
finally
{
if (disposeClient_)
client_.Dispose();
}
}

/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<MessageContract> VerifyUserIdentityAsync(UserSummaryContract body)
{
return VerifyUserIdentityAsync(body, System.Threading.CancellationToken.None);
}

/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<MessageContract> VerifyUserIdentityAsync(UserSummaryContract body, System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Users/VerifyUserIdentity");

var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
var content_ = new System.Net.Http.StringContent(json_);
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
request_.Content = content_;
request_.Method = new System.Net.Http.HttpMethod("POST");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));

PrepareRequest(client_, request_, urlBuilder_);

var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

PrepareRequest(client_, request_, url_);

var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
{
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
if (response_.Content != null && response_.Content.Headers != null)
{
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}

ProcessResponse(client_, response_);

var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
var objectResponse_ = await ReadObjectResponseAsync<MessageContract>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
return objectResponse_.Object;
}
else
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
finally
{
if (disposeResponse_)
response_.Dispose();
}
}
}
finally
{
if (disposeClient_)
client_.Dispose();
}
}

/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<Int64MessageContract> AddAsync(AddUserRequestContract body)
Expand Down Expand Up @@ -8450,6 +8606,36 @@ protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.Cal
}
}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))")]
public partial class UserHasExistsByUsernameRequestContract : System.ComponentModel.INotifyPropertyChanged
{
private string _username;

[Newtonsoft.Json.JsonProperty("username", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Username
{
get { return _username; }

set
{
if (_username != value)
{
_username = value;
RaisePropertyChanged();
}
}
}

public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null)
{
var handler = PropertyChanged;
if (handler != null)
handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))")]
public partial class UserRoleContract : System.ComponentModel.INotifyPropertyChanged
{
Expand Down Expand Up @@ -8698,6 +8884,52 @@ protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.Cal
}
}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))")]
public partial class UserSummaryContract : System.ComponentModel.INotifyPropertyChanged
{
private string _userName;
private string _password;

[Newtonsoft.Json.JsonProperty("userName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string UserName
{
get { return _userName; }

set
{
if (_userName != value)
{
_userName = value;
RaisePropertyChanged();
}
}
}

[Newtonsoft.Json.JsonProperty("password", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Password
{
get { return _password; }

set
{
if (_password != value)
{
_password = value;
RaisePropertyChanged();
}
}
}

public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null)
{
var handler = PropertyChanged;
if (handler != null)
handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))")]
public partial class ValidationContract : System.ComponentModel.INotifyPropertyChanged
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2526,6 +2526,104 @@
}
}
},
"/api/Users/UserHasExistsByUsername": {
"post": {
"tags": [
"Users"
],
"operationId": "UserHasExistsByUsername",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserHasExistsByUsernameRequestContract"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/UserHasExistsByUsernameRequestContract"
}
},
"application/*+json": {
"schema": {
"$ref": "#/components/schemas/UserHasExistsByUsernameRequestContract"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/MessageContract"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/MessageContract"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/MessageContract"
}
}
}
}
}
}
},
"/api/Users/VerifyUserIdentity": {
"post": {
"tags": [
"Users"
],
"operationId": "VerifyUserIdentity",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserSummaryContract"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/UserSummaryContract"
}
},
"application/*+json": {
"schema": {
"$ref": "#/components/schemas/UserSummaryContract"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/MessageContract"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/MessageContract"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/MessageContract"
}
}
}
}
}
}
},
"/api/Users/Add": {
"post": {
"tags": [
Expand Down Expand Up @@ -4047,6 +4145,16 @@
}
}
},
"UserHasExistsByUsernameRequestContract": {
"type": "object",
"additionalProperties": false,
"properties": {
"username": {
"type": "string",
"nullable": true
}
}
},
"UserRoleContract": {
"type": "object",
"additionalProperties": false,
Expand Down Expand Up @@ -4123,6 +4231,20 @@
}
}
},
"UserSummaryContract": {
"type": "object",
"additionalProperties": false,
"properties": {
"userName": {
"type": "string",
"nullable": true
},
"password": {
"type": "string",
"nullable": true
}
}
},
"ValidationContract": {
"type": "object",
"additionalProperties": false,
Expand Down
Loading

0 comments on commit 86c9d32

Please sign in to comment.