2023-11-21 03:59:29 +03:00
using System.Net.Http ;
2013-07-22 23:23:37 +04:00
namespace Refit
{
2024-05-24 03:15:52 +03:00
/// <summary>
/// HttpMethodAttribute.
/// </summary>
/// <seealso cref="System.Attribute" />
/// <remarks>
/// Initializes a new instance of the <see cref="HttpMethodAttribute"/> class.
/// </remarks>
/// <param name="path">The path.</param>
public abstract class HttpMethodAttribute ( string path ) : Attribute
2013-07-22 23:23:37 +04:00
{
2024-05-24 03:15:52 +03:00
/// <summary>
/// Gets the method.
/// </summary>
/// <value>
/// The method.
/// </value>
2018-01-14 22:58:24 +03:00
public abstract HttpMethod Method { get ; }
2024-05-24 03:15:52 +03:00
/// <summary>
/// Gets or sets the path.
/// </summary>
/// <value>
/// The path.
/// </value>
public virtual string Path { get ; protected set ; } = path ;
2013-07-22 23:23:37 +04:00
}
2021-11-10 16:57:46 +03:00
/// <summary>
/// Send the request with HTTP method 'GET'.
/// </summary>
2024-05-24 03:15:52 +03:00
/// <remarks>
/// Initializes a new instance of the <see cref="GetAttribute"/> class.
/// </remarks>
/// <param name="path">The path.</param>
2013-07-22 23:23:37 +04:00
[AttributeUsage(AttributeTargets.Method)]
2024-06-24 22:34:59 +03:00
#pragma warning disable CA1813 // Avoid unsealed attributes
public class GetAttribute ( string path ) : HttpMethodAttribute ( path )
2013-07-22 23:23:37 +04:00
{
2024-05-24 03:15:52 +03:00
/// <summary>
/// Gets the method.
/// </summary>
/// <value>
/// The method.
/// </value>
public override HttpMethod Method = > HttpMethod . Get ;
2013-07-22 23:23:37 +04:00
}
2021-11-10 16:57:46 +03:00
/// <summary>
/// Send the request with HTTP method 'POST'.
/// </summary>
2024-05-24 03:15:52 +03:00
/// <remarks>
/// Initializes a new instance of the <see cref="PostAttribute"/> class.
/// </remarks>
/// <param name="path">The path.</param>
2013-07-22 23:23:37 +04:00
[AttributeUsage(AttributeTargets.Method)]
2024-06-24 22:34:59 +03:00
public class PostAttribute ( string path ) : HttpMethodAttribute ( path )
2013-07-22 23:23:37 +04:00
{
2024-05-24 03:15:52 +03:00
/// <summary>
/// Gets the method.
/// </summary>
/// <value>
/// The method.
/// </value>
public override HttpMethod Method = > HttpMethod . Post ;
2013-07-22 23:23:37 +04:00
}
2021-11-10 16:57:46 +03:00
/// <summary>
/// Send the request with HTTP method 'PUT'.
/// </summary>
2024-05-24 03:15:52 +03:00
/// <remarks>
/// Initializes a new instance of the <see cref="PutAttribute"/> class.
/// </remarks>
/// <param name="path">The path.</param>
2013-07-22 23:23:37 +04:00
[AttributeUsage(AttributeTargets.Method)]
2024-06-24 22:34:59 +03:00
public class PutAttribute ( string path ) : HttpMethodAttribute ( path )
2013-07-22 23:23:37 +04:00
{
2024-05-24 03:15:52 +03:00
/// <summary>
/// Gets the method.
/// </summary>
/// <value>
/// The method.
/// </value>
public override HttpMethod Method = > HttpMethod . Put ;
2013-07-22 23:23:37 +04:00
}
2021-11-10 16:57:46 +03:00
/// <summary>
/// Send the request with HTTP method 'DELETE'.
/// </summary>
2024-05-24 03:15:52 +03:00
/// <remarks>
/// Initializes a new instance of the <see cref="DeleteAttribute"/> class.
/// </remarks>
/// <param name="path">The path.</param>
2013-07-22 23:23:37 +04:00
[AttributeUsage(AttributeTargets.Method)]
2024-06-24 22:34:59 +03:00
public class DeleteAttribute ( string path ) : HttpMethodAttribute ( path )
2013-07-22 23:23:37 +04:00
{
2024-05-24 03:15:52 +03:00
/// <summary>
/// Gets the method.
/// </summary>
/// <value>
/// The method.
/// </value>
public override HttpMethod Method = > HttpMethod . Delete ;
2013-07-22 23:23:37 +04:00
}
2015-01-15 15:06:43 +03:00
2021-11-10 16:57:46 +03:00
/// <summary>
/// Send the request with HTTP method 'PATCH'.
/// </summary>
2024-05-24 03:15:52 +03:00
/// <remarks>
/// Initializes a new instance of the <see cref="PatchAttribute"/> class.
/// </remarks>
/// <param name="path">The path.</param>
2015-01-15 15:06:43 +03:00
[AttributeUsage(AttributeTargets.Method)]
2024-06-24 22:34:59 +03:00
public class PatchAttribute ( string path ) : HttpMethodAttribute ( path )
2015-01-15 15:06:43 +03:00
{
2024-05-24 03:15:52 +03:00
/// <summary>
/// Gets the method.
/// </summary>
/// <value>
/// The method.
/// </value>
2024-06-24 22:34:59 +03:00
public override HttpMethod Method = > new ( "PATCH" ) ;
2015-01-15 15:06:43 +03:00
}
2018-01-14 22:58:24 +03:00
2021-11-10 16:57:46 +03:00
/// <summary>
/// Send the request with HTTP method 'OPTION'.
/// </summary>
2024-05-24 03:15:52 +03:00
/// <remarks>
/// Initializes a new instance of the <see cref="OptionsAttribute"/> class.
/// </remarks>
/// <param name="path">The path.</param>
2019-02-09 05:26:54 +03:00
[AttributeUsage(AttributeTargets.Method)]
2024-06-24 22:34:59 +03:00
public class OptionsAttribute ( string path ) : HttpMethodAttribute ( path )
2019-02-09 05:26:54 +03:00
{
2024-05-24 03:15:52 +03:00
/// <summary>
/// Gets the method.
/// </summary>
/// <value>
/// The method.
/// </value>
2024-06-24 22:34:59 +03:00
public override HttpMethod Method = > new ( "OPTIONS" ) ;
2019-02-09 05:26:54 +03:00
}
2021-11-10 16:57:46 +03:00
/// <summary>
/// Send the request with HTTP method 'HEAD'.
/// </summary>
2024-05-24 03:15:52 +03:00
/// <remarks>
/// Initializes a new instance of the <see cref="HeadAttribute"/> class.
/// </remarks>
/// <param name="path">The path.</param>
2013-07-22 23:23:37 +04:00
[AttributeUsage(AttributeTargets.Method)]
2024-06-24 22:34:59 +03:00
public class HeadAttribute ( string path ) : HttpMethodAttribute ( path )
2013-07-22 23:23:37 +04:00
{
2024-05-24 03:15:52 +03:00
/// <summary>
/// Gets the method.
/// </summary>
/// <value>
/// The method.
/// </value>
public override HttpMethod Method = > HttpMethod . Head ;
2013-07-22 23:23:37 +04:00
}
2021-11-10 16:57:46 +03:00
/// <summary>
/// Send the request as multipart.
/// </summary>
/// <remarks>
/// Currently, multipart methods only support the following parameter types: <see cref="string"/>, <see cref="byte"/> array, <see cref="System.IO.Stream"/>, <see cref="System.IO.FileInfo"/>.
/// </remarks>
2024-05-24 03:15:52 +03:00
/// <remarks>
/// Initializes a new instance of the <see cref="MultipartAttribute"/> class.
/// </remarks>
/// <param name="boundaryText">The boundary text.</param>
2015-05-17 11:18:30 +03:00
[AttributeUsage(AttributeTargets.Method)]
2024-06-24 22:34:59 +03:00
public class MultipartAttribute ( string boundaryText = "----MyGreatBoundary" ) : Attribute
2019-07-09 21:14:06 +03:00
{
2024-05-24 03:15:52 +03:00
/// <summary>
/// Gets the boundary text.
/// </summary>
/// <value>
/// The boundary text.
/// </value>
public string BoundaryText { get ; private set ; } = boundaryText ;
2020-02-19 02:03:14 +03:00
}
2015-05-17 11:18:30 +03:00
2021-11-10 19:10:58 +03:00
/// <summary>
/// Defines methods to serialize HTTP requests' bodies.
/// </summary>
2018-01-14 22:58:24 +03:00
public enum BodySerializationMethod
{
2018-01-30 02:02:52 +03:00
/// <summary>
2018-11-15 02:47:29 +03:00
/// Encodes everything using the ContentSerializer in RefitSettings except for strings. Strings are set as-is
2018-01-30 02:02:52 +03:00
/// </summary>
Default ,
/// <summary>
/// Json encodes everything, including strings
/// </summary>
2018-11-15 02:47:29 +03:00
[Obsolete("Use BodySerializationMethod.Serialized instead", false)]
2018-01-14 22:58:24 +03:00
Json ,
2018-01-30 02:02:52 +03:00
/// <summary>
/// Form-UrlEncode's the values
/// </summary>
2018-11-15 02:47:29 +03:00
UrlEncoded ,
/// <summary>
2020-11-22 04:34:01 +03:00
/// Encodes everything using the ContentSerializer in RefitSettings
2018-11-15 02:47:29 +03:00
/// </summary>
Serialized
2013-07-22 23:23:37 +04:00
}
2021-11-10 16:57:46 +03:00
/// <summary>
/// Set a parameter to be sent as the HTTP request's body.
/// </summary>
/// <remarks>
/// There are four behaviors when sending a parameter as the request body:<br/>
/// - If the type is/implements <see cref="System.IO.Stream"/>, the content will be streamed via <see cref="StreamContent"/>.<br/>
/// - If the type is <see cref="string"/>, it will be used directly as the content unless <c>[Body(BodySerializationMethod.Json)]</c> is set
/// which will send it as a <see cref="StringContent"/>.<br/>
/// - If the parameter has the attribute <c>[Body(BodySerializationMethod.UrlEncoded)]</c>, the content will be URL-encoded.<br/>
/// - For all other types, the object will be serialized using the content serializer specified in the request's <see cref="RefitSettings"/>.
/// </remarks>
2013-07-22 23:23:37 +04:00
[AttributeUsage(AttributeTargets.Parameter)]
2024-06-24 22:34:59 +03:00
public class BodyAttribute : Attribute
2013-07-22 23:23:37 +04:00
{
2024-05-24 03:15:52 +03:00
/// <summary>
/// Initializes a new instance of the <see cref="BodyAttribute"/> class.
/// </summary>
2023-11-27 01:50:46 +03:00
public BodyAttribute ( ) { }
2018-02-16 23:16:46 +03:00
2024-05-24 03:15:52 +03:00
/// <summary>
/// Initializes a new instance of the <see cref="BodyAttribute"/> class.
/// </summary>
/// <param name="buffered">if set to <c>true</c> [buffered].</param>
public BodyAttribute ( bool buffered ) = > Buffered = buffered ;
2018-02-16 23:16:46 +03:00
2024-05-24 03:15:52 +03:00
/// <summary>
/// Initializes a new instance of the <see cref="BodyAttribute"/> class.
/// </summary>
/// <param name="serializationMethod">The serialization method.</param>
/// <param name="buffered">if set to <c>true</c> [buffered].</param>
2018-02-16 23:16:46 +03:00
public BodyAttribute ( BodySerializationMethod serializationMethod , bool buffered )
2013-07-22 23:23:37 +04:00
{
SerializationMethod = serializationMethod ;
2017-10-08 23:10:18 +03:00
Buffered = buffered ;
2013-07-22 23:23:37 +04:00
}
2018-01-14 22:58:24 +03:00
2024-05-24 03:15:52 +03:00
/// <summary>
/// Initializes a new instance of the <see cref="BodyAttribute"/> class.
/// </summary>
/// <param name="serializationMethod">The serialization method.</param>
2023-11-27 01:50:46 +03:00
public BodyAttribute (
BodySerializationMethod serializationMethod = BodySerializationMethod . Default
)
2018-02-16 23:16:46 +03:00
{
SerializationMethod = serializationMethod ;
}
2024-05-24 03:15:52 +03:00
/// <summary>
/// Gets or sets the buffered.
/// </summary>
/// <value>
/// The buffered.
/// </value>
public bool? Buffered { get ; }
/// <summary>
/// Gets or sets the serialization method.
/// </summary>
/// <value>
/// The serialization method.
/// </value>
public BodySerializationMethod SerializationMethod { get ; } =
2023-11-27 01:50:46 +03:00
BodySerializationMethod . Default ;
2013-07-22 23:23:37 +04:00
}
2021-11-10 16:57:46 +03:00
/// <summary>
/// Override the key that will be sent in the query string.
/// </summary>
2024-05-24 03:15:52 +03:00
/// <remarks>
/// Initializes a new instance of the <see cref="AliasAsAttribute"/> class.
/// </remarks>
/// <param name="name">The name.</param>
2014-10-11 02:51:06 +04:00
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property)]
2024-06-24 22:34:59 +03:00
public class AliasAsAttribute ( string name ) : Attribute
2013-07-22 23:23:37 +04:00
{
2024-05-24 03:15:52 +03:00
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>
/// The name.
/// </value>
public string Name { get ; protected set ; } = name ;
2013-07-22 23:23:37 +04:00
}
2015-05-18 19:11:20 +03:00
2024-05-24 03:15:52 +03:00
/// <summary>
/// Initializes a new instance of the <see cref="AttachmentNameAttribute"/> class.
/// </summary>
/// <param name="name">The name.</param>
2018-01-14 22:58:24 +03:00
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property)]
2023-11-27 01:50:46 +03:00
[ Obsolete (
"Use Refit.StreamPart, Refit.ByteArrayPart, Refit.FileInfoPart or if necessary, inherit from Refit.MultipartItem" ,
false
) ]
2024-06-24 22:34:59 +03:00
public class AttachmentNameAttribute ( string name ) : Attribute
2015-05-18 19:11:20 +03:00
{
2024-05-24 03:15:52 +03:00
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>
/// The name.
/// </value>
public string Name { get ; protected set ; } = name ;
2015-05-18 19:11:20 +03:00
}
2020-11-30 13:17:54 +03:00
/// <summary>
2021-11-10 16:57:46 +03:00
/// Allows you to provide a Dictionary of headers to be added to the request.
2020-11-30 13:17:54 +03:00
/// </summary>
2020-11-26 13:26:12 +03:00
[AttributeUsage(AttributeTargets.Parameter)]
2024-06-24 22:34:59 +03:00
public class HeaderCollectionAttribute : Attribute { }
2020-11-26 13:26:12 +03:00
2021-11-10 16:57:46 +03:00
/// <summary>
/// Add multiple headers to the request.
/// </summary>
2024-05-24 03:15:52 +03:00
/// <remarks>
/// Initializes a new instance of the <see cref="HeadersAttribute"/> class.
/// </remarks>
/// <param name="headers">The headers.</param>
2014-05-15 19:23:54 +04:00
[AttributeUsage(AttributeTargets.Interface | AttributeTargets.Method)]
2024-06-24 22:34:59 +03:00
public class HeadersAttribute ( params string [ ] headers ) : Attribute
2014-05-15 19:23:54 +04:00
{
2024-05-24 03:15:52 +03:00
/// <summary>
/// Gets the headers.
/// </summary>
/// <value>
/// The headers.
/// </value>
2024-06-24 22:34:59 +03:00
public string [ ] Headers { get ; } = headers ? ? [ ] ;
2014-05-15 19:23:54 +04:00
}
2021-11-10 16:57:46 +03:00
/// <summary>
/// Add a header to the request.
/// </summary>
2024-05-24 03:15:52 +03:00
/// <remarks>
/// Initializes a new instance of the <see cref="HeaderAttribute"/> class.
/// </remarks>
/// <param name="header">The header.</param>
2014-05-15 19:23:54 +04:00
[AttributeUsage(AttributeTargets.Parameter)]
2024-06-24 22:34:59 +03:00
public class HeaderAttribute ( string header ) : Attribute
2014-05-15 19:23:54 +04:00
{
2024-05-24 03:15:52 +03:00
/// <summary>
/// Gets the header.
/// </summary>
/// <value>
/// The header.
/// </value>
public string Header { get ; } = header ;
2014-05-15 19:23:54 +04:00
}
2014-12-14 19:29:12 +03:00
2020-11-24 12:33:16 +03:00
/// <summary>
/// Used to store the value in HttpRequestMessage.Properties for further processing in a custom DelegatingHandler.
/// If a string is supplied to the constructor then it will be used as the key in the HttpRequestMessage.Properties dictionary.
/// If no key is specified then the key will be defaulted to the name of the parameter.
/// </summary>
2020-11-22 04:34:01 +03:00
[AttributeUsage(AttributeTargets.Parameter)]
2024-06-24 22:34:59 +03:00
public class PropertyAttribute : Attribute
2020-11-22 04:34:01 +03:00
{
2024-05-24 03:15:52 +03:00
/// <summary>
/// Initializes a new instance of the <see cref="PropertyAttribute"/> class.
/// </summary>
2020-11-23 01:35:51 +03:00
public PropertyAttribute ( ) { }
2024-05-24 03:15:52 +03:00
/// <summary>
/// Initializes a new instance of the <see cref="PropertyAttribute"/> class.
/// </summary>
/// <param name="key">The key.</param>
2020-11-23 01:35:51 +03:00
public PropertyAttribute ( string key )
2020-11-22 04:34:01 +03:00
{
2020-11-22 11:22:14 +03:00
Key = key ;
2020-11-22 04:34:01 +03:00
}
2020-11-24 12:33:16 +03:00
/// <summary>
/// Specifies the key under which to store the value on the HttpRequestMessage.Properties dictionary.
/// </summary>
2020-11-26 00:52:29 +03:00
public string? Key { get ; }
2020-11-22 04:34:01 +03:00
}
2021-11-10 16:57:46 +03:00
/// <summary>
/// Add the Authorize header to the request with the value of the associated parameter.
/// </summary>
/// <remarks>
/// Default authorization scheme: Bearer
/// </remarks>
2024-05-24 03:15:52 +03:00
/// <remarks>
/// Initializes a new instance of the <see cref="AuthorizeAttribute"/> class.
/// </remarks>
/// <param name="scheme">The scheme.</param>
2014-12-14 19:29:12 +03:00
[AttributeUsage(AttributeTargets.Parameter)]
2024-06-24 22:34:59 +03:00
public class AuthorizeAttribute ( string scheme = "Bearer" ) : Attribute
2014-12-14 19:29:12 +03:00
{
2024-05-24 03:15:52 +03:00
/// <summary>
/// Gets the scheme.
/// </summary>
/// <value>
/// The scheme.
/// </value>
public string Scheme { get ; } = scheme ;
2014-12-14 19:29:12 +03:00
}
2017-09-03 20:01:54 +03:00
2021-11-10 16:57:46 +03:00
/// <summary>
/// Associated value will be added to the request Uri as query-string, using a delimiter to split the values. (default: '.')
/// </summary>
2018-01-28 23:05:38 +03:00
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property)] // Property is to allow for form url encoded data
2024-06-24 22:34:59 +03:00
public class QueryAttribute : Attribute
2017-09-03 20:01:54 +03:00
{
2020-02-19 02:03:14 +03:00
CollectionFormat ? collectionFormat ;
2024-05-24 03:15:52 +03:00
/// <summary>
/// Initializes a new instance of the <see cref="QueryAttribute"/> class.
/// </summary>
2018-01-14 22:58:24 +03:00
public QueryAttribute ( ) { }
2017-09-03 20:01:54 +03:00
2024-05-24 03:15:52 +03:00
/// <summary>
/// Initializes a new instance of the <see cref="QueryAttribute"/> class.
/// </summary>
/// <param name="delimiter">The delimiter.</param>
2017-09-03 20:01:54 +03:00
public QueryAttribute ( string delimiter )
{
Delimiter = delimiter ;
}
2024-05-24 03:15:52 +03:00
/// <summary>
/// Initializes a new instance of the <see cref="QueryAttribute"/> class.
/// </summary>
/// <param name="delimiter">The delimiter.</param>
/// <param name="prefix">The prefix.</param>
2017-09-03 20:01:54 +03:00
public QueryAttribute ( string delimiter , string prefix )
{
Delimiter = delimiter ;
Prefix = prefix ;
}
2024-05-24 03:15:52 +03:00
/// <summary>
/// Initializes a new instance of the <see cref="QueryAttribute"/> class.
/// </summary>
/// <param name="delimiter">The delimiter.</param>
/// <param name="prefix">The prefix.</param>
/// <param name="format">The format.</param>
2018-01-28 23:05:38 +03:00
public QueryAttribute ( string delimiter , string prefix , string format )
{
Delimiter = delimiter ;
Prefix = prefix ;
Format = format ;
}
2024-05-24 03:15:52 +03:00
/// <summary>
/// Initializes a new instance of the <see cref="QueryAttribute"/> class.
/// </summary>
/// <param name="collectionFormat">The collection format.</param>
2018-03-29 14:20:24 +03:00
public QueryAttribute ( CollectionFormat collectionFormat )
{
CollectionFormat = collectionFormat ;
}
2018-11-29 08:42:26 +03:00
/// <summary>
/// Used to customize the name of either the query parameter pair or of the form field when form encoding.
/// </summary>
/// <seealso cref="Prefix"/>
2018-01-14 22:58:24 +03:00
public string Delimiter { get ; protected set ; } = "." ;
2018-11-29 08:42:26 +03:00
/// <summary>
2020-11-22 04:34:01 +03:00
/// Used to customize the name of the encoded value.
2018-11-29 08:42:26 +03:00
/// </summary>
/// <remarks>
/// Gets combined with <see cref="Delimiter"/> in the format <code>var name = $"{Prefix}{Delimiter}{originalFieldName}"</code>
/// where <c>originalFieldName</c> is the name of the object property or method parameter.
/// </remarks>
/// <example>
/// <code>
/// class Form
/// {
/// [Query("-", "dontlog")]
/// public string password { get; }
/// }
/// </code>
/// will result in the encoded form having a field named <c>dontlog-password</c>.
/// </example>
2020-11-26 00:52:29 +03:00
public string? Prefix { get ; protected set ; }
2018-01-28 23:05:38 +03:00
2024-06-24 22:34:59 +03:00
#pragma warning disable CA1019 // Define accessors for attribute arguments
2018-11-29 08:30:34 +03:00
/// <summary>
/// Used to customize the formatting of the encoded value.
/// </summary>
/// <example>
/// <code>
/// interface IServerApi
/// {
/// [Get("/expenses")]
/// Task addExpense([Query(Format="0.00")] double expense);
/// }
/// </code>
/// Calling <c>serverApi.addExpense(5)</c> will result in a URI of <c>{baseUri}/expenses?expense=5.00</c>.
/// </example>
2020-11-26 00:52:29 +03:00
public string? Format { get ; set ; }
2018-03-29 14:20:24 +03:00
2018-11-29 08:30:34 +03:00
/// <summary>
2020-02-19 02:03:14 +03:00
/// Specifies how the collection should be encoded.
2018-11-29 08:30:34 +03:00
/// </summary>
2020-02-19 02:03:14 +03:00
public CollectionFormat CollectionFormat
{
// Cannot make property nullable due to Attribute restrictions
get = > collectionFormat . GetValueOrDefault ( ) ;
set = > collectionFormat = value ;
}
2024-06-24 22:34:59 +03:00
#pragma warning restore CA1019 // Define accessors for attribute arguments
2024-05-24 03:15:52 +03:00
/// <summary>
/// Gets a value indicating whether this instance is collection format specified.
/// </summary>
/// <value>
/// <c>true</c> if this instance is collection format specified; otherwise, <c>false</c>.
/// </value>
2020-02-19 02:03:14 +03:00
public bool IsCollectionFormatSpecified = > collectionFormat . HasValue ;
2017-09-03 20:01:54 +03:00
}
2020-01-11 19:16:04 +03:00
2024-05-24 03:15:52 +03:00
/// <summary>
/// QueryUriFormatAttribute.
/// </summary>
/// <seealso cref="System.Attribute" />
/// <remarks>
/// Initializes a new instance of the <see cref="QueryUriFormatAttribute"/> class.
/// </remarks>
/// <param name="uriFormat">The URI format.</param>
2020-01-11 19:16:04 +03:00
[AttributeUsage(AttributeTargets.Method)]
2024-06-24 22:34:59 +03:00
public class QueryUriFormatAttribute ( UriFormat uriFormat ) : Attribute
2020-01-11 19:16:04 +03:00
{
/// <summary>
/// Specifies how the Query Params should be encoded.
/// </summary>
2024-05-24 03:15:52 +03:00
public UriFormat UriFormat { get ; } = uriFormat ;
2020-01-11 19:16:04 +03:00
}
2024-06-24 22:34:59 +03:00
#pragma warning restore CA1813 // Avoid unsealed attributes
2014-11-06 08:28:57 +03:00
}