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

#45 Add GenerateDocumentationFile property and fix xml docs #46

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions DeepL/DeepL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>sgKey.snk</AssemblyOriginatorKeyFile>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion DeepL/Internal/DeepLClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public async Task<HttpResponseMessage> ApiPostAsync(
/// <param name="cancellationToken">The cancellation token to cancel operation.</param>
/// <param name="bodyParams">Parameters to embed in the HTTP request body.</param>
/// <param name="file">Optional file content to upload in request.</param>
/// <param name="fileName">If <see cref="file" /> is used, the name of file.</param>
/// <param name="fileName">If <paramref name="file"/> is used, the name of file.</param>
/// <returns><see cref="HttpResponseMessage" /> received from DeepL API.</returns>
/// <exception cref="ConnectionException">If any failure occurs while sending the request.</exception>
public async Task<HttpResponseMessage> ApiUploadAsync(
Expand Down
8 changes: 4 additions & 4 deletions DeepL/Internal/JsonUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ internal static class JsonUtils {
new JsonSerializerOptions { PropertyNamingPolicy = LowerSnakeCaseNamingPolicy.Instance };

/// <summary>
/// Deserializes JSON data in given HTTP response into a new object of <see cref="TValue" /> type, with fields named in
/// Deserializes JSON data in given HTTP response into a new object of <typeparamref name="TValue"/> type, with fields named in
/// lower-snake-case.
/// </summary>
/// <param name="responseMessage"><see cref="HttpResponseMessage" /> containing HTTP response received from DeepL API.</param>
/// <typeparam name="TValue">Type of deserialized object.</typeparam>
/// <returns>Object of <see cref="TValue" /> type initialized with values from JSON data.</returns>
/// <returns>Object of <typeparamref name="TValue"/> type initialized with values from JSON data.</returns>
/// <exception cref="DeepLException">If the JSON data could not be deserialized correctly.</exception>
internal static async Task<TValue> DeserializeAsync<TValue>(HttpResponseMessage responseMessage) =>
await DeserializeAsync<TValue>(await responseMessage.Content.ReadAsStreamAsync().ConfigureAwait(false))
.ConfigureAwait(false);

/// <summary>
/// Deserializes JSON data in given stream into a new object of <see cref="TValue" /> type, with fields named in
/// Deserializes JSON data in given stream into a new object of <typeparamref name="TValue"/> type, with fields named in
/// lower-snake-case.
/// </summary>
/// <param name="contentStream">Stream containing JSON data.</param>
/// <typeparam name="TValue">Type of deserialized object.</typeparam>
/// <returns>Object of <see cref="TValue" /> type initialized with values from JSON data.</returns>
/// <returns>Object of <typeparamref name="TValue"/> type initialized with values from JSON data.</returns>
/// <exception cref="DeepLException">If the JSON data could not be deserialized correctly.</exception>
internal static async Task<TValue> DeserializeAsync<TValue>(Stream contentStream) {
using var reader = new StreamReader(contentStream);
Expand Down
8 changes: 4 additions & 4 deletions DeepL/Translator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 DeepL SE (https://www.deepl.com)
// Copyright 2022 DeepL SE (https://www.deepl.com)
// Use of this source code is governed by an MIT
// license that can be found in the LICENSE file.

Expand Down Expand Up @@ -79,7 +79,7 @@ Task<TextResult> TranslateTextAsync(
/// If cancellation was requested, or an error occurs while translating the document. If the document was uploaded
/// successfully, then the <see cref="DocumentTranslationException.DocumentHandle" /> contains the document ID and
/// key that may be used to retrieve the document.
/// If cancellation was requested, the <see cref="DocumentTranslationException.InnerException" /> will be a
/// If cancellation was requested, the <see cref="DocumentTranslationException.DocumentHandle" /> will be a
/// <see cref="TaskCanceledException" />.
/// </exception>
Task TranslateDocumentAsync(
Expand All @@ -105,7 +105,7 @@ Task TranslateDocumentAsync(
/// If cancellation was requested, or an error occurs while translating the document. If the document was uploaded
/// successfully, then the <see cref="DocumentTranslationException.DocumentHandle" /> contains the document ID and
/// key that may be used to retrieve the document.
/// If cancellation was requested, the <see cref="DocumentTranslationException.InnerException" /> will be a
/// If cancellation was requested, the <see cref="DocumentTranslationException.DocumentHandle" /> will be a
/// <see cref="TaskCanceledException" />.
/// </exception>
Task TranslateDocumentAsync(
Expand Down Expand Up @@ -854,7 +854,7 @@ await _client.ApiGetAsync("/v2/languages", cancellationToken, queryParams)
/// <c>true</c> to send platform information with every API request (default),
/// <c>false</c> to only send the library version.
/// </param>
/// <param name="AppInfo">
/// <param name="appInfo">
/// Name and version of the application using this library. Ignored if null.
/// </param>
/// <returns>Enumerable of tuples containing the parameters to include in HTTP request.</returns>
Expand Down