Skip to content

Commit

Permalink
Update XML docs formatting, some words, grammar. (#944)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielskovli authored Dec 5, 2024
1 parent 1571ee0 commit aae3a6c
Show file tree
Hide file tree
Showing 63 changed files with 469 additions and 588 deletions.
24 changes: 8 additions & 16 deletions src/Altinn.App.Api/Extensions/HttpClientBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,10 @@ namespace Altinn.App.Api.Extensions;
public static class HttpClientBuilderExtensions
{
/// <summary>
/// <para>
/// Authorises all requests with Maskinporten using the provided scopes,
/// and injects the resulting token in the Authorization header using the Bearer scheme.
/// </para>
/// <para>
/// If your target API does <em>not</em> use this authorisation scheme, you should consider implementing
/// <see cref="MaskinportenClient.GetAccessToken"/> directly and handling the specifics manually.
/// </para>
/// <p>Authorises all requests with Maskinporten using the provided scopes,
/// and injects the resulting token in the Authorization header using the Bearer scheme.</p>
/// <p>If your target API does <em>not</em> use this authorisation scheme, you should consider implementing
/// <see cref="MaskinportenClient.GetAccessToken"/> directly and handling the specifics manually.</p>
/// </summary>
/// <param name="builder">The Http client builder</param>
/// <param name="scope">The scope to claim authorization for with Maskinporten</param>
Expand All @@ -32,15 +28,11 @@ params string[] additionalScopes
}

/// <summary>
/// <para>
/// Authorises all requests with Maskinporten using the provided scopes.
/// <p>Authorises all requests with Maskinporten using the provided scopes.
/// The resulting token is then exchanged for an Altinn issued token and injected in
/// the Authorization header using the Bearer scheme.
/// </para>
/// <para>
/// If your target API does <em>not</em> use this authorisation scheme, you should consider implementing
/// <see cref="MaskinportenClient.GetAltinnExchangedToken(IEnumerable{string}, CancellationToken)"/> directly and handling the specifics manually.
/// </para>
/// the Authorization header using the Bearer scheme.</p>
/// <p>If your target API does <em>not</em> use this authorisation scheme, you should consider implementing
/// <see cref="MaskinportenClient.GetAltinnExchangedToken(IEnumerable{string}, CancellationToken)"/> directly and handling the specifics manually.</p>
/// </summary>
/// <param name="builder">The Http client builder</param>
/// <param name="scope">The scope to claim authorization for with Maskinporten</param>
Expand Down
20 changes: 6 additions & 14 deletions src/Altinn.App.Api/Extensions/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,9 @@ IWebHostEnvironment env
}

/// <summary>
/// <para>
/// Configures the <see cref="MaskinportenClient"/> service with a configuration object which will be static for the lifetime of the service.
/// </para>
/// <para>
/// If you have already provided a <see cref="MaskinportenSettings"/> configuration, either manually or
/// implicitly via <see cref="WebHostBuilderExtensions.ConfigureAppWebHost"/>, this will be overridden.
/// </para>
/// <p>Configures the <see cref="MaskinportenClient"/> service with a configuration object which will be static for the lifetime of the service.</p>
/// <p>If you have already provided a <see cref="MaskinportenSettings"/> configuration, either manually or
/// implicitly via <see cref="WebHostBuilderExtensions.ConfigureAppWebHost"/>, this will be overridden.</p>
/// </summary>
/// <param name="services">The service collection</param>
/// <param name="configureOptions">
Expand All @@ -145,13 +141,9 @@ Action<MaskinportenSettings> configureOptions
}

