dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts@v1.0.2/dtos/responses/link.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 // DeviceResponse defines the Response Content for GET Device DTOs. 14 // This object and its properties correspond to the DeviceResponse object in the APIv2 specification: 15 // https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.1.0#/DeviceResponse 16 type LinkResponse struct { 17 common.BaseResponse `json:",inline"` 18 Link dtos.Link `json:"link"` 19 } 20 21 func NewLinkResponse(requestId string, message string, statusCode int, pkg dtos.Link) LinkResponse { 22 return LinkResponse{ 23 BaseResponse: common.NewBaseResponse(requestId, message, statusCode), 24 Link: pkg, 25 } 26 } 27 28 // MultiDevicesResponse defines the Response Content for GET multiple Device DTOs. 29 // This object and its properties correspond to the MultiDevicesResponse object in the APIv2 specification: 30 // https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/2.1.0#/MultiDevicesResponse 31 type MultiLinksResponse struct { 32 common.BaseWithTotalCountResponse `json:",inline"` 33 Links []dtos.Link `json:"links"` 34 } 35 36 func NewMultiLinkResponse(requestId string, message string, statusCode int, totalCount uint32, links []dtos.Link) MultiLinksResponse { 37 return MultiLinksResponse{ 38 BaseWithTotalCountResponse: common.NewBaseWithTotalCountResponse(requestId, message, statusCode, totalCount), 39 Links: links, 40 } 41 }