forked from bpancost/sila
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entity_delete_registration_data.go
45 lines (37 loc) · 1.39 KB
/
entity_delete_registration_data.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
41
42
43
44
45
package sila
import "github.com/kappapay/silaclient/domain"
func (client ClientImpl) DeleteRegistrationData(userHandle string) DeleteRegistrationData {
return &DeleteRegistrationDataMsg{
Header: client.generateHeader().setUserHandle(userHandle),
}
}
type DeleteRegistrationDataMsg struct {
Header *Header `json:"header"`
Uuid string `json:"uuid"`
DataType domain.RegistrationDataType `json:"-"`
}
func (msg *DeleteRegistrationDataMsg) SetEmail(addressUuid string) DeleteRegistrationData {
msg.Uuid = addressUuid
msg.DataType = domain.EmailDataType
return msg
}
func (msg *DeleteRegistrationDataMsg) SetPhone(phoneUuid string) DeleteRegistrationData {
msg.Uuid = phoneUuid
msg.DataType = domain.PhoneDataType
return msg
}
func (msg *DeleteRegistrationDataMsg) SetIdentity(identityUuid string) DeleteRegistrationData {
msg.Uuid = identityUuid
msg.DataType = domain.IdentityDataType
return msg
}
func (msg *DeleteRegistrationDataMsg) SetAddress(addressUuid string) DeleteRegistrationData {
msg.Uuid = addressUuid
msg.DataType = domain.IdentityDataType
return msg
}
func (msg *DeleteRegistrationDataMsg) Do(userWalletPrivateKey string) (domain.SuccessResponse, error) {
var responseBody domain.SuccessResponse
err := instance.performCallWithUserAuth("/delete/"+string(msg.DataType), msg, &responseBody, userWalletPrivateKey)
return responseBody, err
}