dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts@v1.0.2/dtos/responses/intervalaction.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 // IntervalActionResponse defines the Response Content for GET IntervalAction DTOs. 14 type IntervalActionResponse struct { 15 common.BaseResponse `json:",inline"` 16 Action dtos.IntervalAction `json:"action"` 17 } 18 19 func NewIntervalActionResponse(requestId string, message string, statusCode int, action dtos.IntervalAction) IntervalActionResponse { 20 return IntervalActionResponse{ 21 BaseResponse: common.NewBaseResponse(requestId, message, statusCode), 22 Action: action, 23 } 24 } 25 26 // MultiIntervalActionsResponse defines the Response Content for GET multiple IntervalAction DTOs. 27 type MultiIntervalActionsResponse struct { 28 common.BaseWithTotalCountResponse `json:",inline"` 29 Actions []dtos.IntervalAction `json:"actions"` 30 } 31 32 func NewMultiIntervalActionsResponse(requestId string, message string, statusCode int, totalCount uint32, actions []dtos.IntervalAction) MultiIntervalActionsResponse { 33 return MultiIntervalActionsResponse{ 34 BaseWithTotalCountResponse: common.NewBaseWithTotalCountResponse(requestId, message, statusCode, totalCount), 35 Actions: actions, 36 } 37 }