-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_attribute_mapper_profile_ext.go
40 lines (30 loc) · 1.23 KB
/
model_attribute_mapper_profile_ext.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
40
package jossoappi
func NewAttriburteMapperProfileDTOInit(n string) *AttributeMapperProfileDTO {
return newAttributeMapperProfileDTOInit(n, "CUSTOM")
}
func newAttributeMapperProfileDTOInit(n string, t string) *AttributeMapperProfileDTO {
ba := NewAttributeMapperProfileDTO()
ba.AdditionalProperties = make(map[string]interface{})
ba.AdditionalProperties["@c"] = ".AttributeMapperProfileDTO"
ba.SetName(n)
ba.SetProfileType(t)
return ba
}
func (amp *AttributeMapperProfileDTO) ToAttrProfile() (*AttributeProfileDTO, error) {
m := NewAttributeProfileDTO()
m.SetName(amp.GetName())
m.SetProfileType(amp.GetProfileType())
m.AdditionalProperties = make(map[string]interface{})
m.AdditionalProperties["@c"] = ".AttributeMapperProfileDTO"
var attributeMaps []interface{}
for _, am := range amp.GetAttributeMaps() {
mapping := make(map[string]interface{})
mapping["attrName"] = am.GetAttrName()
mapping["reportedAttrNameFormat"] = am.GetReportedAttrNameFormat()
mapping["reportedAttrName"] = am.GetReportedAttrName()
attributeMaps = append(attributeMaps, mapping)
}
m.AdditionalProperties["attributeMaps"] = attributeMaps
m.AdditionalProperties["includeNonMappedProperties"] = amp.GetIncludeNonMappedProperties()
return m, nil
}