-
Notifications
You must be signed in to change notification settings - Fork 2
/
incomingphonenumber_client.go
90 lines (77 loc) · 3.56 KB
/
incomingphonenumber_client.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING;
// Autogenerated by clientgenerator -r IncomingPhoneNumber -m CRUD DO NOT EDIT
package api
import (
"github.com/exotel/goapi/assets/types"
"github.com/exotel/goapi/resources"
)
//IncomingPhoneNumberService is the struct that defines the incomingphonenumber information and has fubnctions to perform incomingphonenumber level
type IncomingPhoneNumberService struct {
Client
}
//Create sets the action as create
func (__receiver_IService *IncomingPhoneNumberService) Create() *IncomingPhoneNumberService {
__receiver_IService.action = types.CREATE
__receiver_IService.data = resources.IncomingPhoneNumberDetails{}
__receiver_IService.url = resources.IncomingPhoneNumberURLS[types.CREATE]
return __receiver_IService
}
//Update sets the action as update
func (__receiver_IService *IncomingPhoneNumberService) Update() *IncomingPhoneNumberService {
__receiver_IService.action = types.UPDATE
__receiver_IService.data = resources.IncomingPhoneNumberUpdatableDetails{}
__receiver_IService.url = resources.IncomingPhoneNumberURLS[types.UPDATE]
return __receiver_IService
}
//Delete sets the action as types.DELETE
func (__receiver_IService *IncomingPhoneNumberService) Delete() *IncomingPhoneNumberService {
__receiver_IService.action = types.DELETE
__receiver_IService.data = struct{}{}
__receiver_IService.url = resources.IncomingPhoneNumberURLS[types.DELETE]
return __receiver_IService
}
//Get sets the action as types.READ
func (__receiver_IService *IncomingPhoneNumberService) Get() *IncomingPhoneNumberService {
if len(__receiver_IService.ResourceID) == 0 {
__receiver_IService.action = types.BULKREAD
__receiver_IService.data = resources.IncomingPhoneNumberFilter{}
__receiver_IService.url = resources.IncomingPhoneNumberURLS[types.BULKREAD]
} else {
__receiver_IService.data = struct{}{}
__receiver_IService.url = resources.IncomingPhoneNumberURLS[types.READ]
__receiver_IService.action = types.READ
}
return __receiver_IService
}
//ID sets the id for the resource request
func (__receiver_IService *IncomingPhoneNumberService) ID(id string) *IncomingPhoneNumberService {
__receiver_IService.ResourceID = id
switch __receiver_IService.action {
case types.BULKREAD:
__receiver_IService.data = struct{}{}
__receiver_IService.url = resources.IncomingPhoneNumberURLS[types.READ]
__receiver_IService.action = types.READ
}
return __receiver_IService
}
//Filter set the filter for read operation for read
func (__receiver_IService *IncomingPhoneNumberService) Filter(filter resources.IncomingPhoneNumberFilter) *IncomingPhoneNumberService {
__receiver_IService.data = filter
return __receiver_IService
}
//Details set the resource details for create resource requests
func (__receiver_IService *IncomingPhoneNumberService) Details(details resources.IncomingPhoneNumberDetails) *IncomingPhoneNumberService {
__receiver_IService.data = details
return __receiver_IService
}
//UpdateDetails sets the details to be updated for the resource
func (__receiver_IService *IncomingPhoneNumberService) UpdateDetails(details resources.IncomingPhoneNumberUpdatableDetails) *IncomingPhoneNumberService {
__receiver_IService.data = details
return __receiver_IService
}
//IncomingPhoneNumber returns an instance of IncomingPhoneNumberService
func (c *Client) IncomingPhoneNumber() *IncomingPhoneNumberService {
incomingphonenumberService := IncomingPhoneNumberService{Client: *c}
incomingphonenumberService.validActions = types.CREATE | types.READ | types.BULKREAD | types.UPDATE | types.DELETE | 0x00
return &incomingphonenumberService
}