package response

type paginationDetails struct {
	Page     int `json:"page"`
	PageSize int `json:"page_size"`
}

type pagination struct {
	Data       []*newsItem       `json:"data"`
	Pagination paginationDetails `json:"pagination"`
}

func newPagination(data []*newsItem, page int, pageSize int) *pagination {
	return &pagination{
		Data: data,
		Pagination: paginationDetails{
			Page:     page,
			PageSize: pageSize,
		},
	}
}

func (p *pagination) SetData(data []*newsItem) {
	p.Data = data
}

func (p *pagination) SetPagination(page int, pageSize int) {
	p.Pagination = paginationDetails{
		Page:     page,
		PageSize: pageSize,
	}
}
