A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/reactiveui/refit/commit/943529592ea84a7ef6b62a4514420a7486c15905 below:

Revert sealed Attributes (#1734) · reactiveui/refit@9435295 · GitHub

@@ -37,7 +37,8 @@ public abstract class HttpMethodAttribute(string path) : Attribute

37 37

/// </remarks>

38 38

/// <param name="path">The path.</param>

39 39

[AttributeUsage(AttributeTargets.Method)]

40 -

public sealed class GetAttribute(string path) : HttpMethodAttribute(path)

40 +

#pragma warning disable CA1813 // Avoid unsealed attributes

41 +

public class GetAttribute(string path) : HttpMethodAttribute(path)

41 42

{

42 43

/// <summary>

43 44

/// Gets the method.

@@ -56,7 +57,7 @@ public sealed class GetAttribute(string path) : HttpMethodAttribute(path)

56 57

/// </remarks>

57 58

/// <param name="path">The path.</param>

58 59

[AttributeUsage(AttributeTargets.Method)]

59 -

public sealed class PostAttribute(string path) : HttpMethodAttribute(path)

60 +

public class PostAttribute(string path) : HttpMethodAttribute(path)

60 61

{

61 62

/// <summary>

62 63

/// Gets the method.

@@ -75,7 +76,7 @@ public sealed class PostAttribute(string path) : HttpMethodAttribute(path)

75 76

/// </remarks>

76 77

/// <param name="path">The path.</param>

77 78

[AttributeUsage(AttributeTargets.Method)]

78 -

public sealed class PutAttribute(string path) : HttpMethodAttribute(path)

79 +

public class PutAttribute(string path) : HttpMethodAttribute(path)

79 80

{

80 81

/// <summary>

81 82

/// Gets the method.

@@ -94,7 +95,7 @@ public sealed class PutAttribute(string path) : HttpMethodAttribute(path)

94 95

/// </remarks>

95 96

/// <param name="path">The path.</param>

96 97

[AttributeUsage(AttributeTargets.Method)]

97 -

public sealed class DeleteAttribute(string path) : HttpMethodAttribute(path)

98 +

public class DeleteAttribute(string path) : HttpMethodAttribute(path)

98 99

{

99 100

/// <summary>

100 101

/// Gets the method.

@@ -113,15 +114,15 @@ public sealed class DeleteAttribute(string path) : HttpMethodAttribute(path)

113 114

/// </remarks>

114 115

/// <param name="path">The path.</param>

115 116

[AttributeUsage(AttributeTargets.Method)]

116 -

public sealed class PatchAttribute(string path) : HttpMethodAttribute(path)

117 +

public class PatchAttribute(string path) : HttpMethodAttribute(path)

117 118

{

118 119

/// <summary>

119 120

/// Gets the method.

120 121

/// </summary>

121 122

/// <value>

122 123

/// The method.

123 124

/// </value>

124 -

public override HttpMethod Method => new HttpMethod("PATCH");

125 +

public override HttpMethod Method => new("PATCH");

125 126

}

126 127 127 128

/// <summary>

@@ -132,15 +133,15 @@ public sealed class PatchAttribute(string path) : HttpMethodAttribute(path)

132 133

/// </remarks>

133 134

/// <param name="path">The path.</param>

134 135

[AttributeUsage(AttributeTargets.Method)]

135 -

public sealed class OptionsAttribute(string path) : HttpMethodAttribute(path)

136 +

public class OptionsAttribute(string path) : HttpMethodAttribute(path)

136 137

{

137 138

/// <summary>

138 139

/// Gets the method.

139 140

/// </summary>

140 141

/// <value>

141 142

/// The method.

142 143

/// </value>

143 -

public override HttpMethod Method => new HttpMethod("OPTIONS");

144 +

public override HttpMethod Method => new("OPTIONS");

144 145

}

145 146 146 147

/// <summary>

@@ -151,7 +152,7 @@ public sealed class OptionsAttribute(string path) : HttpMethodAttribute(path)

151 152

/// </remarks>

152 153

/// <param name="path">The path.</param>

153 154

[AttributeUsage(AttributeTargets.Method)]

154 -

public sealed class HeadAttribute(string path) : HttpMethodAttribute(path)

155 +

public class HeadAttribute(string path) : HttpMethodAttribute(path)

155 156

{

156 157

/// <summary>

157 158

/// Gets the method.

@@ -173,7 +174,7 @@ public sealed class HeadAttribute(string path) : HttpMethodAttribute(path)

173 174

/// </remarks>

174 175

/// <param name="boundaryText">The boundary text.</param>

175 176

[AttributeUsage(AttributeTargets.Method)]

176 -

public sealed class MultipartAttribute(string boundaryText = "----MyGreatBoundary") : Attribute

177 +

public class MultipartAttribute(string boundaryText = "----MyGreatBoundary") : Attribute

177 178

{

178 179

/// <summary>

179 180

/// Gets the boundary text.

@@ -223,7 +224,7 @@ public enum BodySerializationMethod

223 224

/// - For all other types, the object will be serialized using the content serializer specified in the request's <see cref="RefitSettings"/>.

224 225

/// </remarks>

225 226

[AttributeUsage(AttributeTargets.Parameter)]

226 -

public sealed class BodyAttribute : Attribute

227 +

public class BodyAttribute : Attribute

227 228

{

228 229

/// <summary>

229 230

/// Initializes a new instance of the <see cref="BodyAttribute"/> class.

@@ -284,7 +285,7 @@ public BodyAttribute(

284 285

/// </remarks>

285 286

/// <param name="name">The name.</param>

286 287

[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property)]

287 -

public sealed class AliasAsAttribute(string name) : Attribute

288 +

public class AliasAsAttribute(string name) : Attribute

288 289

{

289 290

/// <summary>

290 291

/// Gets or sets the name.

@@ -304,7 +305,7 @@ public sealed class AliasAsAttribute(string name) : Attribute

304 305

"Use Refit.StreamPart, Refit.ByteArrayPart, Refit.FileInfoPart or if necessary, inherit from Refit.MultipartItem",

305 306

false

306 307

)]

307 -

public sealed class AttachmentNameAttribute(string name) : Attribute

308 +

public class AttachmentNameAttribute(string name) : Attribute

308 309

{

309 310

/// <summary>

310 311

/// Gets or sets the name.

@@ -319,7 +320,7 @@ public sealed class AttachmentNameAttribute(string name) : Attribute

319 320

/// Allows you to provide a Dictionary of headers to be added to the request.

320 321

/// </summary>

321 322

[AttributeUsage(AttributeTargets.Parameter)]

322 -

public sealed class HeaderCollectionAttribute : Attribute { }

323 +

public class HeaderCollectionAttribute : Attribute { }

323 324 324 325

/// <summary>

325 326

/// Add multiple headers to the request.

@@ -329,15 +330,15 @@ public sealed class HeaderCollectionAttribute : Attribute { }

329 330

/// </remarks>

330 331

/// <param name="headers">The headers.</param>

331 332

[AttributeUsage(AttributeTargets.Interface | AttributeTargets.Method)]

332 -

public sealed class HeadersAttribute(params string[] headers) : Attribute

333 +

public class HeadersAttribute(params string[] headers) : Attribute

333 334

{

334 335

/// <summary>

335 336

/// Gets the headers.

336 337

/// </summary>

337 338

/// <value>

338 339

/// The headers.

339 340

/// </value>

340 -

public string[] Headers { get; } = headers ?? Array.Empty<string>();

341 +

public string[] Headers { get; } = headers ?? [];

341 342

}

342 343 343 344

/// <summary>

@@ -348,7 +349,7 @@ public sealed class HeadersAttribute(params string[] headers) : Attribute

348 349

/// </remarks>

349 350

/// <param name="header">The header.</param>

350 351

[AttributeUsage(AttributeTargets.Parameter)]

351 -

public sealed class HeaderAttribute(string header) : Attribute

352 +

public class HeaderAttribute(string header) : Attribute

352 353

{

353 354

/// <summary>

354 355

/// Gets the header.

@@ -365,7 +366,7 @@ public sealed class HeaderAttribute(string header) : Attribute

365 366

/// If no key is specified then the key will be defaulted to the name of the parameter.

366 367

/// </summary>

367 368

[AttributeUsage(AttributeTargets.Parameter)]

368 -

public sealed class PropertyAttribute : Attribute

369 +

public class PropertyAttribute : Attribute

369 370

{

370 371

/// <summary>

371 372

/// Initializes a new instance of the <see cref="PropertyAttribute"/> class.

@@ -398,7 +399,7 @@ public PropertyAttribute(string key)

398 399

/// </remarks>

399 400

/// <param name="scheme">The scheme.</param>

400 401

[AttributeUsage(AttributeTargets.Parameter)]

401 -

public sealed class AuthorizeAttribute(string scheme = "Bearer") : Attribute

402 +

public class AuthorizeAttribute(string scheme = "Bearer") : Attribute

402 403

{

403 404

/// <summary>

404 405

/// Gets the scheme.

@@ -413,7 +414,7 @@ public sealed class AuthorizeAttribute(string scheme = "Bearer") : Attribute

413 414

/// Associated value will be added to the request Uri as query-string, using a delimiter to split the values. (default: '.')

414 415

/// </summary>

415 416

[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property)] // Property is to allow for form url encoded data

416 -

public sealed class QueryAttribute : Attribute

417 +

public class QueryAttribute : Attribute

417 418

{

418 419

CollectionFormat? collectionFormat;

419 420

@@ -489,6 +490,8 @@ public QueryAttribute(CollectionFormat collectionFormat)

489 490

/// </example>

490 491

public string? Prefix { get; protected set; }

491 492 493 +

#pragma warning disable CA1019 // Define accessors for attribute arguments

494 + 492 495

/// <summary>

493 496

/// Used to customize the formatting of the encoded value.

494 497

/// </summary>

@@ -514,6 +517,8 @@ public CollectionFormat CollectionFormat

514 517

set => collectionFormat = value;

515 518

}

516 519 520 +

#pragma warning restore CA1019 // Define accessors for attribute arguments

521 + 517 522

/// <summary>

518 523

/// Gets a value indicating whether this instance is collection format specified.

519 524

/// </summary>

@@ -532,11 +537,12 @@ public CollectionFormat CollectionFormat

532 537

/// </remarks>

533 538

/// <param name="uriFormat">The URI format.</param>

534 539

[AttributeUsage(AttributeTargets.Method)]

535 -

public sealed class QueryUriFormatAttribute(UriFormat uriFormat) : Attribute

540 +

public class QueryUriFormatAttribute(UriFormat uriFormat) : Attribute

536 541

{

537 542

/// <summary>

538 543

/// Specifies how the Query Params should be encoded.

539 544

/// </summary>

540 545

public UriFormat UriFormat { get; } = uriFormat;

541 546

}

547 +

#pragma warning restore CA1813 // Avoid unsealed attributes

542 548

}


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4