Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.6.1 #15

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
413 changes: 0 additions & 413 deletions .openapi-generator/FILES

This file was deleted.

1 change: 0 additions & 1 deletion .openapi-generator/VERSION

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022 dropbox.com
Copyright (c) 2024 dropbox.com

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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ directory that corresponds to the file you want updated.
This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 3.0.0
- SDK version: 1.6.0
- SDK version: 1.6.1
- Generator version: 7.8.0
- Build package: org.openapitools.codegen.languages.CSharpClientCodegen

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.0
1.6.1
2 changes: 1 addition & 1 deletion docs/FaxLineApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public class Example
var faxLineApi = new FaxLineApi(config);

var data = new FaxLineDeleteRequest(
number: "[FAX_NUMBER]",
number: "[FAX_NUMBER]"
);

try
Expand Down
2 changes: 1 addition & 1 deletion docs/TemplateApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ public class Example
};

var data = new TemplateUpdateFilesRequest(
files: files,
files: files
);

var templateId = "21f920ec2b7f4b6bb64d3ed79f26303843046536";
Expand Down
2 changes: 1 addition & 1 deletion examples/FaxLineDelete.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static void Main()
var faxLineApi = new FaxLineApi(config);

var data = new FaxLineDeleteRequest(
number: "[FAX_NUMBER]",
number: "[FAX_NUMBER]"
);

try
Expand Down
2 changes: 1 addition & 1 deletion examples/TemplateUpdateFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static void Main()
};

var data = new TemplateUpdateFilesRequest(
files: files,
files: files
);

var templateId = "21f920ec2b7f4b6bb64d3ed79f26303843046536";
Expand Down
10 changes: 7 additions & 3 deletions openapi-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,23 @@ additionalProperties:
packageCompany: Dropbox Sign API Team
packageCopyright: Dropbox 2024
packageDescription: Client library for using the Dropbox Sign API
packageVersion: 1.6.0
packageVersion: 1.6.1
packageTitle: Dropbox Sign .Net SDK
sortModelPropertiesByRequiredFlag: true
optionalEmitDefaultValues: true
targetFramework: net6.0
packageGuid: "{F8C8232D-7020-4603-8E04-18D060AE530B}"
legacyDiscriminatorBehavior: true
useCustomTemplateCode: true
licenseCopyrightYear: 2024
files:
EventCallbackHelper.cs:
dropbox-EventCallbackHelper.cs:
templateType: SupportingFiles
destinationFilename: src/Dropbox.Sign/EventCallbackHelper.cs
VERSION.mustache:
dropbox-LICENSE.mustache:
templateType: SupportingFiles
destinationFilename: LICENSE
dropbox-VERSION.mustache:
templateType: SupportingFiles
destinationFilename: VERSION
globalProperties:
Expand Down
3 changes: 2 additions & 1 deletion run-build
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ docker run --rm \
-t "/local/templates" \
-o "/local/"

bash "${DIR}/bin/dotnet" dotnet format ./

printf "\nInstalling composer dependencies ...\n"
mkdir -p "${DIR}/vendor"
bash "${DIR}/bin/php" composer install
Expand Down Expand Up @@ -48,4 +50,3 @@ printf "Running tests ...\n"
bash "${DIR}/bin/dotnet" dotnet test src/Dropbox.Sign.Test/

printf "Success!\n"

6 changes: 3 additions & 3 deletions src/Dropbox.Sign.Test/Api/SignatureRequestApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void SignatureRequestBulkSendWithTemplateTest()
TestHelper.AssertJsonSame(responseData.ToString(), response.ToJson());
}

[Fact(Skip="POST /signature_request/cancel/{signature_request_id} skipped")]
[Fact(Skip = "POST /signature_request/cancel/{signature_request_id} skipped")]
public void SignatureRequestCancelTest()
{
}
Expand Down Expand Up @@ -106,7 +106,7 @@ public void SignatureRequestCreateEmbeddedWithTemplateTest()
TestHelper.AssertJsonSame(responseData.ToString(), response.ToJson());
}

[Fact(Skip="GET /signature_request/files/{signature_request_id} skipped")]
[Fact(Skip = "GET /signature_request/files/{signature_request_id} skipped")]
public void SignatureRequestFilesTest()
{
}
Expand Down Expand Up @@ -168,7 +168,7 @@ public void SignatureRequestRemindTest()
TestHelper.AssertJsonSame(responseData.ToString(), response.ToJson());
}

[Fact(Skip="POST /signature_request/remove/{signature_request_id} skipped")]
[Fact(Skip = "POST /signature_request/remove/{signature_request_id} skipped")]
public void SignatureRequestRemoveTest()
{
}
Expand Down
2 changes: 1 addition & 1 deletion src/Dropbox.Sign.Test/Api/TeamApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void TeamCreateTest()
TestHelper.AssertJsonSame(responseData.ToString(), response.ToJson());
}