/// <summary>
/// <para>
/// Binds a <see cref="MaskinportenClient"/> configuration to the supplied config section path.
/// </para>
/// <para>
/// If you have already provided a <see cref="MaskinportenSettings"/> configuration, either manually or
/// implicitly via <see cref="WebHostBuilderExtensions.ConfigureAppWebHost"/>, this will be overridden.
/// </para>
/// <p>Binds a <see cref="MaskinportenClient"/> configuration to the supplied config section path.</p>
/// <p>If you have already provided a <see cref="MaskinportenSettings"/> configuration, either manually or
/// implicitly via <see cref="WebHostBuilderExtensions.ConfigureAppWebHost"/>, this will be overridden.</p>
/// </summary>
/// <param name="services">The service collection</param>
/// <param name="configSectionPath">The configuration section path (Eg. "MaskinportenSettings")</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,10 @@ public class AutoValidateAntiforgeryTokenIfAuthCookieAttribute : Attribute, IFil
/// ascending numeric value of the <see cref="Order"/> property.
/// </summary>
/// <remarks>
/// <para>
/// Filters are executed in a sequence determined by an ascending sort of the <see cref="Order"/> property.
/// </para>
/// <para>
/// The default Order for this attribute is 1000 because it must run after any filter which does authentication
/// or login in order to allow them to behave as expected (ie Unauthenticated or Redirect instead of 400).
/// </para>
/// <para>
/// Look at <see cref="IOrderedFilter.Order"/> for more detailed info.
/// </para>
/// <p>Filters are executed in a sequence determined by an ascending sort of the <see cref="Order"/> property.</p>
/// <p>The default Order for this attribute is 1000 because it must run after any filter which does authentication
/// or login in order to allow them to behave as expected (ie Unauthenticated or Redirect instead of 400).</p>
/// <p>Look at <see cref="IOrderedFilter.Order"/> for more detailed info.</p>
/// </remarks>
public int Order { get; set; } = 1000;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ namespace Altinn.App.Core.Features.Correspondence.Builder;
internal static class BuilderUtils
{
/// <summary>
/// Because of the interface-chaining in this builder, some properties are guaranteed to be non-null.
/// But the compiler doesn't trust that, so we add this check where needed.
///
/// Additionally this method checks for empty strings and empty data allocations.
/// <p>Because of the interface-chaining in this builder, some properties are guaranteed to be non-null.
/// But the compiler doesn't trust that, so we add this check where needed.</p>
/// <p>Additionally, this method checks for empty strings and empty data allocations.</p>
/// </summary>
/// <param name="value">The value to assert</param>
/// <param name="errorMessage">The error message to throw, if the value was null</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Altinn.App.Core.Features.Correspondence.Builder;

/// <summary>
/// Builder factory for creating <see cref="CorrespondenceAttachment"/> objects
/// Builder factory for creating <see cref="CorrespondenceAttachment"/> objects.
/// </summary>
public class CorrespondenceAttachmentBuilder : ICorrespondenceAttachmentBuilder
{
Expand All @@ -19,7 +19,7 @@ public class CorrespondenceAttachmentBuilder : ICorrespondenceAttachmentBuilder
private CorrespondenceAttachmentBuilder() { }

/// <summary>
/// Creates a new <see cref="CorrespondenceAttachmentBuilder"/> instance
/// Creates a new <see cref="CorrespondenceAttachmentBuilder"/> instance.
/// </summary>
public static ICorrespondenceAttachmentBuilderFilename Create() => new CorrespondenceAttachmentBuilder();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Altinn.App.Core.Features.Correspondence.Builder;

/// <summary>
/// Builder factory for creating <see cref="CorrespondenceContent"/> objects
/// Builder factory for creating <see cref="CorrespondenceContent"/> objects.
/// </summary>
public class CorrespondenceContentBuilder : ICorrespondenceContentBuilder
{
Expand All @@ -16,7 +16,7 @@ public class CorrespondenceContentBuilder : ICorrespondenceContentBuilder
private CorrespondenceContentBuilder() { }

/// <summary>
/// Creates a new <see cref="CorrespondenceContentBuilder"/> instance
/// Creates a new <see cref="CorrespondenceContentBuilder"/> instance.
/// </summary>
/// <returns></returns>
public static ICorrespondenceContentBuilderLanguage Create() => new CorrespondenceContentBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Altinn.App.Core.Features.Correspondence.Builder;

/// <summary>
/// Builder factory for creating <see cref="CorrespondenceNotification"/> objects
/// Builder factory for creating <see cref="CorrespondenceNotification"/> objects.
/// </summary>
public class CorrespondenceNotificationBuilder : ICorrespondenceNotificationBuilder
{
Expand All @@ -23,9 +23,8 @@ public class CorrespondenceNotificationBuilder : ICorrespondenceNotificationBuil
private CorrespondenceNotificationBuilder() { }

/// <summary>
/// Creates a new <see cref="CorrespondenceNotificationBuilder"/> instance
/// Creates a new <see cref="CorrespondenceNotificationBuilder"/> instance.
/// </summary>
/// <returns></returns>
public static ICorrespondenceNotificationBuilderTemplate Create() => new CorrespondenceNotificationBuilder();

/// <inheritdoc/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Altinn.App.Core.Features.Correspondence.Builder;

/// <summary>
/// Builder factory for creating <see cref="CorrespondenceRequest"/> objects
/// Builder factory for creating <see cref="CorrespondenceRequest"/> objects.
/// </summary>
public class CorrespondenceRequestBuilder : ICorrespondenceRequestBuilder
{
Expand All @@ -29,7 +29,7 @@ public class CorrespondenceRequestBuilder : ICorrespondenceRequestBuilder
private CorrespondenceRequestBuilder() { }

/// <summary>
/// Creates a new <see cref="CorrespondenceRequestBuilder"/> instance
/// Creates a new <see cref="CorrespondenceRequestBuilder"/> instance.
/// </summary>
public static ICorrespondenceRequestBuilderResourceId Create() => new CorrespondenceRequestBuilder();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,68 +4,68 @@
namespace Altinn.App.Core.Features.Correspondence.Builder;

/// <summary>
/// Indicates that the <see cref="CorrespondenceAttachmentBuilder"/> instance is on the <see cref="CorrespondenceAttachment.Filename"/> step
/// Indicates that the <see cref="CorrespondenceAttachmentBuilder"/> instance is on the <see cref="CorrespondenceAttachment.Filename"/> step.
/// </summary>
public interface ICorrespondenceAttachmentBuilderFilename
{
/// <summary>
/// Sets the filename of the attachment
/// Sets the filename of the attachment.
/// </summary>
/// <param name="filename">The attachment filename</param>
ICorrespondenceAttachmentBuilderName WithFilename(string filename);
}

/// <summary>
/// Indicates that the <see cref="CorrespondenceAttachmentBuilder"/> instance is on the <see cref="CorrespondenceAttachment.Name"/> step
/// Indicates that the <see cref="CorrespondenceAttachmentBuilder"/> instance is on the <see cref="CorrespondenceAttachment.Name"/> step.
/// </summary>
public interface ICorrespondenceAttachmentBuilderName
{
/// <summary>
/// Sets the display name of the attachment
/// Sets the display name of the attachment.
/// </summary>
/// <param name="name">The display name</param>
ICorrespondenceAttachmentBuilderSendersReference WithName(string name);
}

/// <summary>
/// Indicates that the <see cref="CorrespondenceAttachmentBuilder"/> instance is on the <see cref="CorrespondenceAttachment.SendersReference"/> step
/// Indicates that the <see cref="CorrespondenceAttachmentBuilder"/> instance is on the <see cref="CorrespondenceAttachment.SendersReference"/> step.
/// </summary>
public interface ICorrespondenceAttachmentBuilderSendersReference
{
/// <summary>
/// Sets the senders reference for the attachment
/// Sets the senders reference for the attachment.
/// </summary>
/// <param name="sendersReference">The reference value</param>
ICorrespondenceAttachmentBuilderDataType WithSendersReference(string sendersReference);
}

/// <summary>
/// Indicates that the <see cref="CorrespondenceAttachmentBuilder"/> instance is on the <see cref="CorrespondenceAttachment.DataType"/> step
/// Indicates that the <see cref="CorrespondenceAttachmentBuilder"/> instance is on the <see cref="CorrespondenceAttachment.DataType"/> step.
/// </summary>
public interface ICorrespondenceAttachmentBuilderDataType
{
/// <summary>
/// Sets the data type of the attachment in MIME format
/// Sets the data type of the attachment in MIME format.
/// </summary>
/// <remarks>See <see cref="MediaTypeNames"/></remarks>
/// <param name="dataType">The MIME type of the attachment</param>
ICorrespondenceAttachmentBuilderData WithDataType(string dataType);
}

/// <summary>
/// Indicates that the <see cref="CorrespondenceAttachmentBuilder"/> instance is on the <see cref="CorrespondenceAttachment.Data"/> step
/// Indicates that the <see cref="CorrespondenceAttachmentBuilder"/> instance is on the <see cref="CorrespondenceAttachment.Data"/> step.
/// </summary>
public interface ICorrespondenceAttachmentBuilderData
{
/// <summary>
/// Sets the data content of the attachment
/// Sets the data content of the attachment.
/// </summary>
/// <param name="data">The data</param>
ICorrespondenceAttachmentBuilder WithData(ReadOnlyMemory<byte> data);
}

/// <summary>
/// Indicates that the <see cref="CorrespondenceAttachmentBuilder"/> instance has completed all required steps and can proceed to <see cref="CorrespondenceAttachmentBuilder.Build"/>
/// Indicates that the <see cref="CorrespondenceAttachmentBuilder"/> instance has completed all required steps and can proceed to <see cref="CorrespondenceAttachmentBuilder.Build"/>.
/// </summary>
public interface ICorrespondenceAttachmentBuilder
: ICorrespondenceAttachmentBuilderFilename,
Expand All @@ -75,20 +75,20 @@ public interface ICorrespondenceAttachmentBuilder
ICorrespondenceAttachmentBuilderData
{
/// <summary>
/// Sets whether the attachment is encrypted or not
/// Sets whether the attachment is encrypted or not.
/// </summary>
/// <param name="isEncrypted">`true` for encrypted, `false` otherwise</param>
/// <param name="isEncrypted"><c>true</c> for encrypted, <c>false</c> otherwise</param>
ICorrespondenceAttachmentBuilder WithIsEncrypted(bool isEncrypted);

/// <summary>
/// Sets the storage location of the attachment data
/// Sets the storage location of the attachment data.
/// </summary>
/// <remarks>In this context, it is extremely likely that the storage location is <see cref="CorrespondenceDataLocationType.ExistingCorrespondenceAttachment"/></remarks>
/// <param name="dataLocationType">The data storage location</param>
ICorrespondenceAttachmentBuilder WithDataLocationType(CorrespondenceDataLocationType dataLocationType);

/// <summary>
/// Builds the correspondence attachment
/// Builds the correspondence attachment.
/// </summary>
CorrespondenceAttachment Build();
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,61 @@
namespace Altinn.App.Core.Features.Correspondence.Builder;

/// <summary>
/// Indicates that the <see cref="CorrespondenceContentBuilder"/> instance is on the <see cref="CorrespondenceContent.Language"/> step
/// Indicates that the <see cref="CorrespondenceContentBuilder"/> instance is on the <see cref="CorrespondenceContent.Language"/> step.
/// </summary>
public interface ICorrespondenceContentBuilderLanguage
{
/// <summary>
/// Sets the language of the correspondence content
/// Sets the language of the correspondence content.
/// </summary>
/// <param name="language">The content language</param>
ICorrespondenceContentBuilderTitle WithLanguage(LanguageCode<Iso6391> language);

/// <summary>
/// Sets the language of the correspondence content
/// Sets the language of the correspondence content.
/// </summary>
/// <param name="language">The content language in ISO 639-1 format</param>
ICorrespondenceContentBuilderTitle WithLanguage(string language);
}

/// <summary>
/// Indicates that the <see cref="CorrespondenceContentBuilder"/> instance is on the <see cref="CorrespondenceContent.Title"/> step
/// Indicates that the <see cref="CorrespondenceContentBuilder"/> instance is on the <see cref="CorrespondenceContent.Title"/> step.
/// </summary>
public interface ICorrespondenceContentBuilderTitle
{
/// <summary>
/// Sets the title of the correspondence content
/// Sets the title of the correspondence content.
/// </summary>
/// <param name="title">The correspondence title</param>
ICorrespondenceContentBuilderSummary WithTitle(string title);
}

/// <summary>
/// Indicates that the <see cref="CorrespondenceContentBuilder"/> instance is on the <see cref="CorrespondenceContent.Summary"/> step
/// Indicates that the <see cref="CorrespondenceContentBuilder"/> instance is on the <see cref="CorrespondenceContent.Summary"/> step.
/// </summary>
public interface ICorrespondenceContentBuilderSummary
{
/// <summary>
/// Sets the summary of the correspondence content
/// Sets the summary of the correspondence content.
/// </summary>
/// <param name="summary">The summary of the message</param>
ICorrespondenceContentBuilderBody WithSummary(string summary);
}

/// <summary>
/// Indicates that the <see cref="CorrespondenceContentBuilder"/> instance is on the <see cref="CorrespondenceContent.Body"/> step
/// Indicates that the <see cref="CorrespondenceContentBuilder"/> instance is on the <see cref="CorrespondenceContent.Body"/> step.
/// </summary>
public interface ICorrespondenceContentBuilderBody
{
/// <summary>
/// Sets the body of the correspondence content
/// Sets the body of the correspondence content.
/// </summary>
/// <param name="body">The full text (body) of the message</param>
ICorrespondenceContentBuilder WithBody(string body);
}

/// <summary>
/// Indicates that the <see cref="CorrespondenceContentBuilder"/> instance has completed all required steps and can proceed to <see cref="CorrespondenceContentBuilder.Build"/>
/// Indicates that the <see cref="CorrespondenceContentBuilder"/> instance has completed all required steps and can proceed to <see cref="CorrespondenceContentBuilder.Build"/>.
/// </summary>
public interface ICorrespondenceContentBuilder
: ICorrespondenceContentBuilderTitle,
Expand All @@ -67,7 +67,7 @@ public interface ICorrespondenceContentBuilder
ICorrespondenceContentBuilderBody
{
/// <summary>
/// Builds the correspondence content
/// Builds the correspondence content.
/// </summary>
CorrespondenceContent Build();
}
Loading

0 comments on commit aae3a6c

Please sign in to comment.