/* Code generated by Azure.Iot.Operations.ProtocolCompilerLib v0.10.0.0; DO NOT EDIT. */

#nullable enable

namespace TestEnvoys.Math
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Xml;
    using Azure.Iot.Operations.Protocol;
    using Azure.Iot.Operations.Protocol.RPC;
    using Azure.Iot.Operations.Protocol.Models;
    using TestEnvoys;

    public static partial class Math
    {
        /// <summary>
        /// Specializes a <c>CommandExecutor</c> class for Command 'isPrime'.
        /// </summary>
        [CommandBehavior(idempotent: true, cacheTtl: "PT10M")]
        public class IsPrimeCommandExecutor : CommandExecutor<IsPrimeRequestPayload, IsPrimeResponsePayload>
        {
            /// <summary>
            /// Initializes a new instance of the <see cref="IsPrimeCommandExecutor"/> class.
            /// </summary>
            public IsPrimeCommandExecutor(ApplicationContext applicationContext, IMqttPubSubClient mqttClient)
                : base(applicationContext, mqttClient, "isPrime", new ProtobufSerializer<IsPrimeRequestPayload, IsPrimeResponsePayload>())
            {
                TopicTokenMap["modelId"] = "dtmi:rpc:samples:math;1";
                if (mqttClient.ClientId != null)
                {
                    TopicTokenMap["executorId"] = mqttClient.ClientId;
                }
                TopicTokenMap["commandName"] = "isPrime";
            }
        }
    }
}
