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