[Fact(Skip="DELETE /team/destroy skipped")]
[Fact(Skip = "DELETE /team/destroy skipped")]
public void TeamDeleteTest()
{
}
Expand Down
4 changes: 2 additions & 2 deletions src/Dropbox.Sign.Test/Api/TemplateApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ public void TemplateCreateEmbeddedDraftTest()
TestHelper.AssertJsonSame(responseData.ToString(), response.ToJson());
}

[Fact(Skip="POST /template/delete/{template_id} skipped")]
[Fact(Skip = "POST /template/delete/{template_id} skipped")]
public void TemplateDeleteTest()
{
}

[Fact(Skip="GET /template/files/{signature_request_id} skipped")]
[Fact(Skip = "GET /template/files/{signature_request_id} skipped")]
public void TemplateFilesTest()
{
}
Expand Down
4 changes: 2 additions & 2 deletions src/Dropbox.Sign.Test/EventCallbackHelperTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void IsValidTest()
EventCallbackHelper.GetCallbackType(callbackEvent)
);
}

var app_keys = new List<string>
{
"base",
Expand All @@ -53,7 +53,7 @@ public void IsValidTest()
Assert.True(EventCallbackHelper.IsValid(ApiKey, callbackEvent));
Assert.False(EventCallbackHelper.IsValid(Reverse(ApiKey), callbackEvent));
Assert.Equal(
EventCallbackHelper.EVENT_TYPE_APP_CALLBACK,
EventCallbackHelper.EVENT_TYPE_APP_CALLBACK,
EventCallbackHelper.GetCallbackType(callbackEvent)
);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Dropbox.Sign.Test/MockRestClientHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static T CreateApiExpectContentContains<S, T>(S data,
.With(request =>
{
var stream = request.Content.ReadAsStream();
var streamReader = new StreamReader( stream );
var streamReader = new StreamReader(stream);
var content = streamReader.ReadToEnd();
return values.All(value => content.Contains(value));
})
Expand All @@ -85,13 +85,13 @@ private static T CreateApiInternal<T>(MockHttpMessageHandler handler)
var mockRestClient = new RestClient(options,
configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, GlobalConfiguration.Instance))
);

Configuration config = new Configuration();
config.Username = "YOUR_API_KEY";
var client = new ApiClient(config.BasePath, mockRestClient);
return (T)Activator.CreateInstance(typeof(T), client, client, config);
}

/// <summary>
/// Specifies the settings on a <see cref="JsonSerializer" /> object.
/// These settings can be adjusted to accommodate custom serialization rules.
Expand All @@ -109,7 +109,7 @@ private static T CreateApiInternal<T>(MockHttpMessageHandler handler)
}
};
}

// see ApiClient::CustomJsonCodec
internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static IEnumerable<object[]> Data()
var payload = JsonConvert.DeserializeObject<Dictionary<string, object>>(r.ReadToEnd());
Assert.NotNull(payload);

return new List<object[]> {new object[] {payload}};
return new List<object[]> { new object[] { payload } };
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/Dropbox.Sign/Client/ApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,15 @@ public ApiClient(string basePath)
}

