Skip to content

Commit

Permalink
fix: Fixed issue with Summary naming and collisions.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Sep 11, 2024
1 parent e8b19f0 commit a64905e
Show file tree
Hide file tree
Showing 42 changed files with 428 additions and 427 deletions.
5 changes: 3 additions & 2 deletions src/libs/AutoSDK/Models/OperationContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ public class OperationContext
public required OperationType OperationType { get; init; }

public IReadOnlyCollection<SchemaContext> Schemas { get; set; } = [];

public string MethodName { get; set; } = string.Empty;

public HashSet<string> Tags { get; set; } = [];

public string MethodName { get; set; } = string.Empty;

public static OperationContext FromOperation(
Settings settings,
Expand All @@ -34,6 +34,7 @@ public static OperationContext FromOperation(
Schemas = filteredSchemas
.Where(schema => schema.Operation == operation)
.ToArray(),
Tags = [..operation.Tags.Select(tag => tag.Name)]
};
context.MethodName = context.GetMethodName();

Expand Down
2 changes: 1 addition & 1 deletion src/libs/AutoSDK/Naming/Models/ModelNameGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public static void ResolveCollisions(IReadOnlyCollection<OperationContext> conte
while (true)
{
var schemasWithCollision = contexts
.GroupBy(x => x.MethodName)
.GroupBy(x => (x.MethodName, x.Tags.FirstOrDefault() ?? string.Empty))
.Where(x => x.Count() > 1)
.ToArray();
if (schemasWithCollision.Length == 0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
//HintName: G.FilesClient.Create4.g.cs
//HintName: G.FilesClient.Create.g.cs

#nullable enable

namespace G
{
public partial class FilesClient
{
partial void PrepareCreate4Arguments(
partial void PrepareCreateArguments(
global::System.Net.Http.HttpClient httpClient,
global::G.BodyCreateV4FilesPost request);
partial void PrepareCreate4Request(
partial void PrepareCreateRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
global::G.BodyCreateV4FilesPost request);
partial void ProcessCreate4Response(
partial void ProcessCreateResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);

partial void ProcessCreate4ResponseContent(
partial void ProcessCreateResponseContent(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage,
ref string content);
Expand All @@ -29,15 +29,15 @@ partial void ProcessCreate4ResponseContent(
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::G.CreateV4FilesPostResponse> Create4Async(
public async global::System.Threading.Tasks.Task<global::G.CreateV4FilesPostResponse> CreateAsync(
global::G.BodyCreateV4FilesPost request,
global::System.Threading.CancellationToken cancellationToken = default)
{
request = request ?? throw new global::System.ArgumentNullException(nameof(request));

PrepareArguments(
client: _httpClient);
PrepareCreate4Arguments(
PrepareCreateArguments(
httpClient: _httpClient,
request: request);

Expand All @@ -60,7 +60,7 @@ partial void ProcessCreate4ResponseContent(
PrepareRequest(
client: _httpClient,
request: httpRequest);
PrepareCreate4Request(
PrepareCreateRequest(
httpClient: _httpClient,
httpRequestMessage: httpRequest,
request: request);
Expand All @@ -73,7 +73,7 @@ partial void ProcessCreate4ResponseContent(
ProcessResponse(
client: _httpClient,
response: response);
ProcessCreate4Response(
ProcessCreateResponse(
httpClient: _httpClient,
httpResponseMessage: response);

Expand All @@ -83,7 +83,7 @@ partial void ProcessCreate4ResponseContent(
client: _httpClient,
response: response,
content: ref __content);
ProcessCreate4ResponseContent(
ProcessCreateResponseContent(
httpClient: _httpClient,
httpResponseMessage: response,
content: ref __content);
Expand All @@ -110,7 +110,7 @@ partial void ProcessCreate4ResponseContent(
/// <param name="pfilename"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::G.CreateV4FilesPostResponse> Create4Async(
public async global::System.Threading.Tasks.Task<global::G.CreateV4FilesPostResponse> CreateAsync(
byte[] pfile,
string pfilename,
global::System.Threading.CancellationToken cancellationToken = default)
Expand All @@ -121,7 +121,7 @@ partial void ProcessCreate4ResponseContent(
Pfilename = pfilename,
};

return await Create4Async(
return await CreateAsync(
request: request,
cancellationToken: cancellationToken).ConfigureAwait(false);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
//HintName: G.FilesClient.Index7.g.cs
//HintName: G.FilesClient.Index.g.cs

#nullable enable

namespace G
{
public partial class FilesClient
{
partial void PrepareIndex7Arguments(
partial void PrepareIndexArguments(
global::System.Net.Http.HttpClient httpClient,
ref int skip,
ref int limit);
partial void PrepareIndex7Request(
partial void PrepareIndexRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
int skip,
int limit);
partial void ProcessIndex7Response(
partial void ProcessIndexResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);

partial void ProcessIndex7ResponseContent(
partial void ProcessIndexResponseContent(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage,
ref string content);
Expand All @@ -36,14 +36,14 @@ partial void ProcessIndex7ResponseContent(
/// </param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::G.PaginatedAny> Index7Async(
public async global::System.Threading.Tasks.Task<global::G.PaginatedAny> IndexAsync(
int skip = 0,
int limit = 20,
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: _httpClient);
PrepareIndex7Arguments(
PrepareIndexArguments(
httpClient: _httpClient,
skip: ref skip,
limit: ref limit);
Expand All @@ -55,7 +55,7 @@ partial void ProcessIndex7ResponseContent(
PrepareRequest(
client: _httpClient,
request: httpRequest);
PrepareIndex7Request(
PrepareIndexRequest(
httpClient: _httpClient,
httpRequestMessage: httpRequest,
skip: skip,
Expand All @@ -69,7 +69,7 @@ partial void ProcessIndex7ResponseContent(
ProcessResponse(
client: _httpClient,
response: response);
ProcessIndex7Response(
ProcessIndexResponse(
httpClient: _httpClient,
httpResponseMessage: response);

Expand All @@ -79,7 +79,7 @@ partial void ProcessIndex7ResponseContent(
client: _httpClient,
response: response,
content: ref __content);
ProcessIndex7ResponseContent(
ProcessIndexResponseContent(
httpClient: _httpClient,
httpResponseMessage: response,
content: ref __content);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
//HintName: G.FilesClient.Retrieve5.g.cs
//HintName: G.FilesClient.Retrieve.g.cs

#nullable enable

namespace G
{
public partial class FilesClient
{
partial void PrepareRetrieve5Arguments(
partial void PrepareRetrieveArguments(
global::System.Net.Http.HttpClient httpClient,
ref string fileId);
partial void PrepareRetrieve5Request(
partial void PrepareRetrieveRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
string fileId);
partial void ProcessRetrieve5Response(
partial void ProcessRetrieveResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);

partial void ProcessRetrieve5ResponseContent(
partial void ProcessRetrieveResponseContent(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage,
ref string content);
Expand All @@ -29,13 +29,13 @@ partial void ProcessRetrieve5ResponseContent(
/// <param name="fileId"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::G.RetrieveV4FilesFileIdGetResponse> Retrieve5Async(
public async global::System.Threading.Tasks.Task<global::G.RetrieveV4FilesFileIdGetResponse> RetrieveAsync(
string fileId,
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: _httpClient);
PrepareRetrieve5Arguments(
PrepareRetrieveArguments(
httpClient: _httpClient,
fileId: ref fileId);

Expand All @@ -46,7 +46,7 @@ partial void ProcessRetrieve5ResponseContent(
PrepareRequest(
client: _httpClient,
request: httpRequest);
PrepareRetrieve5Request(
PrepareRetrieveRequest(
httpClient: _httpClient,
httpRequestMessage: httpRequest,
fileId: fileId);
Expand All @@ -59,7 +59,7 @@ partial void ProcessRetrieve5ResponseContent(
ProcessResponse(
client: _httpClient,
response: response);
ProcessRetrieve5Response(
ProcessRetrieveResponse(
httpClient: _httpClient,
httpResponseMessage: response);

Expand All @@ -69,7 +69,7 @@ partial void ProcessRetrieve5ResponseContent(
client: _httpClient,
response: response,
content: ref __content);
ProcessRetrieve5ResponseContent(
ProcessRetrieveResponseContent(
httpClient: _httpClient,
httpResponseMessage: response,
content: ref __content);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//HintName: G.PipelineFamiliesClient.Index6.g.cs
//HintName: G.PipelineFamiliesClient.Index.g.cs

#nullable enable

namespace G
{
public partial class PipelineFamiliesClient
{
partial void PrepareIndex6Arguments(
partial void PrepareIndexArguments(
global::System.Net.Http.HttpClient httpClient,
ref string? userId,
ref string? teamId,
Expand All @@ -15,7 +15,7 @@ partial void PrepareIndex6Arguments(
ref bool includeAllRun,
ref int skip,
ref int limit);
partial void PrepareIndex6Request(
partial void PrepareIndexRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
string? userId,
Expand All @@ -25,11 +25,11 @@ partial void PrepareIndex6Request(
bool includeAllRun,
int skip,
int limit);
partial void ProcessIndex6Response(
partial void ProcessIndexResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);

partial void ProcessIndex6ResponseContent(
partial void ProcessIndexResponseContent(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage,
ref string content);
Expand Down Expand Up @@ -58,7 +58,7 @@ partial void ProcessIndex6ResponseContent(
/// </param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::G.PaginatedPipelineFamilyGet> Index6Async(
public async global::System.Threading.Tasks.Task<global::G.PaginatedPipelineFamilyGet> IndexAsync(
string? userId = default,
string? teamId = default,
global::G.AllOf<global::G.OrderBy?>? orderBy = default,
Expand All @@ -70,7 +70,7 @@ partial void ProcessIndex6ResponseContent(
{
PrepareArguments(
client: _httpClient);
PrepareIndex6Arguments(
PrepareIndexArguments(
httpClient: _httpClient,
userId: ref userId,
teamId: ref teamId,
Expand All @@ -87,7 +87,7 @@ partial void ProcessIndex6ResponseContent(
PrepareRequest(
client: _httpClient,
request: httpRequest);
PrepareIndex6Request(
PrepareIndexRequest(
httpClient: _httpClient,
httpRequestMessage: httpRequest,
userId: userId,
Expand All @@ -106,7 +106,7 @@ partial void ProcessIndex6ResponseContent(
ProcessResponse(
client: _httpClient,
response: response);
ProcessIndex6Response(
ProcessIndexResponse(
httpClient: _httpClient,
httpResponseMessage: response);

Expand All @@ -116,7 +116,7 @@ partial void ProcessIndex6ResponseContent(
client: _httpClient,
response: response,
content: ref __content);
ProcessIndex6ResponseContent(
ProcessIndexResponseContent(
httpClient: _httpClient,
httpResponseMessage: response,
content: ref __content);
Expand Down
Loading

0 comments on commit a64905e

Please sign in to comment.