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