/* Code generated by Azure.Iot.Operations.ProtocolCompilerLib v1.0.0.0; DO NOT EDIT. */

#nullable enable

using System;
using System.Collections.Generic;
using Azure.Iot.Operations.Protocol;
using Azure.Iot.Operations.Protocol.RPC;
using Azure.Iot.Operations.Protocol.Models;
using Azure.Iot.Operations.Services.StateStore.Generated.Common;

namespace Azure.Iot.Operations.Services.StateStore.Generated
{
    public static partial class StateStore
    {
        /// <summary>
        /// Specializes the <c>CommandInvoker</c> class for Command 'invoke'.
        /// </summary>
        [CommandTopic("statestore/v1/FA9AE35F-2F64-47CD-9BFF-08E2B32A0FE8/command/invoke")]
        public class InvokeCommandInvoker : CommandInvoker<byte[], byte[]>
        {
            /// <summary>
            /// Initializes a new instance of the <see cref="InvokeCommandInvoker"/> class.
            /// </summary>
            public InvokeCommandInvoker(ApplicationContext applicationContext, IMqttPubSubClient mqttClient)
                : base(applicationContext, mqttClient, "invoke", new PassthroughSerializer())
            {
                this.ResponseTopicPrefix = "clients/{invokerClientId}"; // default value, can be overwritten by user code

                if (mqttClient.ClientId != null)
                {
                    TopicTokenMap["invokerClientId"] = mqttClient.ClientId;
                }
            }
        }
    }
}
