summaryrefslogtreecommitdiffstats
path: root/internal/models/skiptrace.go
blob: c87fe72ba926045d0b205f2c47b5d2638145fa8c (plain)
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
package models

import "encoding/json"

type SkiptraceParams struct {
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	City      string `json:"city,omitempty"`
	State     string `json:"state,omitempty"`
	Age       string `json:"age,omitempty"`
}

type SkiptraceResponse struct {
	Data    map[string]interface{} `json:"-"`
	SXKey   string                 `json:"sx_key,omitempty"`
	Message string                 `json:"message,omitempty"`
	Error   string                 `json:"error,omitempty"`
}

func (s *SkiptraceResponse) UnmarshalJSON(data []byte) error {
	type Alias SkiptraceResponse
	aux := &struct {
		*Alias
	}{
		Alias: (*Alias)(s),
	}
	if err := json.Unmarshal(data, &aux); err != nil {
		return err
	}
	s.Data = make(map[string]interface{})
	return json.Unmarshal(data, &s.Data)
}

type SkiptraceReportResponse struct {
	Data    map[string]interface{} `json:"-"`
	Message string                 `json:"message,omitempty"`
	Error   string                 `json:"error,omitempty"`
}

func (s *SkiptraceReportResponse) UnmarshalJSON(data []byte) error {
	type Alias SkiptraceReportResponse
	aux := &struct {
		*Alias
	}{
		Alias: (*Alias)(s),
	}
	if err := json.Unmarshal(data, &aux); err != nil {
		return err
	}
	s.Data = make(map[string]interface{})
	return json.Unmarshal(data, &s.Data)
}

type SkiptracePhoneResponse struct {
	Data    map[string]interface{} `json:"-"`
	Message string                 `json:"message,omitempty"`
	Error   string                 `json:"error,omitempty"`
}

func (s *SkiptracePhoneResponse) UnmarshalJSON(data []byte) error {
	type Alias SkiptracePhoneResponse
	aux := &struct {
		*Alias
	}{
		Alias: (*Alias)(s),
	}
	if err := json.Unmarshal(data, &aux); err != nil {
		return err
	}
	s.Data = make(map[string]interface{})
	return json.Unmarshal(data, &s.Data)
}

type SkiptraceEmailResponse struct {
	Data    map[string]interface{} `json:"-"`
	Message string                 `json:"message,omitempty"`
	Error   string                 `json:"error,omitempty"`
}

func (s *SkiptraceEmailResponse) UnmarshalJSON(data []byte) error {
	type Alias SkiptraceEmailResponse
	aux := &struct {
		*Alias
	}{
		Alias: (*Alias)(s),
	}
	if err := json.Unmarshal(data, &aux); err != nil {
		return err
	}
	s.Data = make(map[string]interface{})
	return json.Unmarshal(data, &s.Data)
}