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

     1  //
     2  // Copyright (C) 2020 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  // DeviceHistoryResponse defines the Response Content for GET DeviceHistory DTOs.
    14  // This object and its properties correspond to the DeviceHistoryResponse object in the APIv2 specification:
    15  // https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.1.0#/DeviceHistoryResponse
    16  type DeviceHistoryResponse struct {
    17  	common.BaseResponse `json:",inline"`
    18  	DeviceHistory       dtos.DeviceHistory `json:"deviceHistory"`
    19  }
    20  
    21  func NewDeviceHistoryResponse(requestId string, message string, statusCode int, deviceHistory dtos.DeviceHistory) DeviceHistoryResponse {
    22  	return DeviceHistoryResponse{
    23  		BaseResponse:  common.NewBaseResponse(requestId, message, statusCode),
    24  		DeviceHistory: deviceHistory,
    25  	}
    26  }
    27  
    28  // MultiDevicesHistoryResponse defines the Response Content for GET multiple DeviceHistory DTOs.
    29  // This object and its properties correspond to the MultiDevicesHistoryResponse object in the APIv2 specification:
    30  // https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.1.0#/MultiDevicesHistoryResponse
    31  type MultiDevicesHistoryResponse struct {
    32  	common.BaseWithTotalCountResponse `json:",inline"`
    33  	DevicesHistory                    []dtos.DeviceHistory `json:"devicesHistory"`
    34  }
    35  
    36  func NewMultiDevicesHistoryResponse(requestId string, message string, statusCode int, totalCount uint32, devicesHistory []dtos.DeviceHistory) MultiDevicesHistoryResponse {
    37  	return MultiDevicesHistoryResponse{
    38  		BaseWithTotalCountResponse: common.NewBaseWithTotalCountResponse(requestId, message, statusCode, totalCount),
    39  		DevicesHistory:             devicesHistory,
    40  	}
    41  }