internal/stubs/message.go   A
last analyzed

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
dl 0
loc 43
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A stubs.MessagesSendResponse 0 2 1
A stubs.MessagesSendErrorResponse 0 2 1
1
package stubs
2
3
// MessagesSendResponse response from the /v1/messages/send endpoint
4
func MessagesSendResponse() []byte {
5
	return []byte(`
6
		{
7
			"data": {
8
				"can_be_polled": false,
9
				"contact": "+18005550100",
10
				"content": "This is a sample text message",
11
				"created_at": "2022-06-05T14:26:02.302718+03:00",
12
				"delivered_at": "2022-06-05T14:26:09.527976+03:00",
13
				"expired_at": "2022-06-05T14:26:09.527976+03:00",
14
				"failed_at": "2022-06-05T14:26:09.527976+03:00",
15
				"failure_reason": null,
16
				"id": "32343a19-da5e-4b1b-a767-3298a73703cb",
17
				"last_attempted_at": "2022-06-05T14:26:09.527976+03:00",
18
				"max_send_attempts": 1,
19
				"order_timestamp": "2022-06-05T14:26:09.527976+03:00",
20
				"owner": "+18005550199",
21
				"received_at": "2022-06-05T14:26:09.527976+03:00",
22
				"request_id": "153554b5-ae44-44a0-8f4f-7bbac5657ad4",
23
				"request_received_at": "2022-06-05T14:26:01.520828+03:00",
24
				"scheduled_at": "2022-06-05T14:26:09.527976+03:00",
25
				"send_attempt_count": 0,
26
				"send_time": 133414,
27
				"sent_at": "2022-06-05T14:26:09.527976+03:00",
28
				"sim": "SIM1",
29
				"status": "pending",
30
				"encrypted": false,	
31
				"type": "mobile-terminated",
32
				"updated_at": "2022-06-05T14:26:10.303278+03:00",
33
				"user_id": "WB7DRDWrJZRGbYrv2CKGkqbzvqdC"
34
			},
35
			"message": "item created successfully",
36
			"status": "success"
37
	}
38
`)
39
}
40
41
// MessagesSendErrorResponse internal error response
42
func MessagesSendErrorResponse() []byte {
43
	return []byte(`
44
		{
45
			"message": "We ran into an internal error while handling the request.",
46
			"status": "error"
47
		}
48
`)
49
}
50