/// <summary>
/// Initializes a new instance of the <see cref="ApiClient" />. This should be used in unit tests only
/// </summary>
/// Initializes a new instance of the <see cref="ApiClient" />. This should be used in unit tests only
/// </summary>
/// <param name="basePath">The target service's base path in URL format.</param>
/// <param name="mockClient">Mock client for unit testing purpose </param>
/// <exception cref="ArgumentException"></exception>
public ApiClient(string basePath, RestClient mockClient)
{
if (string.IsNullOrEmpty(basePath))
throw new ArgumentException("basePath cannot be empty");
throw new ArgumentException("basePath cannot be empty");

_baseUrl = basePath;
_restClient = mockClient;
Expand Down Expand Up @@ -479,7 +479,7 @@ private async Task<ApiResponse<T>> ExecClientAsync<T>(Func<RestClient, Task<Rest
RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback
};
setOptions(clientOptions);

RestClient client = _restClient;
if (client == null)
{
Expand Down Expand Up @@ -559,7 +559,7 @@ private async Task<ApiResponse<T>> ExecClientAsync<T>(Func<RestClient, Task<Rest

private RestResponse<T> DeserializeRestResponseFromPolicy<T>(RestClient client, RestRequest request, PolicyResult<RestResponse> policyResult)
{
if (policyResult.Outcome == OutcomeType.Successful)
if (policyResult.Outcome == OutcomeType.Successful)
{
return client.Deserialize<T>(policyResult.Result);
}
Expand All @@ -571,7 +571,7 @@ private RestResponse<T> DeserializeRestResponseFromPolicy<T>(RestClient client,
};
}
}

private ApiResponse<T> Exec<T>(RestRequest request, RequestOptions options, IReadableConfiguration configuration)
{
Action<RestClientOptions> setOptions = (clientOptions) =>
Expand Down
11 changes: 7 additions & 4 deletions src/Dropbox.Sign/Client/ClientUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ public static Multimap<string, string> ParameterToMultiMap(string collectionForm
}
else if (value is IDictionary dictionary)
{
if(collectionFormat == "deepObject") {
if (collectionFormat == "deepObject")
{
foreach (DictionaryEntry entry in dictionary)
{
parameters.Add(name + "[" + entry.Key + "]", ParameterToString(entry.Value));
}
}
else {
else
{
foreach (DictionaryEntry entry in dictionary)
{
parameters.Add(entry.Key.ToString(), ParameterToString(entry.Value));
Expand Down Expand Up @@ -105,7 +107,8 @@ public static string ParameterToString(object obj, IReadableConfiguration config
return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat);
if (obj is bool boolean)
return boolean ? "true" : "false";
if (obj is ICollection collection) {
if (obj is ICollection collection)
{
List<string> entries = new List<string>();
foreach (var entry in collection)
entries.Add(ParameterToString(entry, configuration));
Expand Down Expand Up @@ -225,7 +228,7 @@ private static bool HasEnumMemberAttrValue(object enumVal)
var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException());
var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType<EnumMemberAttribute>().FirstOrDefault();
if (attr != null) return true;
return false;
return false;
}

/// <summary>
Expand Down
12 changes: 6 additions & 6 deletions src/Dropbox.Sign/Client/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class Configuration : IReadableConfiguration
/// Version of the package.
/// </summary>
/// <value>Version of the package.</value>
public const string Version = "1.6.0";
public const string Version = "1.6.1";

/// <summary>
/// Identifier for ISO 8601 DateTime Format
Expand Down Expand Up @@ -120,7 +120,7 @@ public class Configuration : IReadableConfiguration
public Configuration()
{
Proxy = null;
UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.6.0/csharp");
UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.6.1/csharp");
BasePath = "https://api.hellosign.com/v3";
DefaultHeaders = new ConcurrentDictionary<string, string>();
ApiKey = new ConcurrentDictionary<string, string>();
Expand Down Expand Up @@ -210,7 +210,7 @@ public Configuration(
/// <summary>
/// Gets or sets the base path for API access.
/// </summary>
public virtual string BasePath
public virtual string BasePath
{
get { return _basePath; }
set { _basePath = value; }
Expand Down Expand Up @@ -548,7 +548,7 @@ private string GetServerUrl(IList<IReadOnlyDictionary<string, object>> servers,

return url;
}

/// <summary>
/// Gets and Sets the RemoteCertificateValidationCallback
/// </summary>
Expand All @@ -565,9 +565,9 @@ public static string ToDebugReport()
{
string report = "C# SDK (Dropbox.Sign) Debug Report:\n";
report += " OS: " + System.Environment.OSVersion + "\n";
report += " .NET Framework Version: " + System.Environment.Version + "\n";
report += " .NET Framework Version: " + System.Environment.Version + "\n";
report += " Version of the API: 3.0.0\n";
report += " SDK Package Version: 1.6.0\n";
report += " SDK Package Version: 1.6.1\n";

return report;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Dropbox.Sign/Dropbox.Sign.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<Description>Client library for using the Dropbox Sign API</Description>
<Copyright>Dropbox 2024</Copyright>
<RootNamespace>Dropbox.Sign</RootNamespace>
<Version>1.6.0</Version>
<Version>1.6.1</Version>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\Dropbox.Sign.xml</DocumentationFile>
<RepositoryUrl>https://github.com/hellosign/dropbox-sign-dotnet.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand Down
2 changes: 1 addition & 1 deletion src/Dropbox.Sign/EventCallbackHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class EventCallbackHelper

public const string EVENT_TYPE_APP_CALLBACK = "app_callback";

private EventCallbackHelper() {}
private EventCallbackHelper() { }

/// <summary>
/// Verify that a callback came from HelloSign.com
Expand Down
2 changes: 1 addition & 1 deletion src/Dropbox.Sign/Model/AbstractOpenAPISchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Dropbox.Sign.Model
public struct OpenApiType
{
public string Name { set; get; }
public string Property { set; get; }
public string Property { set; get; }
public string Type { set; get; }
public object Value { set; get; }
}
Expand Down
Loading
Loading