-
Notifications
You must be signed in to change notification settings - Fork 44
Add support for used in endpoints #403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| using System; | ||
|
|
||
| namespace Kontent.Ai.Delivery.Abstractions; | ||
|
|
||
| /// <summary> | ||
| /// Represents a parent content item. | ||
| /// </summary> | ||
| public interface IUsedInItem | ||
| { | ||
| /// <summary> | ||
| /// Represents system attributes of a parent content item. | ||
| /// </summary> | ||
| public IUsedInItemSystemAttributes System { get; } | ||
| } |
33 changes: 33 additions & 0 deletions
33
Kontent.Ai.Delivery.Abstractions/UsedIn/IUsedInItemSystemAttributes.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| namespace Kontent.Ai.Delivery.Abstractions | ||
| { | ||
| /// <summary> | ||
| /// Represents system attributes of a parent content item. | ||
| /// </summary> | ||
| public interface IUsedInItemSystemAttributes : ISystemAttributes | ||
| { | ||
| /// <summary> | ||
| /// Gets the language of the content item. | ||
| /// </summary> | ||
| string Language { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the codename of the content type, for example "article". | ||
| /// </summary> | ||
| string Type { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the codename of the content collection to which the content item belongs. | ||
| /// </summary> | ||
| public string Collection { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the codename of the workflow which the content item is assigned to. | ||
| /// </summary> | ||
| public string Workflow { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets the codename of the workflow step which the content item is assigned to. | ||
| /// </summary> | ||
| public string WorkflowStep { get; } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| { | ||
| "items": [ | ||
| { | ||
| "system": { | ||
| "id": "35778b62-e97f-42cb-833f-8a34c14e27ce", | ||
| "name": "rich text child", | ||
| "codename": "rich_text_child", | ||
| "language": "language1", | ||
| "type": "ct", | ||
| "collection": "default", | ||
| "workflow": "default", | ||
| "workflow_step": "published", | ||
| "last_modified": "2024-08-01T14:17:50.4141347Z" | ||
| } | ||
| }, | ||
| { | ||
| "system": { | ||
| "id": "3ad63df6-a439-4a64-8193-14e999bfaaf2", | ||
| "name": "rich text child 2", | ||
| "codename": "rich_text_child_2", | ||
| "language": "language1", | ||
| "type": "ct", | ||
| "collection": "default", | ||
| "workflow": "default", | ||
| "workflow_step": "published", | ||
| "last_modified": "2024-08-01T14:17:50.4141347Z" | ||
| } | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method is synchronous but invokes an async method and waits for its result, effectively blocking threads. not sure if this is a valid scenario under the circumstances, but I'm not familiar with Rx so I asked AI about it.
the fix is simple, make the method async and have it return
IAsyncEnumerable:however, related methods would need to be updated as well.
again, I'm not sure if thread locking or even deadlocks can be a thing in our scenario. also, Rx is used much less, compared to async, so I leave this at your decision.