/
api_op_client.go
172 lines (164 loc) · 6.44 KB
/
api_op_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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
// Package account contains auto-generated files. DO NOT MODIFY
package account
import (
"github.com/RJPearson94/twilio-sdk-go/client"
"github.com/RJPearson94/twilio-sdk-go/service/api/v2010/account/address"
"github.com/RJPearson94/twilio-sdk-go/service/api/v2010/account/addresses"
"github.com/RJPearson94/twilio-sdk-go/service/api/v2010/account/application"
"github.com/RJPearson94/twilio-sdk-go/service/api/v2010/account/applications"
"github.com/RJPearson94/twilio-sdk-go/service/api/v2010/account/available_phone_number"
"github.com/RJPearson94/twilio-sdk-go/service/api/v2010/account/available_phone_numbers"
"github.com/RJPearson94/twilio-sdk-go/service/api/v2010/account/balance"
"github.com/RJPearson94/twilio-sdk-go/service/api/v2010/account/call"
"github.com/RJPearson94/twilio-sdk-go/service/api/v2010/account/calls"
"github.com/RJPearson94/twilio-sdk-go/service/api/v2010/account/conference"
"github.com/RJPearson94/twilio-sdk-go/service/api/v2010/account/conferences"
"github.com/RJPearson94/twilio-sdk-go/service/api/v2010/account/incoming_phone_number"
"github.com/RJPearson94/twilio-sdk-go/service/api/v2010/account/incoming_phone_numbers"
"github.com/RJPearson94/twilio-sdk-go/service/api/v2010/account/key"
"github.com/RJPearson94/twilio-sdk-go/service/api/v2010/account/keys"
"github.com/RJPearson94/twilio-sdk-go/service/api/v2010/account/message"
"github.com/RJPearson94/twilio-sdk-go/service/api/v2010/account/messages"
"github.com/RJPearson94/twilio-sdk-go/service/api/v2010/account/queue"
"github.com/RJPearson94/twilio-sdk-go/service/api/v2010/account/queues"
"github.com/RJPearson94/twilio-sdk-go/service/api/v2010/account/recording"
"github.com/RJPearson94/twilio-sdk-go/service/api/v2010/account/recordings"
"github.com/RJPearson94/twilio-sdk-go/service/api/v2010/account/tokens"
)
// Client for managing a specific account resource
// See https://www.twilio.com/docs/iam/api/account for more details
type Client struct {
client *client.Client
sid string
Address func(string) *address.Client
Addresses *addresses.Client
Application func(string) *application.Client
Applications *applications.Client
AvailablePhoneNumber func(string) *available_phone_number.Client
AvailablePhoneNumbers *available_phone_numbers.Client
Balance func() *balance.Client
Call func(string) *call.Client
Calls *calls.Client
Conference func(string) *conference.Client
Conferences *conferences.Client
IncomingPhoneNumber func(string) *incoming_phone_number.Client
IncomingPhoneNumbers *incoming_phone_numbers.Client
Key func(string) *key.Client
Keys *keys.Client
Message func(string) *message.Client
Messages *messages.Client
Queue func(string) *queue.Client
Queues *queues.Client
Recording func(string) *recording.Client
Recordings *recordings.Client
Tokens *tokens.Client
}
// ClientProperties are the properties required to manage the account resources
type ClientProperties struct {
Sid string
}
// New creates a new instance of the account client
func New(client *client.Client, properties ClientProperties) *Client {
return &Client{
client: client,
sid: properties.Sid,
Address: func(addressSid string) *address.Client {
return address.New(client, address.ClientProperties{
AccountSid: properties.Sid,
Sid: addressSid,
})
},
Addresses: addresses.New(client, addresses.ClientProperties{
AccountSid: properties.Sid,
}),
Application: func(applicationSid string) *application.Client {
return application.New(client, application.ClientProperties{
AccountSid: properties.Sid,
Sid: applicationSid,
})
},
Applications: applications.New(client, applications.ClientProperties{
AccountSid: properties.Sid,
}),
AvailablePhoneNumber: func(countryCode string) *available_phone_number.Client {
return available_phone_number.New(client, available_phone_number.ClientProperties{
AccountSid: properties.Sid,
CountryCode: countryCode,
})
},
AvailablePhoneNumbers: available_phone_numbers.New(client, available_phone_numbers.ClientProperties{
AccountSid: properties.Sid,
}),
Balance: func() *balance.Client {
return balance.New(client, balance.ClientProperties{
AccountSid: properties.Sid,
})
},
Call: func(callSid string) *call.Client {
return call.New(client, call.ClientProperties{
AccountSid: properties.Sid,
Sid: callSid,
})
},
Calls: calls.New(client, calls.ClientProperties{
AccountSid: properties.Sid,
}),
Conference: func(conferenceSid string) *conference.Client {
return conference.New(client, conference.ClientProperties{
AccountSid: properties.Sid,
Sid: conferenceSid,
})
},
Conferences: conferences.New(client, conferences.ClientProperties{
AccountSid: properties.Sid,
}),
IncomingPhoneNumber: func(phoneNumberSid string) *incoming_phone_number.Client {
return incoming_phone_number.New(client, incoming_phone_number.ClientProperties{
AccountSid: properties.Sid,
Sid: phoneNumberSid,
})
},
IncomingPhoneNumbers: incoming_phone_numbers.New(client, incoming_phone_numbers.ClientProperties{
AccountSid: properties.Sid,
}),
Key: func(keySid string) *key.Client {
return key.New(client, key.ClientProperties{
AccountSid: properties.Sid,
Sid: keySid,
})
},
Keys: keys.New(client, keys.ClientProperties{
AccountSid: properties.Sid,
}),
Message: func(messageSid string) *message.Client {
return message.New(client, message.ClientProperties{
AccountSid: properties.Sid,
Sid: messageSid,
})
},
Messages: messages.New(client, messages.ClientProperties{
AccountSid: properties.Sid,
}),
Queue: func(queueSid string) *queue.Client {
return queue.New(client, queue.ClientProperties{
AccountSid: properties.Sid,
Sid: queueSid,
})
},
Queues: queues.New(client, queues.ClientProperties{
AccountSid: properties.Sid,
}),
Recording: func(recordingSid string) *recording.Client {
return recording.New(client, recording.ClientProperties{
AccountSid: properties.Sid,
Sid: recordingSid,
})
},
Recordings: recordings.New(client, recordings.ClientProperties{
AccountSid: properties.Sid,
}),
Tokens: tokens.New(client, tokens.ClientProperties{
AccountSid: properties.Sid,
}),
}
}