dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts@v1.0.2/dtos/responses/corecommand.go (about)

     1  //
     2  // Copyright (C) 2021 IOTech Ltd
     3  //
     4  // SPDX-License-Identifier: Apache-2.0
     5  
     6  package responses
     7  
     8  import (
     9  	"dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts/dtos"
    10  	"dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts/dtos/common"
    11  )
    12  
    13  // DeviceCoreCommandResponse defines the Response Content for GET DeviceCoreCommand DTO.
    14  type DeviceCoreCommandResponse struct {
    15  	common.BaseResponse `json:",inline"`
    16  	DeviceCoreCommand   dtos.DeviceCoreCommand `json:"deviceCoreCommand"`
    17  }
    18  
    19  func NewDeviceCoreCommandResponse(requestId string, message string, statusCode int, deviceCoreCommand dtos.DeviceCoreCommand) DeviceCoreCommandResponse {
    20  	return DeviceCoreCommandResponse{
    21  		BaseResponse:      common.NewBaseResponse(requestId, message, statusCode),
    22  		DeviceCoreCommand: deviceCoreCommand,
    23  	}
    24  }
    25  
    26  // MultiDeviceCoreCommandsResponse defines the Response Content for GET multiple DeviceCoreCommand DTOs.
    27  type MultiDeviceCoreCommandsResponse struct {
    28  	common.BaseWithTotalCountResponse `json:",inline"`
    29  	DeviceCoreCommands                []dtos.DeviceCoreCommand `json:"deviceCoreCommands"`
    30  }
    31  
    32  func NewMultiDeviceCoreCommandsResponse(requestId string, message string, statusCode int, totalCount uint32, commands []dtos.DeviceCoreCommand) MultiDeviceCoreCommandsResponse {
    33  	return MultiDeviceCoreCommandsResponse{
    34  		BaseWithTotalCountResponse: common.NewBaseWithTotalCountResponse(requestId, message, statusCode, totalCount),
    35  		DeviceCoreCommands:         commands,
    36  	}
    37  }