Skip to content

Commit

Permalink
feat: Added Summary MethodNamingConvention.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Sep 11, 2024
1 parent 05f597b commit 517e735
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 11 deletions.
6 changes: 4 additions & 2 deletions src/libs/AutoSDK/Naming/Methods/MethodNamingConvention.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ namespace AutoSDK.Naming.Methods;

public enum MethodNamingConvention
{
SimpleOperationId,
OperationId,
MethodAndPath,
Summary,
OperationIdWithDots,
OperationIdSplit,
}
Expand All @@ -16,8 +17,9 @@ public static IMethodNameGenerator GetGenerator(this MethodNamingConvention oper
{
return operation switch
{
MethodNamingConvention.SimpleOperationId => new SimpleOperationIdGenerator(),
MethodNamingConvention.OperationId => new OperationIdGenerator(),
MethodNamingConvention.OperationIdWithDots => new OperationIdWithDotsGenerator(),
MethodNamingConvention.Summary => new SummaryGenerator(),
MethodNamingConvention.MethodAndPath => new MethodAndPathGenerator(),
MethodNamingConvention.OperationIdSplit => new OperationIdSplitGenerator(),
_ => throw new ArgumentOutOfRangeException(nameof(operation), operation, null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace AutoSDK.Naming.Methods;

public class SimpleOperationIdGenerator : IMethodNameGenerator
public class OperationIdGenerator : IMethodNameGenerator
{
public string? TryGenerate(OperationContext operation)
{
Expand Down
16 changes: 16 additions & 0 deletions src/libs/AutoSDK/Naming/Methods/SummaryGenerator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using AutoSDK.Extensions;
using AutoSDK.Models;

namespace AutoSDK.Naming.Methods;

public class SummaryGenerator : IMethodNameGenerator
{
public string? TryGenerate(OperationContext operation)
{
operation = operation ?? throw new ArgumentNullException(nameof(operation));

return operation.Operation.Summary?
.ToPropertyName()
.UseWordSeparator('\\', '-', '.', '_', '/', '}', '{');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public sealed partial class Api : global::System.IDisposable

/// <summary>
/// Create personalized avatar videos with ease using the **HeyGen API**. By selecting an avatar and a voice, you can create engaging videos for various purposes. 🌟<br/>
/// **Guide**: [https://docs.heygen.com/docs/create-video<br>](https://docs.heygen.com/docs/create-video)**Reference**: [https://docs.heygen.com/reference/create-an-avatar-video-v2](https://docs.heygen.com/reference/create-an-avatar-video-v2)
/// **Guide**: [https://docs.heygen.com/docs/create-video](https://docs.heygen.com/docs/create-video)**Reference**: [https://docs.heygen.com/reference/create-an-avatar-video-v2](https://docs.heygen.com/reference/create-an-avatar-video-v2)
/// </summary>
public CreateVideoAPIClient CreateVideoAPI => new CreateVideoAPIClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions);

Expand All @@ -66,19 +66,19 @@ public sealed partial class Api : global::System.IDisposable

/// <summary>
/// The [Video Translate](https://labs.heygen.com/video-translate) by HeyGen provides a powerful solution for effortlessly translating videos, integrating natural voice cloning and authentic speaking styles seamlessly. Now, you can harness its capabilities programmatically through the **Video Translate API**!<br/>
/// **Guide**: [https://docs.heygen.com/docs/video-translate-api<br>](https://docs.heygen.com/docs/video-translate-api)**Reference**: [https://docs.heygen.com/reference/video-translate](https://docs.heygen.com/reference/video-translate)
/// **Guide**: [https://docs.heygen.com/docs/video-translate-api](https://docs.heygen.com/docs/video-translate-api)**Reference**: [https://docs.heygen.com/reference/video-translate](https://docs.heygen.com/reference/video-translate)
/// </summary>
public VideoTranslateAPIClient VideoTranslateAPI => new VideoTranslateAPIClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions);

/// <summary>
/// HeyGen's **Streaming API** allows developers to seamlessly integrate dynamic digital avatars into their applications for immersive and interactive user experiences. With this API, you can create _virtual assistants, real-time training simulations,_ and more, with a focus on real-time, low-latency communication between _users_ and _avatars_ with power of WebRTC.<br/>
/// **Guide**: [https://docs.heygen.com/docs/streaming-api<br>](https://docs.heygen.com/docs/streaming-api)**Reference**: [https://docs.heygen.com/reference/new-session](https://docs.heygen.com/reference/new-session)
/// **Guide**: [https://docs.heygen.com/docs/streaming-api](https://docs.heygen.com/docs/streaming-api)**Reference**: [https://docs.heygen.com/reference/new-session](https://docs.heygen.com/reference/new-session)
/// </summary>
public StreamingAPIClient StreamingAPI => new StreamingAPIClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions);

/// <summary>
/// Webhook events are how the **HeyGen** notifies your _endpoints_ when a variety of interactions or events happen, including when avatar video processing _succeeds_ or _fails_. Webhook events are sent by HeyGen as POST requests to your webhook endpoint.<br/>
/// **Guide**: [https://docs.heygen.com/docs/using-heygens-webhook-events<br>](https://docs.heygen.com/docs/using-heygens-webhook-events)**Reference**: [https://docs.heygen.com/reference/add-a-webhook-endpoint](https://docs.heygen.com/reference/add-a-webhook-endpoint)
/// **Guide**: [https://docs.heygen.com/docs/using-heygens-webhook-events](https://docs.heygen.com/docs/using-heygens-webhook-events)**Reference**: [https://docs.heygen.com/reference/add-a-webhook-endpoint](https://docs.heygen.com/reference/add-a-webhook-endpoint)
/// </summary>
public WebhooksClient Webhooks => new WebhooksClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public sealed partial class Api : global::System.IDisposable

/// <summary>
/// Create personalized avatar videos with ease using the **HeyGen API**. By selecting an avatar and a voice, you can create engaging videos for various purposes. 🌟<br/>
/// **Guide**: [https://docs.heygen.com/docs/create-video<br>](https://docs.heygen.com/docs/create-video)**Reference**: [https://docs.heygen.com/reference/create-an-avatar-video-v2](https://docs.heygen.com/reference/create-an-avatar-video-v2)
/// **Guide**: [https://docs.heygen.com/docs/create-video](https://docs.heygen.com/docs/create-video)**Reference**: [https://docs.heygen.com/reference/create-an-avatar-video-v2](https://docs.heygen.com/reference/create-an-avatar-video-v2)
/// </summary>
public CreateVideoAPIClient CreateVideoAPI => new CreateVideoAPIClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions);

Expand All @@ -66,19 +66,19 @@ public sealed partial class Api : global::System.IDisposable

/// <summary>
/// The [Video Translate](https://labs.heygen.com/video-translate) by HeyGen provides a powerful solution for effortlessly translating videos, integrating natural voice cloning and authentic speaking styles seamlessly. Now, you can harness its capabilities programmatically through the **Video Translate API**!<br/>
/// **Guide**: [https://docs.heygen.com/docs/video-translate-api<br>](https://docs.heygen.com/docs/video-translate-api)**Reference**: [https://docs.heygen.com/reference/video-translate](https://docs.heygen.com/reference/video-translate)
/// **Guide**: [https://docs.heygen.com/docs/video-translate-api](https://docs.heygen.com/docs/video-translate-api)**Reference**: [https://docs.heygen.com/reference/video-translate](https://docs.heygen.com/reference/video-translate)
/// </summary>
public VideoTranslateAPIClient VideoTranslateAPI => new VideoTranslateAPIClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions);

/// <summary>
/// HeyGen's **Streaming API** allows developers to seamlessly integrate dynamic digital avatars into their applications for immersive and interactive user experiences. With this API, you can create _virtual assistants, real-time training simulations,_ and more, with a focus on real-time, low-latency communication between _users_ and _avatars_ with power of WebRTC.<br/>
/// **Guide**: [https://docs.heygen.com/docs/streaming-api<br>](https://docs.heygen.com/docs/streaming-api)**Reference**: [https://docs.heygen.com/reference/new-session](https://docs.heygen.com/reference/new-session)
/// **Guide**: [https://docs.heygen.com/docs/streaming-api](https://docs.heygen.com/docs/streaming-api)**Reference**: [https://docs.heygen.com/reference/new-session](https://docs.heygen.com/reference/new-session)
/// </summary>
public StreamingAPIClient StreamingAPI => new StreamingAPIClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions);

/// <summary>
/// Webhook events are how the **HeyGen** notifies your _endpoints_ when a variety of interactions or events happen, including when avatar video processing _succeeds_ or _fails_. Webhook events are sent by HeyGen as POST requests to your webhook endpoint.<br/>
/// **Guide**: [https://docs.heygen.com/docs/using-heygens-webhook-events<br>](https://docs.heygen.com/docs/using-heygens-webhook-events)**Reference**: [https://docs.heygen.com/reference/add-a-webhook-endpoint](https://docs.heygen.com/reference/add-a-webhook-endpoint)
/// **Guide**: [https://docs.heygen.com/docs/using-heygens-webhook-events](https://docs.heygen.com/docs/using-heygens-webhook-events)**Reference**: [https://docs.heygen.com/reference/add-a-webhook-endpoint](https://docs.heygen.com/reference/add-a-webhook-endpoint)
/// </summary>
public WebhooksClient Webhooks => new WebhooksClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions);

Expand Down

0 comments on commit 517e735

Please sign in to comment.