Skip to content

Commit

Permalink
Version 1.1.0-v2.0-1.1.0 release (#3)
Browse files Browse the repository at this point in the history
Co-authored-by: root <root@devcenteradmin.docusigntest.com>
  • Loading branch information
RajRele and root authored Apr 12, 2022
1 parent 09698c7 commit 4db4abc
Show file tree
Hide file tree
Showing 32 changed files with 3,506 additions and 182 deletions.
11 changes: 3 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# DocuSign Monitor C# Client Changelog
See [DocuSign Support Center](https://support.docusign.com/en/releasenotes/) for Product Release Notes.

## [v1.0.0] - DocuSign Monitor API v2.0-1.0.1 - 06/28/2021
## [v1.1.0] - Monitor API v2.0-1.1.0 - 2022-04-11
### Changed
- First GA version of Monitor API.
- Added support for version v2.0-1.1.0 of the DocuSign Monitor API.
- Updated the SDK release version.

## [v1.0.0-beta] - DocuSign Monitor API v2.0-1.0.1 - 05/17/2021
### Changed
- First Beta version of Monitor API.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 DocuSign Inc.
Copyright (c) 2020 DocuSign Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ DocuSign provides a sample application code referred to as a [Launcher](https://

For details regarding which type of OAuth grant will work best for your DocuSign integration, see the [REST API Authentication Overview](https://developers.docusign.com/esign-rest-api/guides/authentication) guide located on the [DocuSign Developer Center](https://developers.docusign.com/).

The Monitor API can only be used with JWT authentication.
For security purposes, DocuSign recommends using the [Authorization Code Grant](https://developers.docusign.com/esign-rest-api/guides/authentication/oauth2-code-grant) flow.


## Support
Expand All @@ -83,7 +83,7 @@ Log issues against this client through GitHub. We also have an [active developer

## License

The DocuSign Monitor C# Client is licensed under the [MIT License](https://github.com/docusign/docusign-monitor-csharp-client/blob/master/LICENSE).
The DocuSign Rooms C# Client is licensed under the [MIT License](https://github.com/docusign/docusign-monitor-csharp-client/blob/master/LICENSE).


[nuget-image]: https://img.shields.io/nuget/v/DocuSign.Monitor.svg?style=flat
Expand Down
2,618 changes: 2,618 additions & 0 deletions sdk/.doxygenconfig

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk/.swagger-codegen/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.13-SNAPSHOT
2.4.21-SNAPSHOT
10 changes: 10 additions & 0 deletions sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# DocuSign Monitor C# Client Changelog
See [DocuSign Support Center](https://support.docusign.com/en/releasenotes/) for Product Release Notes.

## [v1.0.0] - DocuSign Monitor API v2.0-1.0.1 - 06/28/2021
### Changed
- First GA version of Monitor API.

## [v1.0.0-beta] - DocuSign Monitor API v2.0-1.0.1 - 05/17/2021
### Changed
- First Beta version of Monitor API.
246 changes: 245 additions & 1 deletion sdk/src/DocuSign.Monitor/Api/DataSetApi.cs

Large diffs are not rendered by default.

35 changes: 19 additions & 16 deletions sdk/src/DocuSign.Monitor/Client/ApiClient.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* DocuSign Monitor API - v2
* Monitor API
*
* An API for an integrator to access the features of DocuSign Monitor
*
Expand Down Expand Up @@ -215,6 +215,7 @@ private RestRequest PrepareRequest(

if (postBody.GetType() == typeof(String) || postBody.GetType() == typeof(byte[]))
{
request.AddHeader("Content-Disposition", "form-data;filename=fileXml.xml;name=fileXml;");
request.AddParameter(contentType, postBody, ParameterType.RequestBody);
}
}
Expand Down Expand Up @@ -352,21 +353,20 @@ public string ParameterToString(object obj)
/// <returns>Object representation of the JSON string.</returns>
public object Deserialize(IRestResponse response, Type type)
{
IList<Parameter> headers = response.Headers;
if (type == typeof(byte[])) // return byte array
{
return response.RawBytes;
}

if (type == typeof(Stream))
{
if (headers != null)
if (response.Headers != null)
{
var filePath = String.IsNullOrEmpty(Configuration.TempFolderPath)
? Path.GetTempPath()
: Configuration.TempFolderPath;
var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$");
foreach (var header in headers)
foreach (var header in response.Headers)
{
var match = regex.Match(header.ToString());
if (match.Success)
Expand Down Expand Up @@ -407,9 +407,8 @@ public object Deserialize(IRestResponse response, Type type)
/// </summary>
/// <param name="content">Byte Araay (e.g. PDF bytes).</param>
/// <param name="type">Object type.</param>
/// <param name="headers"></param>
/// <returns>Object representation of the JSON string.</returns>
public object Deserialize(byte[] content, Type type, IList<Parameter> headers = null)
public object Deserialize(byte[] content, Type type)
{
if (type == typeof(Stream))
{
Expand Down Expand Up @@ -757,7 +756,7 @@ private string GetOAuthBasePath()
public void SetBasePath(string basePath)
{
this.basePath = basePath;
if(Configuration != null)
if (Configuration != null)
{
Configuration.BasePath = this.basePath;
}
Expand Down Expand Up @@ -869,8 +868,9 @@ public OAuth.OAuthToken GenerateAccessToken(string clientId, string clientSecret
else
{
throw new ApiException((int)response.StatusCode,
"Error while requesting server, received a non successful HTTP code "
+ response.ResponseStatus + " with response Body: " + response.Content, response.Content);
"Error while requesting server, received a non successful HTTP code with response Body: " + response.Content,
response.Content,
response);
}
}

Expand Down Expand Up @@ -909,8 +909,9 @@ public OAuth.UserInfo GetUserInfo(string accessToken)
else
{
throw new ApiException((int)response.StatusCode,
"Error while requesting server, received a non successful HTTP code "
+ response.ResponseStatus + " with response Body: " + response.Content, response.Content);
"Error while requesting server, received a non successful HTTP code with response Body: " + response.Content,
response.Content,
response);
}
}

Expand Down Expand Up @@ -1083,8 +1084,9 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri
else
{
throw new ApiException((int)response.StatusCode,
"Error while requesting server, received a non successful HTTP code "
+ response.ResponseStatus + " with response Body: " + response.Content, response.Content);
"Error while requesting server, received a non successful HTTP code with response Body: " + response.Content,
response.Content,
response);
}
}

Expand Down Expand Up @@ -1180,9 +1182,10 @@ public OAuth.OAuthToken RequestJWTApplicationToken(string clientId, string oauth
else
{
throw new ApiException((int)response.StatusCode,
"Error while requesting server, received a non successful HTTP code "
+ response.ResponseStatus + " with response Body: " + response.Content, response.Content);
"Error while requesting server, received a non successful HTTP code with response Body: " + response.Content,
response.Content,
response);
}
}
}
}
}
108 changes: 65 additions & 43 deletions sdk/src/DocuSign.Monitor/Client/ApiException.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* DocuSign Monitor API - v2
* Monitor API
*
* An API for an integrator to access the features of DocuSign Monitor
*
Expand All @@ -8,53 +8,75 @@
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/

using RestSharp;
using System;
using System.Collections.Generic;
using System.Linq;

namespace DocuSign.Monitor.Client
{
/// <summary>
/// <summary>
/// API Exception
/// </summary>
public class ApiException : Exception
{
/// <summary>
/// Gets or sets the error code (HTTP status code)
/// </summary>
/// <value>The error code (HTTP status code).</value>
public int ErrorCode { get; set; }

/// <summary>
/// Gets or sets the error content (body json object)
/// </summary>
/// <value>The error content (Http response body).</value>
public dynamic ErrorContent { get; private set; }

/// <summary>
/// Initializes a new instance of the <see cref="ApiException"/> class.
/// </summary>
public ApiException() {}

/// <summary>
/// Initializes a new instance of the <see cref="ApiException"/> class.
/// </summary>
/// <param name="errorCode">HTTP status code.</param>
/// <param name="message">Error message.</param>
public ApiException(int errorCode, string message) : base(message)
{
this.ErrorCode = errorCode;
}

/// <summary>
/// Initializes a new instance of the <see cref="ApiException"/> class.
/// </summary>
/// <param name="errorCode">HTTP status code.</param>
/// <param name="message">Error message.</param>
/// <param name="errorContent">Error content.</param>
public ApiException(int errorCode, string message, dynamic errorContent = null) : base(message)
{
this.ErrorCode = errorCode;
this.ErrorContent = errorContent;
}
}
public class ApiException : Exception
{
/// <summary>
/// Gets or sets the error code (HTTP status code)
/// </summary>
/// <value>The error code (HTTP status code).</value>
public int ErrorCode { get; set; }

/// <summary>
/// Gets or sets the error content (body json object)
/// </summary>
/// <value>The error content (Http response body).</value>
public dynamic ErrorContent { get; private set; }

/// <summary>
/// Gets or sets the error message
/// </summary>
/// <value>The error message.</value>
public string ErrorMessage { get; set; }

/// <summary>
/// Gets or sets the HTTP headers
/// </summary>
/// <value>HTTP headers</value>
public IDictionary<string, string> Headers { get; private set; }

/// <summary>
/// Initializes a new instance of the <see cref="ApiException"/> class.
/// </summary>
public ApiException() {}

/// <summary>
/// Initializes a new instance of the <see cref="ApiException"/> class.
/// </summary>
/// <param name="errorCode">HTTP status code.</param>
/// <param name="message">Error message.</param>
public ApiException(int errorCode, string message) : base(message)
{
this.ErrorCode = errorCode;
this.ErrorMessage = message;
}

/// <summary>
/// Initializes a new instance of the <see cref="ApiException"/> class.
/// </summary>
/// <param name="errorCode">HTTP status code.</param>
/// <param name="message">Error message.</param>
/// <param name="errorContent">Error content.</param>
/// <param name="response">IRestResponse object.</param>
public ApiException(int errorCode, string message, dynamic errorContent = null, IRestResponse response = null) : base(message)
{
this.ErrorCode = errorCode;
this.ErrorContent = errorContent;
if (response != null && response.Headers != null)
{
this.ErrorMessage = response.ErrorMessage;
this.Headers = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
}
}
}

}
2 changes: 1 addition & 1 deletion sdk/src/DocuSign.Monitor/Client/ApiResponse.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* DocuSign Monitor API - v2
* Monitor API
*
* An API for an integrator to access the features of DocuSign Monitor
*
Expand Down
8 changes: 4 additions & 4 deletions sdk/src/DocuSign.Monitor/Client/Configuration.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* DocuSign Monitor API - v2
* Monitor API
*
* An API for an integrator to access the features of DocuSign Monitor
*
Expand All @@ -26,7 +26,7 @@ public class Configuration
/// Version of the package.
/// </summary>
/// <value>Version of the package.</value>
public const string Version = "1.0.0";
public const string Version = "1.1.0";

/// <summary>
/// Identifier for ISO 8601 DateTime Format
Expand All @@ -48,8 +48,8 @@ public class Configuration
public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) =>
{
int status = (int)response.StatusCode;
if (status >= 400) return new ApiException(status, String.Format("Error calling {0}: {1}", methodName, response.Content), response.Content);
if (status == 0) return new ApiException(status, String.Format("Error calling {0}: {1}", methodName, response.ErrorMessage), response.ErrorMessage);
if (status >= 400) return new ApiException(status, String.Format("Error calling {0}: {1}", methodName, response.Content), response.Content, response);
if (status == 0) return new ApiException(status, String.Format("Error calling {0}: {1}", methodName, response.ErrorMessage), response.ErrorMessage, response);
return null;
};

Expand Down
2 changes: 1 addition & 1 deletion sdk/src/DocuSign.Monitor/Client/ExceptionFactory.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* DocuSign Monitor API - v2
* Monitor API
*
* An API for an integrator to access the features of DocuSign Monitor
*
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/DocuSign.Monitor/Client/GlobalConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* DocuSign Monitor API - v2
* Monitor API
*
* An API for an integrator to access the features of DocuSign Monitor
*
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/DocuSign.Monitor/Client/IApiAccessor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* DocuSign Monitor API - v2
* Monitor API
*
* An API for an integrator to access the features of DocuSign Monitor
*
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/DocuSign.Monitor/Client/IReadableConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* DocuSign Monitor API - v2
* Monitor API
*
* An API for an integrator to access the features of DocuSign Monitor
*
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/DocuSign.Monitor/Client/SwaggerDateConverter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* DocuSign Monitor API - v2
* Monitor API
*
* An API for an integrator to access the features of DocuSign Monitor
*
Expand Down
Loading

0 comments on commit 4db4abc

Please sign in to comment.