1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
* This file has been auto generated by Jane, |
7
|
|
|
* |
8
|
|
|
* Do no edit it directly. |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
namespace Montross50\NetsparkerCloud\SDK\Normalizer; |
12
|
|
|
|
13
|
|
|
use Symfony\Component\Serializer\Exception\InvalidArgumentException; |
14
|
|
|
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; |
15
|
|
|
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; |
16
|
|
|
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; |
17
|
|
|
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; |
18
|
|
|
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; |
19
|
|
|
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; |
20
|
|
|
|
21
|
|
|
class FormAuthenticationSettingModelNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface |
22
|
|
|
{ |
23
|
|
|
use DenormalizerAwareTrait; |
24
|
|
|
use NormalizerAwareTrait; |
25
|
|
|
|
26
|
|
|
public function supportsDenormalization($data, $type, $format = null) |
27
|
|
|
{ |
28
|
|
|
return $type === 'Montross50\\NetsparkerCloud\\SDK\\Model\\FormAuthenticationSettingModel'; |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
public function supportsNormalization($data, $format = null) |
32
|
|
|
{ |
33
|
|
|
return $data instanceof \Montross50\NetsparkerCloud\SDK\Model\FormAuthenticationSettingModel; |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
public function denormalize($data, $class, $format = null, array $context = []) |
37
|
|
|
{ |
38
|
|
|
if (!is_object($data)) { |
39
|
|
|
throw new InvalidArgumentException(); |
40
|
|
|
} |
41
|
|
|
$object = new \Montross50\NetsparkerCloud\SDK\Model\FormAuthenticationSettingModel(); |
42
|
|
|
if (property_exists($data, 'CustomScripts')) { |
43
|
|
|
$values = []; |
44
|
|
|
foreach ($data->{'CustomScripts'} as $value) { |
45
|
|
|
$values[] = $this->denormalizer->denormalize($value, 'Montross50\\NetsparkerCloud\\SDK\\Model\\FormAuthenticationCustomScript', 'json', $context); |
46
|
|
|
} |
47
|
|
|
$object->setCustomScripts($values); |
48
|
|
|
} |
49
|
|
|
if (property_exists($data, 'DefaultPersonaValidation')) { |
50
|
|
|
$object->setDefaultPersonaValidation($data->{'DefaultPersonaValidation'}); |
51
|
|
|
} |
52
|
|
|
if (property_exists($data, 'DetectBearerToken')) { |
53
|
|
|
$object->setDetectBearerToken($data->{'DetectBearerToken'}); |
54
|
|
|
} |
55
|
|
|
if (property_exists($data, 'DisableLogoutDetection')) { |
56
|
|
|
$object->setDisableLogoutDetection($data->{'DisableLogoutDetection'}); |
57
|
|
|
} |
58
|
|
|
if (property_exists($data, 'IsEnabled')) { |
59
|
|
|
$object->setIsEnabled($data->{'IsEnabled'}); |
60
|
|
|
} |
61
|
|
|
if (property_exists($data, 'LoginFormUrl')) { |
62
|
|
|
$object->setLoginFormUrl($data->{'LoginFormUrl'}); |
63
|
|
|
} |
64
|
|
|
if (property_exists($data, 'LoginRequiredUrl')) { |
65
|
|
|
$object->setLoginRequiredUrl($data->{'LoginRequiredUrl'}); |
66
|
|
|
} |
67
|
|
|
if (property_exists($data, 'LogoutKeywordPatterns')) { |
68
|
|
|
$values_1 = []; |
69
|
|
|
foreach ($data->{'LogoutKeywordPatterns'} as $value_1) { |
70
|
|
|
$values_1[] = $this->denormalizer->denormalize($value_1, 'Montross50\\NetsparkerCloud\\SDK\\Model\\LogoutKeywordPatternModel', 'json', $context); |
71
|
|
|
} |
72
|
|
|
$object->setLogoutKeywordPatterns($values_1); |
73
|
|
|
} |
74
|
|
|
if (property_exists($data, 'LogoutKeywordPatternsValue')) { |
75
|
|
|
$object->setLogoutKeywordPatternsValue($data->{'LogoutKeywordPatternsValue'}); |
76
|
|
|
} |
77
|
|
|
if (property_exists($data, 'LogoutRedirectPattern')) { |
78
|
|
|
$object->setLogoutRedirectPattern($data->{'LogoutRedirectPattern'}); |
79
|
|
|
} |
80
|
|
|
if (property_exists($data, 'OverrideTargetUrl')) { |
81
|
|
|
$object->setOverrideTargetUrl($data->{'OverrideTargetUrl'}); |
82
|
|
|
} |
83
|
|
|
if (property_exists($data, 'Personas')) { |
84
|
|
|
$values_2 = []; |
85
|
|
|
foreach ($data->{'Personas'} as $value_2) { |
86
|
|
|
$values_2[] = $this->denormalizer->denormalize($value_2, 'Montross50\\NetsparkerCloud\\SDK\\Model\\FormAuthenticationPersona', 'json', $context); |
87
|
|
|
} |
88
|
|
|
$object->setPersonas($values_2); |
89
|
|
|
} |
90
|
|
|
if (property_exists($data, 'PersonasValidation')) { |
91
|
|
|
$object->setPersonasValidation($data->{'PersonasValidation'}); |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
return $object; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
public function normalize($object, $format = null, array $context = []) |
98
|
|
|
{ |
99
|
|
|
$data = new \stdClass(); |
100
|
|
|
if (null !== $object->getCustomScripts()) { |
101
|
|
|
$values = []; |
102
|
|
|
foreach ($object->getCustomScripts() as $value) { |
103
|
|
|
$values[] = $this->normalizer->normalize($value, 'json', $context); |
104
|
|
|
} |
105
|
|
|
$data->{'CustomScripts'} = $values; |
106
|
|
|
} |
107
|
|
|
if (null !== $object->getDefaultPersonaValidation()) { |
108
|
|
|
$data->{'DefaultPersonaValidation'} = $object->getDefaultPersonaValidation(); |
109
|
|
|
} |
110
|
|
|
if (null !== $object->getDetectBearerToken()) { |
111
|
|
|
$data->{'DetectBearerToken'} = $object->getDetectBearerToken(); |
112
|
|
|
} |
113
|
|
|
if (null !== $object->getDisableLogoutDetection()) { |
114
|
|
|
$data->{'DisableLogoutDetection'} = $object->getDisableLogoutDetection(); |
115
|
|
|
} |
116
|
|
|
if (null !== $object->getIsEnabled()) { |
117
|
|
|
$data->{'IsEnabled'} = $object->getIsEnabled(); |
118
|
|
|
} |
119
|
|
|
if (null !== $object->getLoginFormUrl()) { |
120
|
|
|
$data->{'LoginFormUrl'} = $object->getLoginFormUrl(); |
121
|
|
|
} |
122
|
|
|
if (null !== $object->getLoginRequiredUrl()) { |
123
|
|
|
$data->{'LoginRequiredUrl'} = $object->getLoginRequiredUrl(); |
124
|
|
|
} |
125
|
|
|
if (null !== $object->getLogoutKeywordPatterns()) { |
126
|
|
|
$values_1 = []; |
127
|
|
|
foreach ($object->getLogoutKeywordPatterns() as $value_1) { |
128
|
|
|
$values_1[] = $this->normalizer->normalize($value_1, 'json', $context); |
129
|
|
|
} |
130
|
|
|
$data->{'LogoutKeywordPatterns'} = $values_1; |
131
|
|
|
} |
132
|
|
|
if (null !== $object->getLogoutKeywordPatternsValue()) { |
133
|
|
|
$data->{'LogoutKeywordPatternsValue'} = $object->getLogoutKeywordPatternsValue(); |
134
|
|
|
} |
135
|
|
|
if (null !== $object->getLogoutRedirectPattern()) { |
136
|
|
|
$data->{'LogoutRedirectPattern'} = $object->getLogoutRedirectPattern(); |
137
|
|
|
} |
138
|
|
|
if (null !== $object->getOverrideTargetUrl()) { |
139
|
|
|
$data->{'OverrideTargetUrl'} = $object->getOverrideTargetUrl(); |
140
|
|
|
} |
141
|
|
|
if (null !== $object->getPersonas()) { |
142
|
|
|
$values_2 = []; |
143
|
|
|
foreach ($object->getPersonas() as $value_2) { |
144
|
|
|
$values_2[] = $this->normalizer->normalize($value_2, 'json', $context); |
145
|
|
|
} |
146
|
|
|
$data->{'Personas'} = $values_2; |
147
|
|
|
} |
148
|
|
|
if (null !== $object->getPersonasValidation()) { |
149
|
|
|
$data->{'PersonasValidation'} = $object->getPersonasValidation(); |
150
|
|
|
} |
151
|
|
|
|
152
|
|
|
return $data; |
153
|
|
|
} |
154
|
|
|
} |
155
|
|
|
|