├── .editorconfig ├── .github ├── ISSUE_TEMPLATE │ └── config.yml ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── scripts │ ├── README.md │ └── mailchimp │ │ └── package.json │ ├── build-and-test.yml │ ├── publish.yml │ ├── update-maintainers-trigger.yaml │ └── automerge-for-humans-remove-ready-to-merge-label-on-edit.yml ├── assets └── img │ ├── ui.png │ └── logo_white_on_blue_256.png ├── src ├── Neuroglia.AsyncApi.AspNetCore.UI │ ├── Pages │ │ ├── _ViewStart.cshtml │ │ ├── AsyncApi.cshtml.cs │ │ ├── Shared │ │ │ ├── v3 │ │ │ │ ├── _V3ExternalDocumentation.cshtml │ │ │ │ ├── _V3ReplyAddress.cshtml │ │ │ │ ├── _V3BindingCollection.cshtml │ │ │ │ └── _V3CorrelationId.cshtml │ │ │ └── v2 │ │ │ │ └── _V2CorrelationId.cshtml │ │ └── _ViewImports.cshtml │ ├── Usings.cs │ ├── Properties │ │ └── launchSettings.json │ └── Models │ │ ├── v3 │ │ ├── V3AsyncApiDocumentViewModel.cs │ │ ├── V3ComponentsViewModel.cs │ │ ├── V3SchemaViewModel.cs │ │ └── V3TagDefinitionViewModel.cs │ │ └── v2 │ │ ├── V2SchemaViewModel.cs │ │ └── V2ChannelDefinitionViewModel.cs ├── Neuroglia.AsyncApi.AspNetCore │ ├── Properties │ │ └── launchSettings.json │ ├── Usings.cs │ └── AsyncApiDocumentServingOptions.cs ├── Neuroglia.AsyncApi.Validation │ ├── Usings.cs │ ├── v3 │ │ ├── V3MessageExampleValidator.cs │ │ ├── V3SecuritySchemeValidator.cs │ │ ├── V3ServerVariableValidator.cs │ │ ├── V3LicenseValidator.cs │ │ ├── V3SchemaValidator.cs │ │ ├── V3TagValidator.cs │ │ ├── V3ExternalDocumentationValidator.cs │ │ ├── V3MessageBindingCollectionValidator.cs │ │ ├── V3ChannelBindingCollectionValidator.cs │ │ └── V3ServerBindingCollectionValidator.cs │ └── v2 │ │ ├── V2TagValidator.cs │ │ ├── V2LicenseValidator.cs │ │ ├── V2MessageTraitValidator.cs │ │ ├── V2ServerValidator.cs │ │ ├── V2OperationTraitValidator.cs │ │ ├── V2MessageValidator.cs │ │ ├── V2ChannelValidator.cs │ │ └── V2ApiInfoValidator.cs ├── Neuroglia.AsyncApi.IO │ └── Usings.cs ├── Neuroglia.AsyncApi.Client │ ├── Usings.cs │ ├── Configuration │ │ └── BindingHandlerOptions.cs │ ├── IAsyncApiPublishOperationResult.cs │ ├── ErrorTitle.cs │ ├── AsyncApiPublishOperationResult.cs │ ├── ErrorStatus.cs │ ├── AsyncApiSubscribeOperationResult.cs │ ├── IAsyncApiOperationResult.cs │ └── IAsyncApiSubscribeOperationResult.cs ├── Neuroglia.AsyncApi.FluentBuilders │ ├── Usings.cs │ └── Interfaces │ │ ├── IVersionedApiDocumentBuilder.cs │ │ ├── IReferenceableComponentDefinitionBuilder.cs │ │ └── IRuntimeExpressionFragmentBuilder.cs ├── Neuroglia.AsyncApi.Client.Bindings.Amqp │ ├── Configuration │ │ └── AmqpBindingHandlerOptions.cs │ ├── Usings.cs │ └── AmqpPublishOperationResult.cs ├── Neuroglia.AsyncApi.Client.Bindings.Http │ ├── Configuration │ │ └── HttpBindingHandlerOptions.cs │ └── Usings.cs ├── Neuroglia.AsyncApi.Client.Bindings.Mqtt │ ├── Configuration │ │ └── MqttBindingHandlerOptions.cs │ └── Usings.cs ├── Neuroglia.AsyncApi.Client.Bindings.Nats │ ├── Configuration │ │ └── NatsBindingHandlerOptions.cs │ ├── Usings.cs │ └── NatsPublishOperationResult.cs ├── Neuroglia.AsyncApi.Client.Bindings.Kafka │ ├── Configuration │ │ └── KafkaBindingHandlerOptions.cs │ └── Usings.cs ├── Neuroglia.AsyncApi.Client.Bindings.Redis │ ├── Configuration │ │ └── RedisBindingHandlerOptions.cs │ └── Usings.cs ├── Neuroglia.AsyncApi.Client.Bindings.Stomp │ ├── Configuration │ │ └── StompBindingHandlerOptions.cs │ ├── Usings.cs │ └── StompPublishOperationResult.cs ├── Neuroglia.AsyncApi.Core │ ├── IReferenceable.cs │ ├── Attributes │ │ ├── ExcludeAttribute.cs │ │ ├── ChannelBindingAttribute.cs │ │ ├── MessageBindingAttribute.cs │ │ ├── ServerBindingAttribute.cs │ │ ├── OperationBindingAttribute.cs │ │ └── IBindingAttribute.cs │ ├── Usings.cs │ ├── Bindings │ │ ├── IBindingDefinition.cs │ │ ├── Amqp │ │ │ ├── AmqpBindingDefinition.cs │ │ │ ├── AmqpChannelType.cs │ │ │ ├── AmqpServerBindingAttribute.cs │ │ │ └── AmqpServerBindingDefinition.cs │ │ ├── AmqpV1 │ │ │ ├── AmqpV1BindingDefinition.cs │ │ │ ├── AmqpV1ServerBindingAttribute.cs │ │ │ └── AmqpV1MessageBindingAttribute.cs │ │ ├── GooglePubSub │ │ │ └── GooglePubSubSchemaDefinition.cs │ │ ├── Http │ │ │ ├── HttpBindingDefinition.cs │ │ │ ├── HttpMessageBindingAttribute.cs │ │ │ ├── HttpServerBindingAttribute.cs │ │ │ ├── HttpChannelBindingAttribute.cs │ │ │ ├── HttpServerBindingDefinition.cs │ │ │ └── HttpChannelBindingDefinition.cs │ │ ├── Mqtt │ │ │ ├── MqttBindingDefinition.cs │ │ │ ├── MqttChannelBindingAttribute.cs │ │ │ └── MqttChannelBindingDefinition.cs │ │ ├── Nats │ │ │ ├── NatsBindingDefinition.cs │ │ │ ├── NatsMessageBindingAttribute.cs │ │ │ ├── NatsChannelBindingAttribute.cs │ │ │ └── NatsServerBindingAttribute.cs │ │ ├── Solace │ │ │ ├── SolaceDeliveryMode.cs │ │ │ ├── SolaceMessageBindingAttribute.cs │ │ │ ├── SolaceChannelBindingAttribute.cs │ │ │ └── SolaceMessageBindingDefinition.cs │ │ ├── Redis │ │ │ ├── RedisBindingDefinition.cs │ │ │ ├── RedisMessageBindingAttribute.cs │ │ │ ├── RedisChannelBindingAttribute.cs │ │ │ ├── RedisServerBindingAttribute.cs │ │ │ └── RedisOperationBindingAttribute.cs │ │ ├── WebSockets │ │ │ ├── WsBindingDefinition.cs │ │ │ ├── WsMessageBindingAttribute.cs │ │ │ ├── WsServerBindingAttribute.cs │ │ │ └── WsOperationBindingAttribute.cs │ │ ├── MqttV5 │ │ │ ├── MqttV5BindingDefinition.cs │ │ │ ├── MqttV5MessageBindingAttribute.cs │ │ │ ├── MqttV5ServerBindingAttribute.cs │ │ │ └── MqttV5ChannelBindingAttribute.cs │ │ ├── Jms │ │ │ ├── JmsMessageBindingAttribute.cs │ │ │ ├── JmsOperationBindingDefinition.cs │ │ │ └── JmsOperationBindingAttribute.cs │ │ ├── Sns │ │ │ ├── SnsMessageBindingAttribute.cs │ │ │ ├── SnsServerBindingAttribute.cs │ │ │ ├── SnsMessageBindingDefinition.cs │ │ │ ├── SnsServerBindingDefinition.cs │ │ │ └── SnsTopicOrderingType.cs │ │ ├── Sqs │ │ │ ├── SqsMessageBindingAttribute.cs │ │ │ ├── SqsServerBindingAttribute.cs │ │ │ ├── SqsMessageBindingDefinition.cs │ │ │ ├── SqsOperationBindingAttribute.cs │ │ │ └── SqsServerBindingDefinition.cs │ │ ├── IbmMQ │ │ │ ├── IbmMQDestinationType.cs │ │ │ ├── IbmMQOperationBindingDefinition.cs │ │ │ └── IbmMQOperationBindingAttribute.cs │ │ ├── Stomp │ │ │ ├── StompMessageBindingAttribute.cs │ │ │ ├── StompChannelBindingAttribute.cs │ │ │ └── StompServerBindingAttribute.cs │ │ ├── Kafka │ │ │ ├── KafkaChannelBindingAttribute.cs │ │ │ ├── KafkaMessageBindingAttribute.cs │ │ │ ├── KafkaServerBindingAttribute.cs │ │ │ └── KafkaOperationBindingAttribute.cs │ │ ├── Mercure │ │ │ ├── MercureMessageBindingAttribute.cs │ │ │ ├── MercureChannelBindingAttribute.cs │ │ │ └── MercureServerBindingAttribute.cs │ │ └── Pulsar │ │ │ └── PulsarMessageBindingAttribute.cs │ ├── SchemaContext.cs │ ├── AsyncApiDocumentFormat.cs │ ├── v3 │ │ ├── V3ReferenceDefinition.cs │ │ └── V3OperationAction.cs │ ├── AsyncApiSpecVersion.cs │ └── v2 │ │ ├── V2OperationType.cs │ │ └── Attributes │ │ └── AsyncApiAttribute.cs ├── Neuroglia.AsyncApi.Client.Bindings.Pulsar │ ├── Configuration │ │ └── PulsarBindingHandlerOptions.cs │ └── Usings.cs ├── Neuroglia.AsyncApi.Client.Bindings.Solace │ ├── Configuration │ │ └── SolaceBindingHandlerOptions.cs │ ├── Usings.cs │ ├── SolaceDestinationDescriptor.cs │ └── SolacePublishOperationResult.cs ├── Neuroglia.AsyncApi.Generation │ └── Usings.cs └── Neuroglia.AsyncApi.Client.Bindings.WebSocket │ ├── Configuration │ └── WebSocketBindingHandlerOptions.cs │ ├── Usings.cs │ └── WebSocketPublishOperationResult.cs ├── tests └── Neuroglia.AsyncApi.UnitTests │ ├── Assets │ └── mqtt │ │ └── mosquitto.conf │ ├── Usings.cs │ └── Services │ └── ContainerBootstrapper.cs ├── NOTICE ├── samples └── StreetLightsApi │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Properties │ └── launchSettings.json │ ├── StreetLightsApi.csproj │ ├── StreetLightType.cs │ ├── Messages │ ├── MeasureStreetLightLuminosityReply.cs │ └── CommonHeaders.cs │ └── Usings.cs └── CODEOWNERS /.editorconfig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncapi/net-sdk/HEAD/.editorconfig -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: [] 3 | -------------------------------------------------------------------------------- /assets/img/ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncapi/net-sdk/HEAD/assets/img/ui.png -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.AspNetCore.UI/Pages/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /tests/Neuroglia.AsyncApi.UnitTests/Assets/mqtt/mosquitto.conf: -------------------------------------------------------------------------------- 1 | allow_anonymous true 2 | listener 1883 0.0.0.0 -------------------------------------------------------------------------------- /assets/img/logo_white_on_blue_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncapi/net-sdk/HEAD/assets/img/logo_white_on_blue_256.png -------------------------------------------------------------------------------- /tests/Neuroglia.AsyncApi.UnitTests/Usings.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncapi/net-sdk/HEAD/tests/Neuroglia.AsyncApi.UnitTests/Usings.cs -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2016-2025 AsyncAPI Initiative 2 | 3 | This product includes software developed at 4 | AsyncAPI Initiative (http://www.asyncapi.com/). -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.AspNetCore.UI/Pages/AsyncApi.cshtml.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asyncapi/net-sdk/HEAD/src/Neuroglia.AsyncApi.AspNetCore.UI/Pages/AsyncApi.cshtml.cs -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | **What this PR does**: 2 | 3 | 4 | **Additional information:** 5 | -------------------------------------------------------------------------------- /samples/StreetLightsApi/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.github/workflows/scripts/README.md: -------------------------------------------------------------------------------- 1 | The entire `scripts` directory is centrally managed in [.github](https://github.com/asyncapi/.github/) repository. Any changes in this folder should be done in central repository. -------------------------------------------------------------------------------- /samples/StreetLightsApi/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /.github/workflows/scripts/mailchimp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "schedule-email", 3 | "description": "This code is responsible for scheduling an email campaign. This file is centrally managed in https://github.com/asyncapi/.github/", 4 | "license": "Apache 2.0", 5 | "dependencies": { 6 | "@actions/core": "1.6.0", 7 | "@mailchimp/mailchimp_marketing": "3.0.74" 8 | } 9 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.AspNetCore/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Neuroglia.AsyncApi.AspNetCore": { 4 | "commandName": "Project", 5 | "launchBrowser": true, 6 | "environmentVariables": { 7 | "ASPNETCORE_ENVIRONMENT": "Development" 8 | }, 9 | "applicationUrl": "https://localhost:52523;http://localhost:52524" 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.AspNetCore.UI/Pages/Shared/v3/_V3ExternalDocumentation.cshtml: -------------------------------------------------------------------------------- 1 | @model V3ExternalDocumentationDefinitionViewModel 2 | 3 | @if (!string.IsNullOrWhiteSpace(Model.Definition.Description)) 4 | { 5 |
6 | @Html.Raw(Markdown.ToHtml(Model.Definition.Description)) 7 |
8 | } 9 | 10 | @Model.Definition.Url -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # This file provides an overview of code owners in this repository. 2 | 3 | # Each line is a file pattern followed by one or more owners. 4 | # The last matching pattern has the most precedence. 5 | # For more details, read the following article on GitHub: https://help.github.com/articles/about-codeowners/. 6 | 7 | # The default owners are automatically added as reviewers when you open a pull request unless different owners are specified in the file. 8 | 9 | * @cdavernas @jbbianchi @asyncapi-bot-eve 10 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.AspNetCore.UI/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Markdig 2 | @using Neuroglia 3 | @using Neuroglia.AsyncApi 4 | @using Neuroglia.AsyncApi.AspNetCore.UI.Models 5 | @using Neuroglia.AsyncApi.AspNetCore.UI.Models.v2 6 | @using Neuroglia.AsyncApi.AspNetCore.UI.Models.v3 7 | @using Neuroglia.AsyncApi.Generation 8 | @using Neuroglia.AsyncApi.v2 9 | @using Neuroglia.AsyncApi.v3 10 | @using Neuroglia.Data.Schemas.Json 11 | @using Neuroglia.Serialization 12 | @using Json.Schema 13 | @using System.Text.Json.Serialization 14 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 15 | -------------------------------------------------------------------------------- /.github/workflows/build-and-test.yml: -------------------------------------------------------------------------------- 1 | name: Build and Test 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build-and-test: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v3 16 | - name: Setup .NET 17 | uses: actions/setup-dotnet@v3 18 | with: 19 | dotnet-version: | 20 | 8.0.x 21 | 9.0.x 22 | - name: Restore dependencies 23 | run: dotnet restore 24 | - name: Build 25 | run: dotnet build --no-restore 26 | - name: Test 27 | run: dotnet test --no-build 28 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.AspNetCore/Usings.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | global using Neuroglia.AsyncApi.v2; -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish NuGet package 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | 7 | jobs: 8 | publish: 9 | 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v3 14 | - name: Setup .NET 15 | uses: actions/setup-dotnet@v3 16 | with: 17 | dotnet-version: | 18 | 8.0.x 19 | 9.0.x 20 | - name: Restore dependencies 21 | run: dotnet restore 22 | - name: Build 23 | run: dotnet build --configuration Release --no-restore 24 | - name: Publish package 25 | run: dotnet nuget push "./src/*/bin/Release/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate 26 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.AspNetCore.UI/Pages/Shared/v3/_V3ReplyAddress.cshtml: -------------------------------------------------------------------------------- 1 | @model V3ReplyAddressDefinitionViewModel 2 | 3 | @if (!string.IsNullOrWhiteSpace(Model.Definition.Description)) 4 | { 5 | @Html.Raw(Markdown.ToHtml(Model.Definition.Description)) 6 | } 7 | 8 | @if (Model.Definition.Location != null) 9 | { 10 | 11 | 12 | 13 | 16 | 19 | 20 | 21 |
14 | Location 15 | 17 | @Model.Definition.Location 18 |
22 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Validation/Usings.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | global using FluentValidation; 15 | global using Neuroglia.AsyncApi.v2; 16 | global using Neuroglia.AsyncApi.v3; -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.IO/Usings.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | global using Neuroglia.AsyncApi.v2; 15 | global using Neuroglia.AsyncApi.v3; 16 | global using Neuroglia.Serialization; 17 | global using System.Text.Json; 18 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.AspNetCore.UI/Usings.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | global using Json.Schema; 15 | global using Neuroglia.AsyncApi.Bindings; 16 | global using Neuroglia.AsyncApi.v2; 17 | global using Neuroglia.AsyncApi.v3; 18 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.AspNetCore.UI/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:24957", 8 | "sslPort": 0 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "applicationUrl": "http://localhost:5236", 17 | "environmentVariables": { 18 | "ASPNETCORE_ENVIRONMENT": "Development" 19 | } 20 | }, 21 | "IIS Express": { 22 | "commandName": "IISExpress", 23 | "launchBrowser": true, 24 | "environmentVariables": { 25 | "ASPNETCORE_ENVIRONMENT": "Development" 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /samples/StreetLightsApi/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:25151", 8 | "sslPort": 0 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "applicationUrl": "http://localhost:5055", 17 | "launchUrl": "asyncapi", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | }, 22 | "IIS Express": { 23 | "commandName": "IISExpress", 24 | "launchBrowser": true, 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.AspNetCore.UI/Pages/Shared/v2/_V2CorrelationId.cshtml: -------------------------------------------------------------------------------- 1 | @model V2CorrelationIdDefinitionViewModel 2 | @{ 3 | var correlationId = this.Model.CorrelationId; 4 | } 5 | 6 |
7 | 8 | @if (!string.IsNullOrWhiteSpace(correlationId.Description)) 9 | { 10 |

@correlationId.Description

11 | } 12 | 13 |
14 |
15 | Location 16 | 17 |
18 |
@correlationId.Location
19 |
20 | 21 |
-------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client/Usings.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | global using Microsoft.Extensions.Logging; 15 | global using Neuroglia; 16 | global using Neuroglia.AsyncApi.Client.Configuration; 17 | global using Neuroglia.AsyncApi.Client.Services; 18 | global using Neuroglia.AsyncApi.v3; 19 | global using Neuroglia.Serialization; -------------------------------------------------------------------------------- /samples/StreetLightsApi/StreetLightsApi.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0;net9.0 5 | enable 6 | enable 7 | false 8 | True 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client/Configuration/BindingHandlerOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Client.Configuration; 15 | 16 | /// 17 | /// Represents the base class of all options used to configure s 18 | /// 19 | public abstract class BindingHandlerOptions 20 | { 21 | 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.FluentBuilders/Usings.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | global using FluentValidation; 15 | global using Json.Schema; 16 | global using Json.Schema.Generation; 17 | global using Microsoft.Extensions.DependencyInjection; 18 | global using Neuroglia.AsyncApi.Bindings; 19 | global using Neuroglia.AsyncApi.v2; 20 | global using Neuroglia.AsyncApi.v3; 21 | global using SemVersion; 22 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client/IAsyncApiPublishOperationResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Client; 15 | 16 | /// 17 | /// Defines the fundamentals of an object used to describe the result of an AsyncAPI publish operation 18 | /// 19 | public interface IAsyncApiPublishOperationResult 20 | : IAsyncApiOperationResult 21 | { 22 | 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.AspNetCore.UI/Pages/Shared/v3/_V3BindingCollection.cshtml: -------------------------------------------------------------------------------- 1 | @model V3BindingDefinitionCollectionViewModel 2 | @{ 3 | var bindings = this.Model.BindingCollection; 4 | } 5 | 6 |
7 | 13 |
14 |
15 |
16 | @foreach (var binding in bindings.AsEnumerable()) 17 | { 18 | 19 | } 20 |
21 |
22 |
23 |
-------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Amqp/Configuration/AmqpBindingHandlerOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Client.Bindings.Amqp.Configuration; 15 | 16 | /// 17 | /// Represents the options used to configure a 18 | /// 19 | public class AmqpBindingHandlerOptions 20 | : BindingHandlerOptions 21 | { 22 | 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Http/Configuration/HttpBindingHandlerOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Client.Bindings.Http.Configuration; 15 | 16 | /// 17 | /// Represents the options used to configure an 18 | /// 19 | public class HttpBindingHandlerOptions 20 | : BindingHandlerOptions 21 | { 22 | 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Mqtt/Configuration/MqttBindingHandlerOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Client.Bindings.Mqtt.Configuration; 15 | 16 | /// 17 | /// Represents the options used to configure an 18 | /// 19 | public class MqttBindingHandlerOptions 20 | : BindingHandlerOptions 21 | { 22 | 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Nats/Configuration/NatsBindingHandlerOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Client.Bindings.Nats.Configuration; 15 | 16 | /// 17 | /// Represents the options used to configure a 18 | /// 19 | public class NatsBindingHandlerOptions 20 | : BindingHandlerOptions 21 | { 22 | 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Kafka/Configuration/KafkaBindingHandlerOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Client.Bindings.Kafka.Configuration; 15 | 16 | /// 17 | /// Represents the options used to configure a 18 | /// 19 | public class KafkaBindingHandlerOptions 20 | : BindingHandlerOptions 21 | { 22 | 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Redis/Configuration/RedisBindingHandlerOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Client.Bindings.Redis.Configuration; 15 | 16 | /// 17 | /// Represents the options used to configure a 18 | /// 19 | public class RedisBindingHandlerOptions 20 | : BindingHandlerOptions 21 | { 22 | 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Stomp/Configuration/StompBindingHandlerOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Client.Bindings.Stomp.Configuration; 15 | 16 | /// 17 | /// Represents the options used to configure a 18 | /// 19 | public class StompBindingHandlerOptions 20 | : BindingHandlerOptions 21 | { 22 | 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client/ErrorTitle.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Client; 15 | 16 | /// 17 | /// Enumerates all default error titles 18 | /// 19 | public static class ErrorTitle 20 | { 21 | 22 | /// 23 | /// Gets the title for validation errors 24 | /// 25 | public const string Validation = "Validation Failed"; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/IReferenceable.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi; 15 | 16 | /// 17 | /// Defines the fundamentals of a referenceable component 18 | /// 19 | public interface IReferenceable 20 | { 21 | 22 | /// 23 | /// Gets the 's reference, if any 24 | /// 25 | string? Reference { get; } 26 | 27 | } -------------------------------------------------------------------------------- /samples/StreetLightsApi/StreetLightType.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace StreetLightsApi; 15 | 16 | /// 17 | /// Enumerates all types of street lights 18 | /// 19 | public enum StreetLightType 20 | { 21 | /// 22 | /// Indicates an LED light 23 | /// 24 | LED, 25 | /// 26 | /// Indicates an HPS light 27 | /// 28 | HPS 29 | } 30 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Pulsar/Configuration/PulsarBindingHandlerOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Client.Bindings.Pulsar.Configuration; 15 | 16 | /// 17 | /// Represents the options used to configure a 18 | /// 19 | public class PulsarBindingHandlerOptions 20 | : BindingHandlerOptions 21 | { 22 | 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Solace/Configuration/SolaceBindingHandlerOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Client.Bindings.Solace.Configuration; 15 | 16 | /// 17 | /// Represents the options used to configure a 18 | /// 19 | public class SolaceBindingHandlerOptions 20 | : BindingHandlerOptions 21 | { 22 | 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Generation/Usings.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | global using Json.Schema; 15 | global using Json.Schema.Generation; 16 | global using Microsoft.Extensions.DependencyInjection; 17 | global using Neuroglia.AsyncApi.FluentBuilders.v2; 18 | global using Neuroglia.AsyncApi.FluentBuilders.v3; 19 | global using Neuroglia.AsyncApi.v2; 20 | global using Neuroglia.AsyncApi.v3; 21 | global using System.Reflection; 22 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client/AsyncApiPublishOperationResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Client; 15 | 16 | /// 17 | /// Represents the base class for all implementations 18 | /// 19 | public abstract class AsyncApiPublishOperationResult 20 | : AsyncApiOperationResult, IAsyncApiPublishOperationResult 21 | { 22 | 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.WebSocket/Configuration/WebSocketBindingHandlerOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Client.Bindings.WebSocket.Configuration; 15 | 16 | /// 17 | /// Represents the options used to configure a 18 | /// 19 | public class WebSocketBindingHandlerOptions 20 | : BindingHandlerOptions 21 | { 22 | 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Attributes/ExcludeAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi; 15 | 16 | /// 17 | /// Represents an used to exclude a parameter from the schema of an Async API message 18 | /// 19 | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method, AllowMultiple = false)] 20 | public class ExcludeAttribute 21 | : Attribute 22 | { 23 | 24 | 25 | 26 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.AspNetCore.UI/Pages/Shared/v3/_V3CorrelationId.cshtml: -------------------------------------------------------------------------------- 1 | @model V3CorrelationIdDefinitionViewModel 2 | @{ 3 | var correlationId = this.Model.CorrelationId; 4 | } 5 | 6 |
7 | 8 | @if (!string.IsNullOrWhiteSpace(correlationId.Description)) 9 | { 10 | @Html.Raw(Markdown.ToHtml(correlationId.Description)) 11 | } 12 | 13 | 14 | 15 | 16 | 20 | 23 | 24 | 25 |
17 | Location 18 | 19 | 21 | @correlationId.Location 22 |
26 | 27 |
-------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client/ErrorStatus.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | using System.Net; 15 | 16 | namespace Neuroglia.AsyncApi.Client; 17 | 18 | /// 19 | /// Enumerates all default error statuses 20 | /// 21 | public static class ErrorStatus 22 | { 23 | 24 | /// 25 | /// Gets the status for validation errors 26 | /// 27 | public const int Validation = (int)HttpStatusCode.UnprocessableEntity; 28 | 29 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Usings.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | global using Json.Schema; 15 | global using Neuroglia.AsyncApi.Bindings; 16 | global using Neuroglia.Serialization.Json.Converters; 17 | global using System.ComponentModel; 18 | global using System.ComponentModel.DataAnnotations; 19 | global using System.Runtime.Serialization; 20 | global using System.Text.Json.Serialization; 21 | global using YamlDotNet.Core; 22 | global using YamlDotNet.Serialization; 23 | -------------------------------------------------------------------------------- /samples/StreetLightsApi/Messages/MeasureStreetLightLuminosityReply.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace StreetLightsApi.Messages; 15 | 16 | /// 17 | /// Represents the response to a measure street light luminosity request 18 | /// 19 | public class MeasureStreetLightLuminosityReply 20 | { 21 | 22 | /// 23 | /// Gets/sets the street light's lumens 24 | /// 25 | public required long Lumens { get; init; } 26 | 27 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.AspNetCore.UI/Models/v3/V3AsyncApiDocumentViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.AspNetCore.UI.Models.v3; 15 | 16 | /// 17 | /// Holds the data used to render an view 18 | /// 19 | /// The to render the view for 20 | public record V3AsyncApiDocumentViewModel(V3AsyncApiDocument Document) 21 | { 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/IBindingDefinition.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings; 15 | 16 | /// 17 | /// Defines the fundamentals of an Async API binding 18 | /// 19 | public interface IBindingDefinition 20 | { 21 | 22 | /// 23 | /// Gets an containing the protocols supported by the 24 | /// 25 | IEnumerable Protocols { get; } 26 | 27 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Amqp/Usings.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | global using Microsoft.Extensions.Logging; 15 | global using Microsoft.Extensions.Options; 16 | global using Neuroglia.AsyncApi.Bindings.Amqp; 17 | global using Neuroglia.AsyncApi.Client.Bindings.Amqp; 18 | global using Neuroglia.AsyncApi.Client.Bindings.Amqp.Configuration; 19 | global using Neuroglia.AsyncApi.Client.Configuration; 20 | global using Neuroglia.AsyncApi.Client.Services; 21 | global using Neuroglia.Serialization; 22 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Mqtt/Usings.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | global using Microsoft.Extensions.Logging; 15 | global using Microsoft.Extensions.Options; 16 | global using Neuroglia.AsyncApi.Bindings.Mqtt; 17 | global using Neuroglia.AsyncApi.Client.Bindings.Mqtt; 18 | global using Neuroglia.AsyncApi.Client.Bindings.Mqtt.Configuration; 19 | global using Neuroglia.AsyncApi.Client.Configuration; 20 | global using Neuroglia.AsyncApi.Client.Services; 21 | global using Neuroglia.Serialization; 22 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Nats/Usings.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | global using Microsoft.Extensions.Logging; 15 | global using Microsoft.Extensions.Options; 16 | global using Neuroglia.AsyncApi.Bindings.Nats; 17 | global using Neuroglia.AsyncApi.Client.Bindings.Nats; 18 | global using Neuroglia.AsyncApi.Client.Bindings.Nats.Configuration; 19 | global using Neuroglia.AsyncApi.Client.Configuration; 20 | global using Neuroglia.AsyncApi.Client.Services; 21 | global using Neuroglia.Serialization; 22 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Kafka/Usings.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | global using Microsoft.Extensions.Logging; 15 | global using Microsoft.Extensions.Options; 16 | global using Neuroglia.AsyncApi.Bindings.Kafka; 17 | global using Neuroglia.AsyncApi.Client.Bindings.Kafka; 18 | global using Neuroglia.AsyncApi.Client.Bindings.Kafka.Configuration; 19 | global using Neuroglia.AsyncApi.Client.Configuration; 20 | global using Neuroglia.AsyncApi.Client.Services; 21 | global using Neuroglia.Serialization; 22 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Redis/Usings.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | global using Microsoft.Extensions.Logging; 15 | global using Microsoft.Extensions.Options; 16 | global using Neuroglia.AsyncApi.Bindings.Redis; 17 | global using Neuroglia.AsyncApi.Client.Bindings.Redis; 18 | global using Neuroglia.AsyncApi.Client.Bindings.Redis.Configuration; 19 | global using Neuroglia.AsyncApi.Client.Configuration; 20 | global using Neuroglia.AsyncApi.Client.Services; 21 | global using Neuroglia.Serialization; 22 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Stomp/Usings.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | global using Microsoft.Extensions.Logging; 15 | global using Microsoft.Extensions.Options; 16 | global using Neuroglia.AsyncApi.Bindings.Stomp; 17 | global using Neuroglia.AsyncApi.Client.Bindings.Stomp; 18 | global using Neuroglia.AsyncApi.Client.Bindings.Stomp.Configuration; 19 | global using Neuroglia.AsyncApi.Client.Configuration; 20 | global using Neuroglia.AsyncApi.Client.Services; 21 | global using Neuroglia.Serialization; 22 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Pulsar/Usings.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | global using Microsoft.Extensions.Logging; 15 | global using Microsoft.Extensions.Options; 16 | global using Neuroglia.AsyncApi.Bindings.Pulsar; 17 | global using Neuroglia.AsyncApi.Client.Bindings.Pulsar; 18 | global using Neuroglia.AsyncApi.Client.Bindings.Pulsar.Configuration; 19 | global using Neuroglia.AsyncApi.Client.Configuration; 20 | global using Neuroglia.AsyncApi.Client.Services; 21 | global using Neuroglia.Serialization; 22 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Solace/Usings.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | global using Microsoft.Extensions.Logging; 15 | global using Microsoft.Extensions.Options; 16 | global using Neuroglia.AsyncApi.Bindings.Solace; 17 | global using Neuroglia.AsyncApi.Client.Bindings.Solace; 18 | global using Neuroglia.AsyncApi.Client.Bindings.Solace.Configuration; 19 | global using Neuroglia.AsyncApi.Client.Configuration; 20 | global using Neuroglia.AsyncApi.Client.Services; 21 | global using Neuroglia.Serialization; 22 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.WebSocket/Usings.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | global using Microsoft.Extensions.Logging; 15 | global using Microsoft.Extensions.Options; 16 | global using Neuroglia.AsyncApi.Bindings.WebSockets; 17 | global using Neuroglia.AsyncApi.Client.Bindings.WebSocket; 18 | global using Neuroglia.AsyncApi.Client.Bindings.WebSocket.Configuration; 19 | global using Neuroglia.AsyncApi.Client.Configuration; 20 | global using Neuroglia.AsyncApi.Client.Services; 21 | global using Neuroglia.Serialization; 22 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Validation/v3/V3MessageExampleValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Validation.v3; 15 | 16 | /// 17 | /// Represents the service used to validate s 18 | /// 19 | public class V3MessageExampleValidator 20 | : AbstractValidator 21 | { 22 | 23 | /// 24 | public V3MessageExampleValidator(V3AsyncApiDocument? document = null) 25 | { 26 | 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /samples/StreetLightsApi/Usings.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | global using Json.Schema; 15 | global using MQTTnet; 16 | global using MQTTnet.Client; 17 | global using Neuroglia.AsyncApi; 18 | global using Neuroglia.AsyncApi.Bindings.Http; 19 | global using Neuroglia.Data.Schemas.Json; 20 | global using Neuroglia.Serialization; 21 | global using StreetLightsApi.Messages; 22 | global using System.ComponentModel; 23 | global using System.ComponentModel.DataAnnotations; 24 | global using System.Net.Mime; 25 | global using System.Text; 26 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client/AsyncApiSubscribeOperationResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Client; 15 | 16 | /// 17 | /// Represents the base class for all implementations 18 | /// 19 | public abstract class AsyncApiSubscribeOperationResult 20 | : AsyncApiOperationResult, IAsyncApiSubscribeOperationResult 21 | { 22 | 23 | /// 24 | public abstract IObservable? Messages { get; } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client/IAsyncApiOperationResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Client; 15 | 16 | /// 17 | /// Defines the fundamentals of an object used to describe the result of an AsyncAPI operation 18 | /// 19 | public interface IAsyncApiOperationResult 20 | : IDisposable, IAsyncDisposable 21 | { 22 | 23 | /// 24 | /// Gets a boolean indicating whether or not the operation was successful 25 | /// 26 | bool IsSuccessful { get; } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /samples/StreetLightsApi/Messages/CommonHeaders.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace StreetLightsApi.Messages; 15 | 16 | /// 17 | /// Represents the common headers of messages exchanged by the StreetLights API 18 | /// 19 | public record CommonHeaders 20 | { 21 | 22 | /// 23 | /// Gets/sets the value of the header that the application's ETag 24 | /// 25 | [Json.Schema.Generation.Required, Json.Schema.Generation.MinLength(1)] 26 | public required string ETag { get; init; } 27 | 28 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.AspNetCore/AsyncApiDocumentServingOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi; 15 | 16 | /// 17 | /// Represents the options used to configure how to serve s 18 | /// 19 | public class AsyncApiDocumentServingOptions 20 | { 21 | 22 | /// 23 | /// Gets/sets the path prefix of s 24 | /// 25 | public virtual string PathTemplate { get; set; } = "/asyncapi/{specVersion}/{title}/{version}/doc.[json|yaml]"; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Validation/v3/V3SecuritySchemeValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Validation.v3; 15 | 16 | /// 17 | /// Represents the service used to validate s 18 | /// 19 | public class V3SecuritySchemeValidator 20 | : V3ReferenceableComponentValidator 21 | { 22 | 23 | /// 24 | public V3SecuritySchemeValidator(V3AsyncApiDocument? document = null) 25 | : base(document) 26 | { 27 | 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Validation/v3/V3ServerVariableValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Validation.v3; 15 | 16 | /// 17 | /// Represents the service used to validate s 18 | /// 19 | public class V3ServerVariableValidator 20 | : V3ReferenceableComponentValidator 21 | { 22 | 23 | /// 24 | public V3ServerVariableValidator(V3AsyncApiDocument? document = null) 25 | : base(document) 26 | { 27 | 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Http/Usings.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | global using Microsoft.Extensions.Logging; 15 | global using Microsoft.Extensions.Options; 16 | global using Neuroglia.AsyncApi.Bindings.Http; 17 | global using Neuroglia.AsyncApi.Client.Bindings.Http; 18 | global using Neuroglia.AsyncApi.Client.Bindings.Http.Configuration; 19 | global using Neuroglia.AsyncApi.Client.Configuration; 20 | global using Neuroglia.AsyncApi.Client.Services; 21 | global using Neuroglia.Serialization; 22 | global using System.Net; 23 | global using System.Net.Http.Headers; 24 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Validation/v2/V2TagValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Validation.v2; 15 | 16 | /// 17 | /// Represents the service used to validate the 18 | /// 19 | public class V2TagValidator 20 | : AbstractValidator 21 | { 22 | 23 | /// 24 | /// Initializes a new 25 | /// 26 | public V2TagValidator() 27 | { 28 | this.RuleFor(t => t.Name) 29 | .NotEmpty(); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/SchemaContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi; 15 | 16 | /// 17 | /// Enumerates all schema contexts 18 | /// 19 | public enum SchemaContext 20 | { 21 | /// 22 | /// Indicates that the schema applies to a payload 23 | /// 24 | Payload, 25 | /// 26 | /// Indicates that the schema applies to headers 27 | /// 28 | Headers, 29 | /// 30 | /// Indicates that the schema context is unknown 31 | /// 32 | Unknown 33 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Validation/v2/V2LicenseValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Validation.v2; 15 | 16 | /// 17 | /// Represents the service used to validate the 18 | /// 19 | public class V2LicenseValidator 20 | : AbstractValidator 21 | { 22 | 23 | /// 24 | /// Initializes a new 25 | /// 26 | public V2LicenseValidator() 27 | { 28 | this.RuleFor(l => l.Name) 29 | .NotEmpty(); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client/IAsyncApiSubscribeOperationResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Client; 15 | 16 | /// 17 | /// Defines the fundamentals of an object used to describe the result of an AsyncAPI subscribe operation 18 | /// 19 | public interface IAsyncApiSubscribeOperationResult 20 | : IAsyncApiOperationResult 21 | { 22 | 23 | /// 24 | /// Gets an , if any, used to observe incoming s 25 | /// 26 | IObservable? Messages { get; } 27 | 28 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Validation/v3/V3LicenseValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Validation.v3; 15 | 16 | /// 17 | /// Represents the service used to validate the 18 | /// 19 | public class V3LicenseValidator 20 | : AbstractValidator 21 | { 22 | 23 | /// 24 | /// Initializes a new 25 | /// 26 | public V3LicenseValidator() 27 | { 28 | this.RuleFor(l => l.Name) 29 | .NotEmpty(); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/AsyncApiDocumentFormat.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi; 15 | 16 | /// 17 | /// Enumerates all Async API document formats 18 | /// 19 | [JsonConverter(typeof(StringEnumConverter))] 20 | [TypeConverter(typeof(EnumMemberTypeConverter))] 21 | public enum AsyncApiDocumentFormat 22 | { 23 | /// 24 | /// Indicates YAML 25 | /// 26 | [EnumMember(Value = "yaml")] 27 | Yaml = 1, 28 | /// 29 | /// Indicates JSON 30 | /// 31 | [EnumMember(Value = "json")] 32 | Json = 2 33 | } 34 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.FluentBuilders/Interfaces/IVersionedApiDocumentBuilder.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.FluentBuilders; 15 | 16 | /// 17 | /// Defines the fundamentals of a service used to build an using a specific AsyncAPI specification version 18 | /// 19 | public interface IVersionedApiDocumentBuilder 20 | { 21 | 22 | /// 23 | /// Builds the configured 24 | /// 25 | /// A new 26 | IAsyncApiDocument Build(); 27 | 28 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/v3/V3ReferenceDefinition.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.v3; 15 | 16 | /// 17 | /// Represents a reference to a component 18 | /// 19 | [DataContract] 20 | public record V3ReferenceDefinition 21 | { 22 | 23 | /// 24 | /// Gets/sets the reference string 25 | /// 26 | [Required] 27 | [DataMember(Order = 1, Name = "$ref"), JsonPropertyOrder(1), JsonPropertyName("$ref"), YamlMember(Order = 1, Alias = "$ref", ScalarStyle = ScalarStyle.SingleQuoted)] 28 | public virtual string Reference { get; set; } = null!; 29 | 30 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.AspNetCore.UI/Models/v3/V3ComponentsViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | using Neuroglia.AsyncApi.AspNetCore.UI.Models.v3; 15 | 16 | namespace Neuroglia.AsyncApi.AspNetCore.UI.Models; 17 | 18 | /// 19 | /// Holds the data used to render an view 20 | /// 21 | /// The the to render belongs to 22 | public record V3ComponentsViewModel(V3AsyncApiDocument Document) 23 | : V3AsyncApiDocumentViewModel(Document) 24 | { 25 | 26 | 27 | 28 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Validation/v3/V3SchemaValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Validation.v3; 15 | 16 | /// 17 | /// Represents the service used to validate s 18 | /// 19 | public class V3SchemaValidator 20 | : V3ReferenceableComponentValidator 21 | { 22 | 23 | /// 24 | public V3SchemaValidator(V3AsyncApiDocument? document = null) 25 | : base(document) 26 | { 27 | this.RuleFor(s => s.Schema) 28 | .NotNull() 29 | .When(o => !o.IsReference); 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/AsyncApiSpecVersion.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi; 15 | 16 | /// 17 | /// Exposes all supported Async API spec versions 18 | /// 19 | public static class AsyncApiSpecVersion 20 | { 21 | 22 | /// 23 | /// Gets the latest supported revision of the Async API Specification version 2.x.x 24 | /// 25 | public const string V2 = "2.6.0"; 26 | 27 | /// 28 | /// Gets the latest supported revision of the Async API Specification version 3.x.x 29 | /// 30 | public const string V3 = "3.0.0"; 31 | 32 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/v2/V2OperationType.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.v2; 15 | 16 | /// 17 | /// Enumerates all Async API operation types 18 | /// 19 | [JsonConverter(typeof(StringEnumConverter))] 20 | [TypeConverter(typeof(EnumMemberTypeConverter))] 21 | public enum V2OperationType 22 | { 23 | /// 24 | /// Indicates a PUB operation 25 | /// 26 | [EnumMember(Value = "pub")] 27 | Publish = 1, 28 | /// 29 | /// Indicates a SUB operation 30 | /// 31 | [EnumMember(Value = "sub")] 32 | Subscribe = 2 33 | } 34 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Validation/v3/V3TagValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Validation.v3; 15 | 16 | /// 17 | /// Represents the service used to validate the 18 | /// 19 | public class V3TagValidator 20 | : V3ReferenceableComponentValidator 21 | { 22 | 23 | /// 24 | public V3TagValidator(V3AsyncApiDocument? document = null) 25 | : base(document) 26 | { 27 | this.RuleFor(d => d.Name) 28 | .NotEmpty() 29 | .When(d => string.IsNullOrWhiteSpace(d.Reference)); 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.AspNetCore.UI/Models/v2/V2SchemaViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.AspNetCore.UI.Models.v2; 15 | 16 | /// 17 | /// Holds the data used to render a view 18 | /// 19 | public record V2SchemaViewModel 20 | : V2AsyncApiDocumentViewModel 21 | { 22 | 23 | /// 24 | public V2SchemaViewModel(V2AsyncApiDocument document, JsonSchema schema) : base(document) => Schema = schema; 25 | 26 | /// 27 | /// Gets the to render 28 | /// 29 | public JsonSchema Schema { get; } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Validation/v2/V2MessageTraitValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Validation.v2; 15 | 16 | /// 17 | /// Represents the service used to validate s 18 | /// 19 | public class V2MessageTraitValidator 20 | : AbstractValidator 21 | { 22 | 23 | /// 24 | /// Initializes a new 25 | /// 26 | public V2MessageTraitValidator() 27 | { 28 | this.RuleForEach(m => m.Tags) 29 | .SetValidator(new V2TagValidator()); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.AspNetCore.UI/Models/v3/V3SchemaViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.AspNetCore.UI.Models.v3; 15 | 16 | /// 17 | /// Holds the data used to render a view 18 | /// 19 | public record V3JsonSchemaViewModel 20 | : V3AsyncApiDocumentViewModel 21 | { 22 | 23 | /// 24 | public V3JsonSchemaViewModel(V3AsyncApiDocument document, JsonSchema schema) : base(document) => Schema = schema; 25 | 26 | /// 27 | /// Gets the to render 28 | /// 29 | public JsonSchema Schema { get; } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Amqp/AmqpBindingDefinition.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Amqp; 15 | 16 | /// 17 | /// Represents the base record for all AMQP implementations of the interface 18 | /// 19 | [DataContract] 20 | public abstract record AmqpBindingDefinition 21 | : IBindingDefinition 22 | { 23 | 24 | /// 25 | [IgnoreDataMember, JsonIgnore, YamlIgnore] 26 | public IEnumerable Protocols 27 | { 28 | get 29 | { 30 | yield return AsyncApiProtocol.Amqp; 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Validation/v2/V2ServerValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Validation.v2; 15 | 16 | /// 17 | /// Represents the service used to validate s 18 | /// 19 | public class V2ServerValidator 20 | : AbstractValidator 21 | { 22 | 23 | /// 24 | /// Initializes a new 25 | /// 26 | public V2ServerValidator() 27 | { 28 | this.RuleFor(s => s.Url) 29 | .NotNull(); 30 | this.RuleFor(s => s.Protocol) 31 | .NotEmpty(); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Solace/SolaceDestinationDescriptor.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | using SolaceSystems.Solclient.Messaging; 15 | 16 | namespace Neuroglia.AsyncApi.Client.Bindings.Solace; 17 | 18 | public partial class SolaceBindingHandler 19 | { 20 | /// 21 | /// Represents an object used to describe a Solace destination 22 | /// 23 | /// The definition of the described destination 24 | /// The destination instance 25 | public record SolaceDestinationDescriptor(SolaceDestinationDefinition Definition, IDestination Instance); 26 | 27 | } 28 | 29 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Attributes/ChannelBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi; 15 | 16 | /// 17 | /// Represents the base class for all attributes used to define channel bindings 18 | /// 19 | /// The type of the defined binding 20 | /// The binding's name 21 | /// The binding's version 22 | public abstract class ChannelBindingAttribute(string name, string version) 23 | : BindingAttribute(name, version) 24 | where TBinding : class, IChannelBindingDefinition 25 | { 26 | 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Attributes/MessageBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi; 15 | 16 | /// 17 | /// Represents the base class for all attributes used to define message bindings 18 | /// 19 | /// The type of the defined binding 20 | /// The binding's name 21 | /// The binding's version 22 | public abstract class MessageBindingAttribute(string name, string version) 23 | : BindingAttribute(name, version) 24 | where TBinding : class, IMessageBindingDefinition 25 | { 26 | 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Attributes/ServerBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi; 15 | 16 | /// 17 | /// Represents the base class for all attributes used to define server bindings 18 | /// 19 | /// The type of the defined binding 20 | /// The binding's name 21 | /// The binding's version 22 | public abstract class ServerBindingAttribute(string name, string version) 23 | : BindingAttribute(name, version) 24 | where TBinding : class, IServerBindingDefinition 25 | { 26 | 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/AmqpV1/AmqpV1BindingDefinition.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.AmqpV1; 15 | 16 | /// 17 | /// Represents the base record for all AMQP V1 implementations of the interface 18 | /// 19 | [DataContract] 20 | public abstract record AmqpV1BindingDefinition 21 | : IBindingDefinition 22 | { 23 | 24 | /// 25 | [IgnoreDataMember, JsonIgnore, YamlIgnore] 26 | public IEnumerable Protocols 27 | { 28 | get 29 | { 30 | yield return AsyncApiProtocol.AmqpV1; 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/GooglePubSub/GooglePubSubSchemaDefinition.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.GooglePubSub; 15 | 16 | /// 17 | /// Represents the object used to configure a Google Pub/Sub schema 18 | /// 19 | [DataContract] 20 | public record GooglePubSubSchemaDefinition 21 | { 22 | 23 | /// 24 | /// Gets/sets the name of the schema 25 | /// 26 | [Required] 27 | [DataMember(Order = 1, Name = "name"), JsonPropertyOrder(1), JsonPropertyName("name"), YamlMember(Order = 1, Alias = "name")] 28 | public virtual string Name { get; set; } = null!; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Validation/v2/V2OperationTraitValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Validation.v2; 15 | 16 | /// 17 | /// Represents the service used to validate s 18 | /// 19 | public class V2OperationTraitValidator 20 | : AbstractValidator 21 | { 22 | 23 | /// 24 | /// Initializes a new 25 | /// 26 | public V2OperationTraitValidator() 27 | { 28 | this.RuleForEach(o => o.Tags) 29 | .SetValidator(new V2TagValidator()); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.FluentBuilders/Interfaces/IReferenceableComponentDefinitionBuilder.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.FluentBuilders; 15 | 16 | /// 17 | /// Defines the fundamentals of a service used to build a 18 | /// 19 | public interface IReferenceableComponentDefinitionBuilder 20 | where TComponent : ReferenceableComponentDefinition 21 | { 22 | 23 | /// 24 | /// Uses the specified component 25 | /// 26 | /// The reference of the component to use 27 | void Use(string reference); 28 | 29 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.FluentBuilders/Interfaces/IRuntimeExpressionFragmentBuilder.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.FluentBuilders; 15 | 16 | /// 17 | /// Defines the fundamentals of a service used to build fragments 18 | /// 19 | public interface IRuntimeExpressionFragmentBuilder 20 | { 21 | 22 | /// 23 | /// Configures the source's path referenced by the 's fragment 24 | /// 25 | /// The source's path referenced by the 's fragment 26 | void At(string path); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Attributes/OperationBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi; 15 | 16 | /// 17 | /// Represents the base class for all attributes used to define operation bindings 18 | /// 19 | /// The type of the defined binding 20 | /// The binding's name 21 | /// The binding's version 22 | public abstract class OperationBindingAttribute(string name, string version) 23 | : BindingAttribute(name, version) 24 | where TBinding : class, IOperationBindingDefinition 25 | { 26 | 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /.github/workflows/update-maintainers-trigger.yaml: -------------------------------------------------------------------------------- 1 | # This action is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | name: Trigger MAINTAINERS.yaml file update 5 | 6 | on: 7 | push: 8 | branches: [ master ] 9 | paths: 10 | # Check all valid CODEOWNERS locations: 11 | # https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-file-location 12 | - 'CODEOWNERS' 13 | - '.github/CODEOWNERS' 14 | - '.docs/CODEOWNERS' 15 | 16 | jobs: 17 | trigger-maintainers-update: 18 | name: Trigger updating MAINTAINERS.yaml because of CODEOWNERS change 19 | runs-on: ubuntu-latest 20 | 21 | steps: 22 | - name: Repository Dispatch 23 | uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # https://github.com/peter-evans/repository-dispatch/releases/tag/v3.0.0 24 | with: 25 | # The PAT with the 'public_repo' scope is required 26 | token: ${{ secrets.GH_TOKEN }} 27 | repository: ${{ github.repository_owner }}/community 28 | event-type: trigger-maintainers-update 29 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Amqp/AmqpPublishOperationResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Client.Bindings.Amqp; 15 | 16 | /// 17 | /// Represents an object used to describe the result of a Amqp publish operation 18 | /// 19 | public class AmqpPublishOperationResult 20 | : AsyncApiPublishOperationResult 21 | { 22 | 23 | /// 24 | /// Gets/sets the , if any, that occurred during publishing 25 | /// 26 | public virtual Exception? Exception { get; init; } 27 | 28 | /// 29 | public override bool IsSuccessful => Exception == null; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Nats/NatsPublishOperationResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Client.Bindings.Nats; 15 | 16 | /// 17 | /// Represents an object used to describe the result of a Nats publish operation 18 | /// 19 | public class NatsPublishOperationResult 20 | : AsyncApiPublishOperationResult 21 | { 22 | 23 | /// 24 | /// Gets/sets the , if any, that occurred during publishing 25 | /// 26 | public virtual Exception? Exception { get; init; } 27 | 28 | /// 29 | public override bool IsSuccessful => Exception == null; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Stomp/StompPublishOperationResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Client.Bindings.Stomp; 15 | 16 | /// 17 | /// Represents an object used to describe the result of a Stomp publish operation 18 | /// 19 | public class StompPublishOperationResult 20 | : AsyncApiPublishOperationResult 21 | { 22 | 23 | /// 24 | /// Gets/sets the , if any, that occurred during publishing 25 | /// 26 | public virtual Exception? Exception { get; init; } 27 | 28 | /// 29 | public override bool IsSuccessful => Exception == null; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Amqp/AmqpChannelType.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Amqp; 15 | 16 | /// 17 | /// Enumerates all supported AMQP channel types 18 | /// 19 | [JsonConverter(typeof(StringEnumConverter))] 20 | [TypeConverter(typeof(EnumMemberTypeConverter))] 21 | public enum AmqpChannelType 22 | { 23 | /// 24 | /// Indicates a routing key based AMQP channel 25 | /// 26 | [EnumMember(Value = "routingKey")] 27 | RoutingKey = 1, 28 | /// 29 | /// Indicates a queue based AMQP channel 30 | /// 31 | [EnumMember(Value = "queue")] 32 | Queue = 2 33 | } 34 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.Solace/SolacePublishOperationResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Client.Bindings.Solace; 15 | 16 | /// 17 | /// Represents an object used to describe the result of a Solace publish operation 18 | /// 19 | public class SolacePublishOperationResult 20 | : AsyncApiPublishOperationResult 21 | { 22 | 23 | /// 24 | /// Gets/sets the , if any, that occurred during publishing 25 | /// 26 | public virtual Exception? Exception { get; init; } 27 | 28 | /// 29 | public override bool IsSuccessful => Exception == null; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Http/HttpBindingDefinition.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | using Neuroglia.AsyncApi.Bindings; 15 | 16 | namespace Neuroglia.AsyncApi.Bindings.Http; 17 | 18 | /// 19 | /// Represents the base record for all HTTP implementations of the interface 20 | /// 21 | [DataContract] 22 | public abstract record HttpBindingDefinition 23 | : IBindingDefinition 24 | { 25 | 26 | /// 27 | [IgnoreDataMember, JsonIgnore, YamlIgnore] 28 | public IEnumerable Protocols 29 | { 30 | get 31 | { 32 | yield return AsyncApiProtocol.Http; 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Mqtt/MqttBindingDefinition.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | using Neuroglia.AsyncApi.Bindings; 15 | 16 | namespace Neuroglia.AsyncApi.Bindings.Mqtt; 17 | 18 | /// 19 | /// Represents the base record for all Mqtt implementations of the interface 20 | /// 21 | [DataContract] 22 | public abstract record MqttBindingDefinition 23 | : IBindingDefinition 24 | { 25 | 26 | /// 27 | [IgnoreDataMember, JsonIgnore, YamlIgnore] 28 | public IEnumerable Protocols 29 | { 30 | get 31 | { 32 | yield return AsyncApiProtocol.Mqtt; 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Nats/NatsBindingDefinition.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | using Neuroglia.AsyncApi.Bindings; 15 | 16 | namespace Neuroglia.AsyncApi.Bindings.Nats; 17 | 18 | /// 19 | /// Represents the base record for all NATS implementations of the interface 20 | /// 21 | [DataContract] 22 | public abstract record NatsBindingDefinition 23 | : IBindingDefinition 24 | { 25 | 26 | /// 27 | [IgnoreDataMember, JsonIgnore, YamlIgnore] 28 | public IEnumerable Protocols 29 | { 30 | get 31 | { 32 | yield return AsyncApiProtocol.Nats; 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Solace/SolaceDeliveryMode.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Solace; 15 | 16 | /// 17 | /// Enumerates all supported Solace delivery modes 18 | /// 19 | [JsonConverter(typeof(StringEnumConverter))] 20 | [TypeConverter(typeof(EnumMemberTypeConverter))] 21 | public enum SolaceDeliveryMode 22 | { 23 | /// 24 | /// Indicates the persistent delivery mode 25 | /// 26 | [EnumMember(Value = "persistent")] 27 | Persistent = 0, 28 | /// 29 | /// Indicates a direct delivery mode 30 | /// 31 | [EnumMember(Value = "direct")] 32 | Direct = 1 33 | } 34 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Redis/RedisBindingDefinition.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | using Neuroglia.AsyncApi.Bindings; 15 | 16 | namespace Neuroglia.AsyncApi.Bindings.Redis; 17 | 18 | /// 19 | /// Represents the base record for all REDIS implementations of the interface 20 | /// 21 | [DataContract] 22 | public abstract record RedisBindingDefinition 23 | : IBindingDefinition 24 | { 25 | 26 | /// 27 | [IgnoreDataMember, JsonIgnore, YamlIgnore] 28 | public IEnumerable Protocols 29 | { 30 | get 31 | { 32 | yield return AsyncApiProtocol.Redis; 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Client.Bindings.WebSocket/WebSocketPublishOperationResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Client.Bindings.WebSocket; 15 | 16 | /// 17 | /// Represents an object used to describe the result of a WebSocket publish operation 18 | /// 19 | public class WebSocketPublishOperationResult 20 | : AsyncApiPublishOperationResult 21 | { 22 | 23 | /// 24 | /// Gets/sets the , if any, that occurred during publishing 25 | /// 26 | public virtual Exception? Exception { get; init; } 27 | 28 | /// 29 | public override bool IsSuccessful => Exception == null; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/WebSockets/WsBindingDefinition.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | using Neuroglia.AsyncApi.Bindings; 15 | 16 | namespace Neuroglia.AsyncApi.Bindings.WebSockets; 17 | 18 | /// 19 | /// Represents the base record for all Websocket implementations of the interface 20 | /// 21 | [DataContract] 22 | public abstract record WsBindingDefinition 23 | : IBindingDefinition 24 | { 25 | 26 | /// 27 | [IgnoreDataMember, JsonIgnore, YamlIgnore] 28 | public IEnumerable Protocols 29 | { 30 | get 31 | { 32 | yield return AsyncApiProtocol.Ws; 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/v2/Attributes/AsyncApiAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.v2; 15 | 16 | /// 17 | /// Represents an used to mark a class as an Async Api to generate a new for 18 | /// 19 | /// The 's title 20 | /// The 's version 21 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false)] 22 | public class AsyncApiAttribute(string title, string version) 23 | : AsyncApi.AsyncApiAttribute(title, version) 24 | { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/MqttV5/MqttV5BindingDefinition.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | using Neuroglia.AsyncApi.Bindings; 15 | 16 | namespace Neuroglia.AsyncApi.Bindings.MqttV5; 17 | 18 | /// 19 | /// Represents the base record for all Mqtt V5 implementations of the interface 20 | /// 21 | [DataContract] 22 | public abstract record MqttV5BindingDefinition 23 | : IBindingDefinition 24 | { 25 | 26 | /// 27 | [IgnoreDataMember, JsonIgnore, YamlIgnore] 28 | public IEnumerable Protocols 29 | { 30 | get 31 | { 32 | yield return AsyncApiProtocol.MqttV5; 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Jms/JmsMessageBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Jms; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class JmsMessageBindingAttribute(string name, string version = "latest") 22 | : MessageBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override JmsMessageBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Sns/SnsMessageBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Sns; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class SnsMessageBindingAttribute(string name, string version = "latest") 22 | : MessageBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override SnsMessageBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Sqs/SqsMessageBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Sqs; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class SqsMessageBindingAttribute(string name, string version = "latest") 22 | : MessageBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override SqsMessageBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.AspNetCore.UI/Models/v2/V2ChannelDefinitionViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.AspNetCore.UI.Models.v2; 15 | 16 | /// 17 | /// Holds the data used to render an view 18 | /// 19 | public record V2ChannelDefinitionViewModel 20 | : V2AsyncApiDocumentViewModel 21 | { 22 | 23 | /// 24 | public V2ChannelDefinitionViewModel(V2AsyncApiDocument document, V2ChannelDefinition channel) : base(document) => Channel = channel; 25 | 26 | /// 27 | /// Gets the to render 28 | /// 29 | public V2ChannelDefinition Channel { get; } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Sns/SnsServerBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Sns; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class SnsServerBindingAttribute(string name, string version = "latest") 22 | : ServerBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override SnsServerBindingDefinition Build() => new() 27 | { 28 | BindingVersion = this.Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Sqs/SqsServerBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Sqs; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class SqsServerBindingAttribute(string name, string version = "latest") 22 | : ServerBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override SqsServerBindingDefinition Build() => new() 27 | { 28 | BindingVersion = this.Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /tests/Neuroglia.AsyncApi.UnitTests/Services/ContainerBootstrapper.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | using DotNet.Testcontainers.Containers; 15 | using Microsoft.Extensions.Hosting; 16 | 17 | namespace Neuroglia.AsyncApi.UnitTests.Services; 18 | 19 | public class ContainerBootstrapper(IEnumerable containers) 20 | : IHostedService 21 | { 22 | 23 | protected IEnumerable Containers { get; } = containers; 24 | 25 | public async Task StartAsync(CancellationToken cancellationToken) 26 | { 27 | await Task.WhenAll(this.Containers.Select(c => c.StartAsync(cancellationToken))); 28 | } 29 | 30 | public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Amqp/AmqpServerBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Amqp; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The channel's version 21 | public class AmqpServerBindingAttribute(string name, string version = "latest") 22 | : ServerBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override AmqpServerBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Http/HttpMessageBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Http; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class HttpMessageBindingAttribute(string name, string version = "latest") 22 | : MessageBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override HttpMessageBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Http/HttpServerBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Http; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class HttpServerBindingAttribute(string name, string version = "latest") 22 | : ServerBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override HttpServerBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Nats/NatsMessageBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Nats; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class NatsMessageBindingAttribute(string name, string version = "latest") 22 | : MessageBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override NatsMessageBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/WebSockets/WsMessageBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.WebSockets; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class WsMessageBindingAttribute(string name, string version = "latest") 22 | : MessageBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override WsMessageBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Validation/v2/V2MessageValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Validation.v2; 15 | 16 | /// 17 | /// Represents the service used to validate s 18 | /// 19 | public class V2MessageValidator 20 | : AbstractValidator 21 | { 22 | 23 | /// 24 | /// Initializes a new 25 | /// 26 | public V2MessageValidator() 27 | { 28 | this.RuleForEach(m => m.Tags) 29 | .SetValidator(new V2TagValidator()); 30 | this.RuleForEach(m => m.Traits) 31 | .SetValidator(new V2MessageTraitValidator()); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Validation/v3/V3ExternalDocumentationValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Validation.v3; 15 | 16 | /// 17 | /// Represents the service used to validate the 18 | /// 19 | public class V3ExternalDocumentationValidator 20 | : V3ReferenceableComponentValidator 21 | { 22 | 23 | /// 24 | public V3ExternalDocumentationValidator(V3AsyncApiDocument? document = null) 25 | : base(document) 26 | { 27 | this.RuleFor(d => d.Url) 28 | .NotNull() 29 | .When(d => string.IsNullOrWhiteSpace(d.Reference)); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Http/HttpChannelBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Http; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class HttpChannelBindingAttribute(string name, string version = "latest") 22 | : ChannelBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override HttpChannelBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/IbmMQ/IbmMQDestinationType.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | using Neuroglia.Serialization.Json.Converters; 15 | using System.ComponentModel; 16 | 17 | namespace Neuroglia.AsyncApi.Bindings.IbmMQ; 18 | 19 | /// 20 | /// Enumerates all IBMMQ destination types 21 | /// 22 | [JsonConverter(typeof(StringEnumConverter))] 23 | [TypeConverter(typeof(EnumMemberTypeConverter))] 24 | public enum IbmMQDestinationType 25 | { 26 | /// 27 | /// Indicates a queue 28 | /// 29 | [EnumMember(Value = "queue")] 30 | Queue = 0, 31 | /// 32 | /// Indicates a topic 33 | /// 34 | [EnumMember(Value = "topic")] 35 | Topic = 1 36 | } 37 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Jms/JmsOperationBindingDefinition.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Jms; 15 | 16 | /// 17 | /// Represents the object used to configure a JMS operation binding 18 | /// 19 | [DataContract] 20 | public record JmsOperationBindingDefinition 21 | : JmsBindingDefinition, IOperationBindingDefinition 22 | { 23 | 24 | /// 25 | /// Gets/sets the version of this binding. 26 | /// 27 | [DataMember(Order = 1, Name = "bindingVersion"), JsonPropertyOrder(1), JsonPropertyName("bindingVersion"), YamlMember(Order = 1, Alias = "bindingVersion")] 28 | public virtual string BindingVersion { get; set; } = "latest"; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Mqtt/MqttChannelBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Mqtt; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class MqttChannelBindingAttribute(string name, string version = "latest") 22 | : ChannelBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override MqttChannelBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Nats/NatsChannelBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Nats; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class NatsChannelBindingAttribute(string name, string version = "latest") 22 | : ChannelBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override NatsChannelBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Nats/NatsServerBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Nats; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class NatsServerBindingAttribute(string name, string version = "latest") 22 | : ServerBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override NatsServerBindingDefinition Build() => new() 27 | { 28 | BindingVersion = this.Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Redis/RedisMessageBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Redis; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class RedisMessageBindingAttribute(string name, string version = "latest") 22 | : MessageBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override RedisMessageBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Stomp/StompMessageBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Stomp; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class StompMessageBindingAttribute(string name, string version = "latest") 22 | : MessageBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override StompMessageBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/WebSockets/WsServerBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.WebSockets; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class WsServerBindingAttribute(string name, string version = "latest") 22 | : ServerBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override WsServerBindingDefinition Build() => new() 27 | { 28 | BindingVersion = this.Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/v3/V3OperationAction.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.v3; 15 | 16 | /// 17 | /// Enumerates all Async API operation actions 18 | /// 19 | [JsonConverter(typeof(StringEnumConverter))] 20 | [TypeConverter(typeof(EnumMemberTypeConverter))] 21 | public enum V3OperationAction 22 | { 23 | /// 24 | /// Indicates that the application will send a message to the given channel 25 | /// 26 | [EnumMember(Value = "send")] 27 | Send = 1, 28 | /// 29 | /// Indicates that the application should expect receiving messages from the given channel 30 | /// 31 | [EnumMember(Value = "receive")] 32 | Receive = 2 33 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Validation/v2/V2ChannelValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Validation.v2; 15 | 16 | /// 17 | /// Represents the service used to validate s 18 | /// 19 | public class V2ChannelValidator 20 | : AbstractValidator 21 | { 22 | 23 | /// 24 | /// Initializes a new 25 | /// 26 | public V2ChannelValidator() 27 | { 28 | this.RuleFor(c => c.Subscribe!) 29 | .SetValidator(new V2OperationValidator()); 30 | this.RuleFor(c => c.Publish!) 31 | .SetValidator(new V2OperationValidator()); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml: -------------------------------------------------------------------------------- 1 | # This workflow is centrally managed in https://github.com/asyncapi/.github/ 2 | # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo 3 | 4 | # Defence from evil contributor that after adding `ready-to-merge` all suddenly makes evil commit or evil change in PR title 5 | # Label is removed once above action is detected 6 | name: Remove ready-to-merge label 7 | 8 | on: 9 | pull_request_target: 10 | types: 11 | - synchronize 12 | - edited 13 | 14 | jobs: 15 | remove-ready-label: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - name: Remove label 19 | uses: actions/github-script@v7 20 | with: 21 | github-token: ${{ secrets.GH_TOKEN }} 22 | script: | 23 | const labelToRemove = 'ready-to-merge'; 24 | const labels = context.payload.pull_request.labels; 25 | const isLabelPresent = labels.some(label => label.name === labelToRemove) 26 | if(!isLabelPresent) return; 27 | github.rest.issues.removeLabel({ 28 | issue_number: context.issue.number, 29 | owner: context.repo.owner, 30 | repo: context.repo.repo, 31 | name: labelToRemove 32 | }) 33 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Kafka/KafkaChannelBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Kafka; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class KafkaChannelBindingAttribute(string name, string version = "latest") 22 | : ChannelBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override KafkaChannelBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Kafka/KafkaMessageBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Kafka; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class KafkaMessageBindingAttribute(string name, string version = "latest") 22 | : MessageBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override KafkaMessageBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Kafka/KafkaServerBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Kafka; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class KafkaServerBindingAttribute(string name, string version = "latest") 22 | : ServerBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override KafkaServerBindingDefinition Build() => new() 27 | { 28 | BindingVersion = this.Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/MqttV5/MqttV5MessageBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.MqttV5; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class MqttV5MessageBindingAttribute(string name, string version = "latest") 22 | : MessageBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override MqttV5MessageBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Redis/RedisChannelBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Redis; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class RedisChannelBindingAttribute(string name, string version = "latest") 22 | : ChannelBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override RedisChannelBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Redis/RedisServerBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Redis; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class RedisServerBindingAttribute(string name, string version = "latest") 22 | : ServerBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override RedisServerBindingDefinition Build() => new() 27 | { 28 | BindingVersion = this.Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Solace/SolaceMessageBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Solace; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class SolaceMessageBindingAttribute(string name, string version = "latest") 22 | : MessageBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override SolaceMessageBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Stomp/StompChannelBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Stomp; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class StompChannelBindingAttribute(string name, string version = "latest") 22 | : ChannelBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override StompChannelBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Stomp/StompServerBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Stomp; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class StompServerBindingAttribute(string name, string version = "latest") 22 | : ServerBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override StompServerBindingDefinition Build() => new() 27 | { 28 | BindingVersion = this.Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/AmqpV1/AmqpV1ServerBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.AmqpV1; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class AmqpV1ServerBindingAttribute(string name, string version = "latest") 22 | : ServerBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override AmqpV1ServerBindingDefinition Build() => new() 27 | { 28 | BindingVersion = this.Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Jms/JmsOperationBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Jms; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class JmsOperationBindingAttribute(string name, string version = "latest") 22 | : OperationBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override JmsOperationBindingDefinition Build() => new() 27 | { 28 | BindingVersion = this.Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/MqttV5/MqttV5ServerBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.MqttV5; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class MqttV5ServerBindingAttribute(string name, string version = "latest") 22 | : ServerBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override MqttV5ServerBindingDefinition Build() => new() 27 | { 28 | BindingVersion = this.Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Sns/SnsMessageBindingDefinition.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Sns; 15 | 16 | /// 17 | /// Represents the object used to configure a SNS message binding 18 | /// 19 | [DataContract] 20 | public record SnsMessageBindingDefinition 21 | : SnsBindingDefinition, IMessageBindingDefinition 22 | { 23 | 24 | /// 25 | /// Gets/sets the version of this binding. Defaults to 'latest'. 26 | /// 27 | [DataMember(Order = 1, Name = "bindingVersion"), JsonPropertyOrder(1), JsonPropertyName("bindingVersion"), YamlMember(Order = 1, Alias = "bindingVersion")] 28 | public virtual string BindingVersion { get; set; } = "latest"; 29 | 30 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Sns/SnsServerBindingDefinition.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Sns; 15 | 16 | /// 17 | /// Represents the object used to configure a SNS server binding 18 | /// 19 | [DataContract] 20 | public record SnsServerBindingDefinition 21 | : SnsBindingDefinition, IServerBindingDefinition 22 | { 23 | 24 | /// 25 | /// Gets/sets the version of this binding. Defaults to 'latest'. 26 | /// 27 | [DataMember(Order = 1, Name = "bindingVersion"), JsonPropertyOrder(1), JsonPropertyName("bindingVersion"), YamlMember(Order = 1, Alias = "bindingVersion")] 28 | public virtual string BindingVersion { get; set; } = "latest"; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Sqs/SqsMessageBindingDefinition.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Sqs; 15 | 16 | /// 17 | /// Represents the object used to configure a SQS message binding 18 | /// 19 | [DataContract] 20 | public record SqsMessageBindingDefinition 21 | : SqsBindingDefinition, IMessageBindingDefinition 22 | { 23 | 24 | /// 25 | /// Gets/sets the version of this binding. Defaults to 'latest'. 26 | /// 27 | [DataMember(Order = 1, Name = "bindingVersion"), JsonPropertyOrder(1), JsonPropertyName("bindingVersion"), YamlMember(Order = 1, Alias = "bindingVersion")] 28 | public virtual string BindingVersion { get; set; } = "latest"; 29 | 30 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Sqs/SqsOperationBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Sqs; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class SqsOperationBindingAttribute(string name, string version = "latest") 22 | : OperationBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override SqsOperationBindingDefinition Build() => new() 27 | { 28 | BindingVersion = this.Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Sqs/SqsServerBindingDefinition.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Sqs; 15 | 16 | /// 17 | /// Represents the object used to configure a SQS server binding 18 | /// 19 | [DataContract] 20 | public record SqsServerBindingDefinition 21 | : SqsBindingDefinition, IServerBindingDefinition 22 | { 23 | 24 | /// 25 | /// Gets/sets the version of this binding. Defaults to 'latest'. 26 | /// 27 | [DataMember(Order = 1, Name = "bindingVersion"), JsonPropertyOrder(1), JsonPropertyName("bindingVersion"), YamlMember(Order = 1, Alias = "bindingVersion")] 28 | public virtual string BindingVersion { get; set; } = "latest"; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Attributes/IBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi; 15 | 16 | /// 17 | /// Represents the base class for all attributes used to define bindings 18 | /// 19 | public interface IBindingAttribute 20 | { 21 | 22 | /// 23 | /// Gets the binding's name 24 | /// 25 | string Name { get; } 26 | 27 | /// 28 | /// Gets the binding's name 29 | /// 30 | string Version { get; } 31 | 32 | /// 33 | /// Builds the configured 34 | /// 35 | /// A new 36 | IBindingDefinition Build(); 37 | 38 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/AmqpV1/AmqpV1MessageBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.AmqpV1; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class AmqpV1MessageBindingAttribute(string name, string version = "latest") 22 | : MessageBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override AmqpV1MessageBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/IbmMQ/IbmMQOperationBindingDefinition.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.IbmMQ; 15 | 16 | /// 17 | /// Represents the object used to configure an IBMMQ operation binding 18 | /// 19 | [DataContract] 20 | public record IbmMQOperationBindingDefinition 21 | : IbmMQBindingDefinition, IOperationBindingDefinition 22 | { 23 | 24 | /// 25 | /// Gets/sets the version of this binding. 26 | /// 27 | [DataMember(Order = 1, Name = "bindingVersion"), JsonPropertyOrder(1), JsonPropertyName("bindingVersion"), YamlMember(Order = 1, Alias = "bindingVersion")] 28 | public virtual string? BindingVersion { get; set; } = "latest"; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Mercure/MercureMessageBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Mercure; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class MercureMessageBindingAttribute(string name, string version = "latest") 22 | : MessageBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override MercureMessageBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/MqttV5/MqttV5ChannelBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.MqttV5; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class MqttV5ChannelBindingAttribute(string name, string version = "latest") 22 | : ChannelBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override MqttV5ChannelBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Pulsar/PulsarMessageBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Pulsar; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class PulsarMessageBindingAttribute(string name, string version = "latest") 22 | : MessageBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override PulsarMessageBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Solace/SolaceChannelBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Solace; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class SolaceChannelBindingAttribute(string name, string version = "latest") 22 | : ChannelBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override SolaceChannelBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Validation/v2/V2ApiInfoValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Validation.v2; 15 | 16 | /// 17 | /// Represents the service used to validate the 18 | /// 19 | public class V2ApiInfoValidator 20 | : AbstractValidator 21 | { 22 | 23 | /// 24 | /// Initializes a new 25 | /// 26 | public V2ApiInfoValidator() 27 | { 28 | this.RuleFor(i => i.Title) 29 | .NotEmpty(); 30 | this.RuleFor(i => i.Version) 31 | .NotEmpty(); 32 | this.RuleFor(i => i.License!) 33 | .SetValidator(new V2LicenseValidator()); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Validation/v3/V3MessageBindingCollectionValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | using Neuroglia.AsyncApi.Bindings; 15 | 16 | namespace Neuroglia.AsyncApi.Validation.v3; 17 | 18 | /// 19 | /// Represents the service used to validate s 20 | /// 21 | public class V3MessageBindingCollectionValidator 22 | : V3ReferenceableComponentValidator 23 | { 24 | 25 | /// 26 | public V3MessageBindingCollectionValidator(V3AsyncApiDocument? document = null) 27 | : base(document) 28 | { 29 | this.RuleFor(c => c) 30 | .NotEmpty() 31 | .When(c => !c.IsReference); 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Http/HttpServerBindingDefinition.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Http; 15 | 16 | /// 17 | /// Represents the object used to configure an http server binding 18 | /// 19 | [DataContract] 20 | public record HttpServerBindingDefinition 21 | : HttpBindingDefinition, IServerBindingDefinition 22 | { 23 | 24 | /// 25 | /// Gets/sets the version of this binding. Defaults to 'latest'. 26 | /// 27 | [DataMember(Order = 1, Name = "bindingVersion"), JsonPropertyOrder(1), JsonPropertyName("bindingVersion"), YamlMember(Order = 1, Alias = "bindingVersion")] 28 | public virtual string BindingVersion { get; set; } = "latest"; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Mercure/MercureChannelBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Mercure; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class MercureChannelBindingAttribute(string name, string version = "latest") 22 | : ChannelBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override MercureChannelBindingDefinition Build() => new() 27 | { 28 | BindingVersion = Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Mercure/MercureServerBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Mercure; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class MercureServerBindingAttribute(string name, string version = "latest") 22 | : ServerBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override MercureServerBindingDefinition Build() => new() 27 | { 28 | BindingVersion = this.Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Sns/SnsTopicOrderingType.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | using Neuroglia.Serialization.Json.Converters; 15 | using System.ComponentModel; 16 | 17 | namespace Neuroglia.AsyncApi.Bindings.Sns; 18 | 19 | /// 20 | /// Enumerates all supported SNS topic ordering types 21 | /// 22 | [JsonConverter(typeof(StringEnumConverter))] 23 | [TypeConverter(typeof(EnumMemberTypeConverter))] 24 | public enum SnsTopicOrderingType 25 | { 26 | /// 27 | /// Indicates a standard SNS topic 28 | /// 29 | [EnumMember(Value = "standard")] 30 | Standard, 31 | /// 32 | /// Indicates a FIFO SNS topic 33 | /// 34 | [EnumMember(Value = "FIFO")] 35 | Fifo 36 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/WebSockets/WsOperationBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.WebSockets; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class WsOperationBindingAttribute(string name, string version = "latest") 22 | : OperationBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override WsOperationBindingDefinition Build() => new() 27 | { 28 | BindingVersion = this.Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Validation/v3/V3ChannelBindingCollectionValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | using Neuroglia.AsyncApi.Bindings; 15 | 16 | namespace Neuroglia.AsyncApi.Validation.v3; 17 | 18 | /// 19 | /// Represents the service used to validate s 20 | /// 21 | public class V3ChannelBindingCollectionValidator 22 | : V3ReferenceableComponentValidator 23 | { 24 | 25 | /// 26 | public V3ChannelBindingCollectionValidator(V3AsyncApiDocument? document = null) 27 | : base(document) 28 | { 29 | this.RuleFor(c => c) 30 | .NotEmpty() 31 | .When(c => !c.IsReference); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Validation/v3/V3ServerBindingCollectionValidator.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | using Neuroglia.AsyncApi.Bindings; 15 | 16 | namespace Neuroglia.AsyncApi.Validation.v3; 17 | 18 | /// 19 | /// Represents the service used to validate s 20 | /// 21 | public class V3ServerBindingCollectionValidator 22 | : V3ReferenceableComponentValidator 23 | { 24 | 25 | /// 26 | public V3ServerBindingCollectionValidator(V3AsyncApiDocument? document = null) 27 | : base(document) 28 | { 29 | this.RuleFor(c => c) 30 | .NotEmpty() 31 | .When(c => !c.IsReference); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.AspNetCore.UI/Models/v3/V3TagDefinitionViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.AspNetCore.UI.Models.v3; 15 | 16 | /// 17 | /// Holds the data used to render an view 18 | /// 19 | /// The that defines the to render 20 | /// The name of the to render 21 | /// The to render 22 | public record V3TagDefinitionViewModel(V3AsyncApiDocument Document, string Name, V3TagDefinition Definition) 23 | : V3AsyncApiDocumentViewModel(Document) 24 | { 25 | 26 | 27 | 28 | } -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Amqp/AmqpServerBindingDefinition.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Amqp; 15 | 16 | /// 17 | /// Represents the object used to configure an AMQP 0.9+ server binding 18 | /// 19 | [DataContract] 20 | public record AmqpServerBindingDefinition 21 | : AmqpBindingDefinition, IServerBindingDefinition 22 | { 23 | 24 | /// 25 | /// Gets/sets the version of this binding. Defaults to 'latest'. 26 | /// 27 | [DataMember(Order = 1, Name = "bindingVersion"), JsonPropertyOrder(1), JsonPropertyName("bindingVersion"), YamlMember(Order = 1, Alias = "bindingVersion")] 28 | public virtual string BindingVersion { get; set; } = "latest"; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Http/HttpChannelBindingDefinition.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Http; 15 | 16 | /// 17 | /// Represents the object used to configure an http channel binding 18 | /// 19 | [DataContract] 20 | public record HttpChannelBindingDefinition 21 | : HttpBindingDefinition, IChannelBindingDefinition 22 | { 23 | 24 | /// 25 | /// Gets/sets the version of this binding. Defaults to 'latest'. 26 | /// 27 | [DataMember(Order = 1, Name = "bindingVersion"), JsonPropertyOrder(1), JsonPropertyName("bindingVersion"), YamlMember(Order = 1, Alias = "bindingVersion")] 28 | public virtual string BindingVersion { get; set; } = "latest"; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/IbmMQ/IbmMQOperationBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.IbmMQ; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class IbmMQOperationBindingAttribute(string name, string version = "latest") 22 | : OperationBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override IbmMQOperationBindingDefinition Build() => new() 27 | { 28 | BindingVersion = this.Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Kafka/KafkaOperationBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Kafka; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class KafkaOperationBindingAttribute(string name, string version = "latest") 22 | : OperationBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override KafkaOperationBindingDefinition Build() => new() 27 | { 28 | BindingVersion = this.Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Mqtt/MqttChannelBindingDefinition.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Mqtt; 15 | 16 | /// 17 | /// Represents the object used to configure an MQTT channel binding 18 | /// 19 | [DataContract] 20 | public record MqttChannelBindingDefinition 21 | : MqttBindingDefinition, IChannelBindingDefinition 22 | { 23 | 24 | /// 25 | /// Gets/sets the version of this binding. Defaults to 'latest'. 26 | /// 27 | [DataMember(Order = 1, Name = "bindingVersion"), JsonPropertyOrder(1), JsonPropertyName("bindingVersion"), YamlMember(Order = 1, Alias = "bindingVersion")] 28 | public virtual string BindingVersion { get; set; } = "latest"; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Redis/RedisOperationBindingAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Redis; 15 | 16 | /// 17 | /// Represents the attribute used to define an 18 | /// 19 | /// The binding's name 20 | /// The binding's version 21 | public class RedisOperationBindingAttribute(string name, string version = "latest") 22 | : OperationBindingAttribute(name, version) 23 | { 24 | 25 | /// 26 | public override RedisOperationBindingDefinition Build() => new() 27 | { 28 | BindingVersion = this.Version 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/Neuroglia.AsyncApi.Core/Bindings/Solace/SolaceMessageBindingDefinition.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2021-Present Neuroglia SRL. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"), 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | namespace Neuroglia.AsyncApi.Bindings.Solace; 15 | 16 | /// 17 | /// Represents the object used to configure a JMS message binding 18 | /// 19 | [DataContract] 20 | public record SolaceMessageBindingDefinition 21 | : SolaceBindingDefinition, IMessageBindingDefinition 22 | { 23 | 24 | /// 25 | /// Gets/sets the version of this binding. Defaults to 'latest'. 26 | /// 27 | [DataMember(Order = 1, Name = "bindingVersion"), JsonPropertyOrder(1), JsonPropertyName("bindingVersion"), YamlMember(Order = 1, Alias = "bindingVersion")] 28 | public virtual string BindingVersion { get; set; } = "latest"; 29 | 30 | } --------------------------------------------------------------------------------