dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts@v1.0.2/dtos/responses/application.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 ApplicationResponse struct { 17 common.BaseResponse `json:",inline"` 18 Application dtos.Application `json:"application"` 19 } 20 21 func NewApplicationResponse(requestId string, message string, statusCode int, pkg dtos.Application) ApplicationResponse { 22 return ApplicationResponse{ 23 BaseResponse: common.NewBaseResponse(requestId, message, statusCode), 24 Application: 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 MultiApplicationsResponse struct { 32 common.BaseWithTotalCountResponse `json:",inline"` 33 Applications []dtos.Application `json:"applications"` 34 } 35 36 func NewMultiApplicationResponse(requestId string, message string, statusCode int, totalCount uint32, applications []dtos.Application) MultiApplicationsResponse { 37 return MultiApplicationsResponse{ 38 BaseWithTotalCountResponse: common.NewBaseWithTotalCountResponse(requestId, message, statusCode, totalCount), 39 Applications: applications, 40 } 41 }