Skip to content

Commit

Permalink
refactor: global usings
Browse files Browse the repository at this point in the history
  • Loading branch information
DineshSolanki committed Sep 12, 2024
1 parent a42f30d commit 8c8af4c
Show file tree
Hide file tree
Showing 45 changed files with 52 additions and 136 deletions.
4 changes: 1 addition & 3 deletions DeviantArt.Net/Api/BrowseClient.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Models.Deviation;

namespace DeviantArt.Net.Api;
namespace DeviantArt.Net.Api;

public partial class Client
{
Expand Down
2 changes: 0 additions & 2 deletions DeviantArt.Net/Api/Client.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Api.Handler;
using DeviantArt.Net.Modules;
using DeviantArt.Net.Modules.Util.Formatters;

namespace DeviantArt.Net.Api;

Expand Down
6 changes: 1 addition & 5 deletions DeviantArt.Net/Api/CollectionClient.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using DeviantArt.Net.Models.Deviation;
using DeviantArt.Net.Models.User;
using DeviantArt.Net.Modules;

namespace DeviantArt.Net.Api;
namespace DeviantArt.Net.Api;

public partial class Client
{
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.Net/Api/CommentsClient.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Models.Message;

namespace DeviantArt.Net.Api;
namespace DeviantArt.Net.Api;

public partial class Client
{
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.Net/Api/DataClient.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Models.Data;

namespace DeviantArt.Net.Api;
namespace DeviantArt.Net.Api;

public partial class Client
{
Expand Down
5 changes: 1 addition & 4 deletions DeviantArt.Net/Api/DeviationClient.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using DeviantArt.Net.Models.Deviation;
using DeviantArt.Net.Modules;

namespace DeviantArt.Net.Api;
namespace DeviantArt.Net.Api;

/// <summary>
/// Client class for interacting with DeviantArt API to manage deviations, journals, and literature.
Expand Down
6 changes: 1 addition & 5 deletions DeviantArt.Net/Api/GalleryClient.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using DeviantArt.Net.Models.Deviation;
using DeviantArt.Net.Models.User;
using DeviantArt.Net.Modules;

namespace DeviantArt.Net.Api;
namespace DeviantArt.Net.Api;

/// <summary>
/// Client class for interacting with DeviantArt gallery-related API endpoints.
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.Net/Api/Handler/RetryHandler.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Text.Json;

namespace DeviantArt.Net.Api.Handler;
namespace DeviantArt.Net.Api.Handler;

internal class RetryHandler(HttpMessageHandler innerHandler) : DelegatingHandler(innerHandler)
{
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.Net/Api/IBrowseApi.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Models.Deviation;

namespace DeviantArt.Net.Api;
namespace DeviantArt.Net.Api;

internal partial interface IDeviantArtApi
{
Expand Down
5 changes: 1 addition & 4 deletions DeviantArt.Net/Api/ICollectionApi.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using DeviantArt.Net.Models.Deviation;
using DeviantArt.Net.Models.User;

namespace DeviantArt.Net.Api;
namespace DeviantArt.Net.Api;

internal partial interface IDeviantArtApi
{
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.Net/Api/ICommentsApi.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Models.Message;

namespace DeviantArt.Net.Api;
namespace DeviantArt.Net.Api;

internal partial interface IDeviantArtApi
{
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.Net/Api/IDataApi.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Models.Data;

namespace DeviantArt.Net.Api;
namespace DeviantArt.Net.Api;

internal partial interface IDeviantArtApi
{
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.Net/Api/IDeviationApi.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Models.Deviation;

namespace DeviantArt.Net.Api;
namespace DeviantArt.Net.Api;

internal partial interface IDeviantArtApi
{
Expand Down
5 changes: 1 addition & 4 deletions DeviantArt.Net/Api/IGalleryApi.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using DeviantArt.Net.Models.Deviation;
using DeviantArt.Net.Models.User;

namespace DeviantArt.Net.Api;
namespace DeviantArt.Net.Api;

internal partial interface IDeviantArtApi
{
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.Net/Api/IMessageApi.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Models.Message;

namespace DeviantArt.Net.Api;
namespace DeviantArt.Net.Api;

internal partial interface IDeviantArtApi
{
Expand Down
5 changes: 1 addition & 4 deletions DeviantArt.Net/Api/IUserApi.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using DeviantArt.Net.Models.Deviation;
using DeviantArt.Net.Models.User;

namespace DeviantArt.Net.Api;
namespace DeviantArt.Net.Api;

internal partial interface IDeviantArtApi
{
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.Net/Api/MessageClient.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Models.Message;

namespace DeviantArt.Net.Api;
namespace DeviantArt.Net.Api;

public partial class Client
{
Expand Down
6 changes: 1 addition & 5 deletions DeviantArt.Net/Api/UserClient.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using DeviantArt.Net.Models.Deviation;
using DeviantArt.Net.Models.User;
using DeviantArt.Net.Modules;

namespace DeviantArt.Net.Api;
namespace DeviantArt.Net.Api;

public partial class Client
{
Expand Down
1 change: 0 additions & 1 deletion DeviantArt.Net/Exceptions/DeviantArtApiExceptions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Text.Json;

namespace DeviantArt.Net.Exceptions;

Expand Down
7 changes: 7 additions & 0 deletions DeviantArt.Net/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@
global using System.ComponentModel;
global using System.Net;
global using System.Runtime.Serialization;
global using System.Text.Json;
global using System.Text.Json.Serialization;
global using DeviantArt.Net.Exceptions;
global using DeviantArt.Net.Models;
global using DeviantArt.Net.Models.Data;
global using DeviantArt.Net.Models.Deviation;
global using DeviantArt.Net.Models.Message;
global using DeviantArt.Net.Models.User;
global using DeviantArt.Net.Modules;
global using DeviantArt.Net.Modules.Client;
global using DeviantArt.Net.Modules.TokenStore;
global using DeviantArt.Net.Modules.Util.Formatters;
global using Refit;
4 changes: 1 addition & 3 deletions DeviantArt.Net/Models/BrowseResponse.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Models.Deviation;

namespace DeviantArt.Net.Models;
namespace DeviantArt.Net.Models;

public class BrowseResponse : PaginatedBase<Deviation.Deviation>
{
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.Net/Models/CommentsPage.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Models.Message;

namespace DeviantArt.Net.Models;
namespace DeviantArt.Net.Models;

public class CommentsPage : PageBase
{
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.Net/Models/Deviation/FavouritedBy.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Modules.Util.Formatters;

namespace DeviantArt.Net.Models.Deviation;
namespace DeviantArt.Net.Models.Deviation;

public class FavouritedBy
{
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.Net/Models/Deviation/Metadata.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Models.User;

namespace DeviantArt.Net.Models.Deviation;
namespace DeviantArt.Net.Models.Deviation;

public class Metadata
{
Expand Down
5 changes: 1 addition & 4 deletions DeviantArt.Net/Models/Deviation/journalCreationRequest.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using DeviantArt.Net.Models.Deviation;
using DeviantArt.Net.Modules;

namespace DeviantArt.Net.Models.Deviation;
namespace DeviantArt.Net.Models.Deviation;

public class journalCreationRequest
{
Expand Down
5 changes: 1 addition & 4 deletions DeviantArt.Net/Models/Message/Message.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using DeviantArt.Net.Models.Deviation;
using DeviantArt.Net.Modules.Util.Formatters;

namespace DeviantArt.Net.Models.Message;
namespace DeviantArt.Net.Models.Message;

public class Message
{
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.Net/Models/TagNamesResponse.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Models.Deviation;

namespace DeviantArt.Net.Models;
namespace DeviantArt.Net.Models;

public class TagNamesResponse
{
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.Net/Models/TopicsResponse.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Models.Deviation;

namespace DeviantArt.Net.Models;
namespace DeviantArt.Net.Models;

public class TopicsResponse : PaginatedBase<TopicResult>
{
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.Net/Models/User/Folder.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Models.Deviation;

namespace DeviantArt.Net.Models.User;
namespace DeviantArt.Net.Models.User;

public class Folder
{
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.Net/Models/User/Friend.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Modules.Util.Formatters;

namespace DeviantArt.Net.Models.User;
namespace DeviantArt.Net.Models.User;

public class Friend : Watcher
{
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.Net/Models/User/ProfileUpdateRequest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Models.Data;

namespace DeviantArt.Net.Models.User;
namespace DeviantArt.Net.Models.User;

public class ProfileUpdateRequest
{
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.Net/Models/User/User.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Models.Deviation;

namespace DeviantArt.Net.Models.User;
namespace DeviantArt.Net.Models.User;

public class User
{
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.Net/Models/User/UserProfile.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Models.Message;

namespace DeviantArt.Net.Models.User;
namespace DeviantArt.Net.Models.User;

using System;
using System.Collections.Generic;
Expand Down
1 change: 0 additions & 1 deletion DeviantArt.Net/Modules/Extension.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Reflection;
using DeviantArt.Net.Models.User;

namespace DeviantArt.Net.Modules;

Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.Net/Modules/TokenStore/JsonTokenStore.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Text.Json;

namespace DeviantArt.Net.Modules.TokenStore;
namespace DeviantArt.Net.Modules.TokenStore;


/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Globalization;
using System.Text.Json;

namespace DeviantArt.Net.Modules.Util.Formatters;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Text.Json;

namespace DeviantArt.Net.Modules.Util.Formatters;
namespace DeviantArt.Net.Modules.Util.Formatters;

public class UnixTimestampConverter : JsonConverter<DateTimeOffset>
{
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.NetTest/ApiClientTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Models.Deviation;

namespace DeviantArt.NetTest;
namespace DeviantArt.NetTest;

[TestClass]
public class ClientTests : Testbase
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.NetTest/CollectionTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Models.Deviation;

namespace DeviantArt.NetTest;
namespace DeviantArt.NetTest;

[TestClass]
public class CollectionTests : Testbase
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.NetTest/DeviationTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Models.Deviation;

namespace DeviantArt.NetTest;
namespace DeviantArt.NetTest;

[TestClass]
public class DeviationTests : Testbase
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.NetTest/GalleryTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using DeviantArt.Net.Models.Deviation;

namespace DeviantArt.NetTest;
namespace DeviantArt.NetTest;

[TestClass]
public class GalleryTests : Testbase
Expand Down
6 changes: 6 additions & 0 deletions DeviantArt.NetTest/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
// Global using directives

global using System.Globalization;
global using System.Text.Json;
global using DeviantArt.Net.Api;
global using DeviantArt.Net.Exceptions;
global using DeviantArt.Net.Models;
global using DeviantArt.Net.Models.Data;
global using DeviantArt.Net.Models.Deviation;
global using DeviantArt.Net.Models.Message;
global using DeviantArt.Net.Models.User;
global using DeviantArt.Net.Modules.TokenStore;
global using DeviantArt.Net.Modules.Util;
global using DeviantArt.NetTest.Utils;
5 changes: 1 addition & 4 deletions DeviantArt.NetTest/MessageClientTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using DeviantArt.Net.Exceptions;
using DeviantArt.Net.Models.Message;

namespace DeviantArt.NetTest;
namespace DeviantArt.NetTest;

[TestClass]
public class MessageClientTests : Testbase
Expand Down
5 changes: 1 addition & 4 deletions DeviantArt.NetTest/UserTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using DeviantArt.Net.Models.Data;
using DeviantArt.Net.Models.User;

namespace DeviantArt.NetTest;
namespace DeviantArt.NetTest;

[TestClass]
public class UserTests : Testbase
Expand Down
4 changes: 1 addition & 3 deletions DeviantArt.NetTest/Utils/Ids.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Globalization;

namespace DeviantArt.NetTest.Utils;
namespace DeviantArt.NetTest.Utils;

public static class Ids
{
Expand Down

0 comments on commit 8c8af4c

Please sign in to comment.