-
Notifications
You must be signed in to change notification settings - Fork 165
/
syncidentityprovider_convert.go
39 lines (31 loc) · 1.1 KB
/
syncidentityprovider_convert.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package v20231122
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License 2.0.
import (
"github.com/Azure/ARO-RP/pkg/api"
)
type syncIdentityProviderConverter struct{}
func (c syncIdentityProviderConverter) ToExternal(sip *api.SyncIdentityProvider) interface{} {
out := new(SyncIdentityProvider)
out.proxyResource = true
out.ID = sip.ID
out.Name = sip.Name
out.Type = sip.Type
out.Properties.Resources = sip.Properties.Resources
return out
}
func (c syncIdentityProviderConverter) ToInternal(_sip interface{}, out *api.SyncIdentityProvider) {
ocm := _sip.(*api.SyncIdentityProvider)
out.ID = ocm.ID
}
// ToExternalList returns a slice of external representations of the internal objects
func (c syncIdentityProviderConverter) ToExternalList(sip []*api.SyncIdentityProvider) interface{} {
l := &SyncIdentityProviderList{
SyncIdentityProviders: make([]*SyncIdentityProvider, 0, len(sip)),
}
for _, syncidentityproviders := range sip {
c := c.ToExternal(syncidentityproviders)
l.SyncIdentityProviders = append(l.SyncIdentityProviders, c.(*SyncIdentityProvider))
}
return l
}