-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathContactResult.php
135 lines (121 loc) · 3.37 KB
/
ContactResult.php
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?php
declare(strict_types=1);
namespace Upmind\ProvisionProviders\DomainNames\Data;
use Upmind\ProvisionBase\Provider\DataSet\ResultData;
use Upmind\ProvisionBase\Provider\DataSet\Rules;
/**
* Contact data.
*
* @property-read string $name Name of new contact
* @property-read string $organisation Organisation of new contact
* @property-read string $email Email of new contact
* @property-read string|null $phone Phone of new contact
* @property-read string $address1 Full address of new contact
* @property-read string $city City of new contact
* @property-read string|null $state
* @property-read string|null $postcode Postcode of new contact
* @property-read string|null $country_code Country of new contact
* @property-read string|null $type Type of new contact
* @property-read string|null $password Password of new contact
* @property-read string|int|null $id ID of contact
*/
class ContactResult extends ResultData
{
public static function rules(): Rules
{
return new Rules([
'name' => ['nullable', 'string'],
'organisation' => ['nullable', 'string'],
'email' => ['required', 'email'],
'phone' => ['nullable', 'string', 'international_phone'],
'address1' => ['required', 'string'],
'city' => ['required', 'string'],
'state' => ['nullable', 'string'],
'postcode' => ['nullable', 'string'],
'country_code' => ['nullable', 'string', 'size:2', 'country_code'],
'type' => ['nullable', 'string'],
'password' => ['nullable', 'string'],
'id' => ['nullable'],
]);
}
/**
* @return $this
*/
public function setName(?string $name): ContactResult
{
$this->setValue('name', $name);
return $this;
}
/**
* @return $this
*/
public function setOrganisation(?string $organisation): ContactResult
{
$this->setValue('organisation', $organisation);
return $this;
}
/**
* @return $this
*/
public function setEmail(string $email): ContactResult
{
$this->setValue('email', $email);
return $this;
}
/**
* @return $this
*/
public function setPhone(?string $phone): ContactResult
{
$this->setValue('phone', $phone);
return $this;
}
/**
* @return $this
*/
public function setAddress1(string $address1): ContactResult
{
$this->setValue('address1', $address1);
return $this;
}
/**
* @return $this
*/
public function setCity(string $city): ContactResult
{
$this->setValue('city', $city);
return $this;
}
/**
* @return $this
*/
public function setState(?string $state): ContactResult
{
$this->setValue('state', $state);
return $this;
}
/**
* @return $this
*/
public function setPostcode(?string $postcode): ContactResult
{
$this->setValue('postcode', $postcode);
return $this;
}
/**
* @return $this
*/
public function setCountryCode(?string $countryCode): ContactResult
{
$this->setValue('country_code', $countryCode);
return $this;
}
/**
* @return $this
*/
public function setId(?string $id): ContactResult
{
$this->setValue('id', $id);
return $this;
}
}