-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.go
182 lines (169 loc) · 5.35 KB
/
test.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
173
174
175
176
177
178
179
180
181
182
package main
import (
"fmt"
"log"
)
func main() {
apikey := "b7ee4eacexxxxxxxxxxxxxxxxxxxxx"
linenumber := "1234xxxxxxx"
receptor := "09xxxxxxxxx"
client := NewGhasedak(apikey)
// CheckSmsStatus
checkSmsStatusQuery := map[string]interface{}{
"type": 1,
"ids": []string{"2366799", "2366805"},
}
fmt.Printf("CheckSmsStatus Input: %v\n", checkSmsStatusQuery)
checkSmsStatusOutput, err := client.CheckSmsStatus(checkSmsStatusQuery)
if err != nil {
log.Fatalf("CheckSmsStatus Error: %v\n", err)
}
fmt.Printf("CheckSmsStatus Output: %v\n", checkSmsStatusOutput)
// GetAccountInformation
fmt.Println("GetAccountInformation Input: none")
getAccountInformationOutput, err := client.GetAccountInformation()
if err != nil {
log.Fatalf("GetAccountInformation Error: %v\n", err)
}
fmt.Printf("GetAccountInformation Output: %v\n", getAccountInformationOutput)
// GetReceivedSmses
getReceivedSmsesQuery := map[string]interface{}{
"line_number": linenumber,
"is_read": false,
}
fmt.Printf("GetReceivedSmses Input: %v\n", getReceivedSmsesQuery)
getReceivedSmsesOutput, err := client.GetReceivedSmses(getReceivedSmsesQuery)
if err != nil {
log.Fatalf("GetReceivedSmses Error: %v\n", err)
}
fmt.Printf("GetReceivedSmses Output: %v\n", getReceivedSmsesOutput)
//GetReceivedSmsesPaging
getReceivedSmsesPagingQuery := map[string]interface{}{
"line_number": linenumber,
"is_read": false,
"page_size": 10,
"page_number": 1,
}
fmt.Printf("GetReceivedSmsesPaging Input: %v\n", getReceivedSmsesPagingQuery)
getReceivedSmsesPagingOutput, err := client.GetReceivedSmsesPaging(getReceivedSmsesPagingQuery)
if err != nil {
log.Fatalf("GetReceivedSmsesPaging Error: %v\n", err)
}
fmt.Printf("GetReceivedSmsesPaging Output: %v\n", getReceivedSmsesPagingOutput)
// GetOtpTemplateParameters
templateName := "oldOTP"
fmt.Printf("GetOtpTemplateParameters Input: %v\n", templateName)
getOtpTemplateParametersOutput, err := client.GetOtpTemplateParameters(templateName)
if err != nil {
log.Fatalf("GetOtpTemplateParameters Error: %v\n", err)
}
fmt.Printf("GetOtpTemplateParameters Output: %v\n", getOtpTemplateParametersOutput)
// SendSimpleSms
sendSimpleSmsCommand := map[string]interface{}{
//"sendDate": time.Now().Format(time.RFC3339),
"message": "Hello World!",
"receptor": receptor,
"linenumber": linenumber,
//"clientReferenceId": "stringfsdfsdf",
//"udh": false,
}
fmt.Printf("SendSimpleSms Input: %v\n", sendSimpleSmsCommand)
sendSimpleSmsOutput, err := client.SendSimpleSms(sendSimpleSmsCommand)
if err != nil {
log.Fatalf("SendSimpleSms Error: %v\n", err)
}
fmt.Printf("SendSimpleSms Output: %v\n", sendSimpleSmsOutput)
// SendBulkSms
sendBulkSmsCommand := map[string]interface{}{
"message": "Hello Everyone!",
"receptors": []string{receptor, receptor},
"linenumber": linenumber,
}
fmt.Printf("SendBulkSms Input: %v\n", sendBulkSmsCommand)
sendBulkSmsOutput, err := client.SendBulkSms(sendBulkSmsCommand)
if err != nil {
log.Fatalf("SendBulkSms Error: %v\n", err)
}
fmt.Printf("SendBulkSms Output: %v\n", sendBulkSmsOutput)
// SendPairToPairSms
sendPairToPairSmsCommand := map[string]interface{}{
"items": []map[string]interface{}{
{
"lineNumber": linenumber,
"receptor": receptor,
"message": "string",
//"clientReferenceId": "sdsdfdsftrifdfdng",
//"sendDate": time.Now().Format(time.RFC3339),
},
{
"lineNumber": linenumber,
"receptor": receptor,
"message": "string3",
//"clientReferenceId": "sdsfdsfsddfddfdsftring",
//"sendDate": time.Now().Format(time.RFC3339),
},
},
"udh": false,
}
fmt.Printf("SendPairToPairSms Input: %v\n", sendPairToPairSmsCommand)
sendPairToPairSmsOutput, err := client.SendPairToPairSms(sendPairToPairSmsCommand)
if err != nil {
log.Fatalf("SendPairToPairSms Error: %v\n", err)
}
fmt.Printf("SendPairToPairSms Output: %v\n", sendPairToPairSmsOutput)
// SendOtpSmsOld
sendOtpSmsOldCommand := map[string]interface{}{
"receptors": []map[string]string{
{
"mobile": receptor,
"clientReferenceId": "stghfghgfffrxsding",
},
},
"templateName": "oldOTP",
"param1": "fgfhfg",
"param2": "hfghgf",
"param3": "string",
"param4": "string",
"param5": "string",
"param6": "string",
"param7": "string",
"param8": "string",
"param9": "string",
"param10": "string",
"isVoice": false,
"udh": false,
}
fmt.Printf("SendOtpSmsOld Input: %v\n", sendOtpSmsOldCommand)
sendOtpSmsOldOutput, err := client.SendOtpSmsOld(sendOtpSmsOldCommand)
if err != nil {
log.Fatalf("SendOtpSmsOld Error: %v\n", err)
}
fmt.Printf("SendOtpSmsOld Output: %v\n", sendOtpSmsOldOutput)
sendOtpSmsCommand := map[string]interface{}{
"sendDate": "2024-07-11T18:16:05.952Z",
"receptors": []map[string]string{
{
"mobile": receptor,
"clientReferenceId": "string",
},
},
"templateName": "newOTP",
"inputs": []map[string]string{
{
"param": "Name",
"value": "string",
},
{
"param": "Code",
"value": "string",
},
},
"udh": false,
}
fmt.Printf("SendOtpSms Input: %v\n", sendOtpSmsCommand)
sendOtpSmsOutput, err := client.SendOtpSms(sendOtpSmsCommand)
if err != nil {
log.Fatalf("SendOtpSms Error: %v\n", err)
}
fmt.Printf("SendOtpSms Output: %v\n", sendOtpSmsOutput)
}