File size: 419 Bytes
fea99b3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package http

import (
	"github.com/samber/lo"

	"github.com/openmeterio/openmeter/api"
	"github.com/openmeterio/openmeter/pkg/models"
)

func FromAnnotations(annotations models.Annotations) *api.Annotations {
	return lo.ToPtr((api.Annotations)(annotations))
}

func AsAnnotations(annotations *api.Annotations) models.Annotations {
	if annotations == nil {
		return nil
	}

	return (models.Annotations)(*annotations)
}