1818 limitations under the License.
1919 */
2020
21+ use DCarbone \PHPConsulAPI \Hydration ;
22+
2123/**
2224 * Class AgentCheckRegistration
2325 */
2426class AgentCheckRegistration extends AgentServiceCheck
2527{
26- /** @var string */
27- public string $ ID = '' ;
28- /** @var string */
29- public string $ ServiceID = '' ;
28+ protected const FIELDS = [
29+ self ::FIELD_ID => [
30+ Hydration::FIELD_TYPE => Hydration::STRING ,
31+ Hydration::FIELD_NULLABLE => true ,
32+ ],
33+ self ::FIELD_SERVICE_ID => [
34+ Hydration::FIELD_TYPE => Hydration::STRING ,
35+ Hydration::FIELD_NULLABLE => true ,
36+ ],
37+ self ::FIELD_NAMESPACE => [
38+ Hydration::FIELD_TYPE => Hydration::STRING ,
39+ Hydration::FIELD_NULLABLE => true ,
40+ ],
41+ ];
42+
43+ private const FIELD_ID = 'ID ' ;
44+ private const FIELD_SERVICE_ID = 'ServiceID ' ;
45+ private const FIELD_NAMESPACE = 'Namespace ' ;
46+
47+ /** @var string|null */
48+ public ?string $ ID = null ;
49+ /** @var string|null */
50+ public ?string $ ServiceID = null ;
51+ /** @var string|null */
52+ public ?string $ Namespace = null ;
3053
3154 /**
32- * @return string
55+ * @return string|null
3356 */
34- public function getID (): string
57+ public function getID (): ? string
3558 {
3659 return $ this ->ID ;
3760 }
3861
3962 /**
40- * @param string $id
63+ * @param string|null $ID
4164 * @return \DCarbone\PHPConsulAPI\Agent\AgentCheckRegistration
4265 */
43- public function setID (string $ id ): self
66+ public function setID (? string $ ID ): self
4467 {
45- $ this ->ID = $ id ;
68+ $ this ->ID = $ ID ;
4669 return $ this ;
4770 }
4871
4972 /**
50- * @return string
73+ * @return string|null
5174 */
52- public function getServiceID (): string
75+ public function getServiceID (): ? string
5376 {
5477 return $ this ->ServiceID ;
5578 }
5679
5780 /**
58- * @param string $serviceID
81+ * @param string|null $ServiceID
82+ * @return \DCarbone\PHPConsulAPI\Agent\AgentCheckRegistration
83+ */
84+ public function setServiceID (?string $ ServiceID ): self
85+ {
86+ $ this ->ServiceID = $ ServiceID ;
87+ return $ this ;
88+ }
89+
90+ /**
91+ * @return string|null
92+ */
93+ public function getNamespace (): ?string
94+ {
95+ return $ this ->Namespace ;
96+ }
97+
98+ /**
99+ * @param string|null $Namespace
59100 * @return \DCarbone\PHPConsulAPI\Agent\AgentCheckRegistration
60101 */
61- public function setServiceID ( string $ serviceID ): self
102+ public function setNamespace (? string $ Namespace ): self
62103 {
63- $ this ->ServiceID = $ serviceID ;
104+ $ this ->Namespace = $ Namespace ;
64105 return $ this ;
65106 }
66107
@@ -69,6 +110,6 @@ public function setServiceID(string $serviceID): self
69110 */
70111 public function __toString (): string
71112 {
72- return (string ) $ this ->Name ;
113+ return (string )$ this ->Name ;
73114 }
74115}
0 commit comments