forked from plivo/plivo-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compliance_document_types.go
71 lines (65 loc) · 2.57 KB
/
compliance_document_types.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package plivo
import "time"
type ComplianceDocumentTypeService struct {
client *Client
}
type GetComplianceDocumentTypeResponse struct {
APIID string `json:"api_id"`
CreatedAt time.Time `json:"created_at"`
Description string `json:"description"`
DocumentName string `json:"document_name"`
DocumentTypeID string `json:"document_type_id"`
Information []struct {
FieldName string `json:"field_name"`
FieldType string `json:"field_type"`
FriendlyName string `json:"friendly_name"`
HelpText string `json:"help_text,omitempty"`
MaxLength int `json:"max_length,omitempty"`
MinLength int `json:"min_length,omitempty"`
Format string `json:"format,omitempty"`
Enums []string `json:"enums,omitempty"`
} `json:"information"`
ProofRequired interface{} `json:"proof_required"`
}
type ListComplianceDocumentTypeResponse struct {
APIID string `json:"api_id"`
Meta struct {
Limit int `json:"limit"`
Next interface{} `json:"next"`
Offset int `json:"offset"`
Previous interface{} `json:"previous"`
TotalCount int `json:"total_count"`
} `json:"meta"`
Objects []struct {
CreatedAt time.Time `json:"created_at"`
Description string `json:"description"`
DocumentName string `json:"document_name"`
DocumentTypeID string `json:"document_type_id"`
Information []struct {
FieldName string `json:"field_name"`
FieldType string `json:"field_type"`
Format string `json:"format,omitempty"`
FriendlyName string `json:"friendly_name"`
MaxLength int `json:"max_length,omitempty"`
MinLength int `json:"min_length,omitempty"`
HelpText string `json:"help_text,omitempty"`
Enums []string `json:"enums,omitempty"`
} `json:"information"`
ProofRequired interface{} `json:"proof_required"`
} `json:"objects"`
}
func (service *ComplianceDocumentTypeService) Get(docId string) (response *GetComplianceDocumentTypeResponse, err error) {
req, err := service.client.NewRequest("GET", nil, "ComplianceDocumentType/%s", docId)
response = &GetComplianceDocumentTypeResponse{}
err = service.client.ExecuteRequest(req, response)
return
}
func (service *ComplianceDocumentTypeService) List(params BaseListParams) (response *ListComplianceDocumentTypeResponse, err error) {
request, err := service.client.NewRequest("GET", params, "ComplianceDocumentType")
if err != nil {
return
}
response = &ListComplianceDocumentTypeResponse{}
err = service.client.ExecuteRequest(request, response)
return
}