-
Notifications
You must be signed in to change notification settings - Fork 0
/
contactUpdate.go
55 lines (36 loc) · 1.08 KB
/
contactUpdate.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
46
47
48
49
50
51
52
53
54
55
package axcelerate
import (
"fmt"
jsontime "github.com/liamylian/jsontime/v2/v2"
)
/*
ContactUpdate used to update a contact.
Interacts with a specfic contact. You can update (PUT) contact details. The including the parameters below.
Request Parameters
givenName
Given (first) name
surname
Surname (last name)
emailAddress
Email address. Must be a valid email address
DOB
yyyy-mm-dd formatted date
//
*/
func (s *ContactService) ContactUpdate(contactID int, parms map[string]string) (Contact, *Response, error) {
var obj Contact
if len(parms) == 0 {
parms = map[string]string{}
}
resp, err := do(s.client, "PUT", Params{parms: parms, u: fmt.Sprintf("/contact/%d", contactID)}, obj)
if err != nil {
return obj, resp, err
}
var json = jsontime.ConfigWithCustomTimeFormat
jsontime.AddTimeFormatAlias("axc_time", "15:04")
jsontime.AddTimeFormatAlias("axc_time_long", "15:04:05")
jsontime.AddTimeFormatAlias("axc_date", "2006-01-02")
jsontime.AddTimeFormatAlias("axc_date_hours", "2006-01-02 15:04")
err = json.Unmarshal([]byte(resp.Body), &obj)
return obj, resp, err
}