Skip to content

Commit e56d2db

Browse files
committed
Format and pretty print JSON blobs
1 parent a7be565 commit e56d2db

20 files changed

+191
-195
lines changed

balance/testdata/balance.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"payment":"prepaid",
3-
"type":"credits",
4-
"amount":9.2
2+
"payment": "prepaid",
3+
"type": "credits",
4+
"amount": 9.2
55
}

hlr/testdata/hlrListObject.json

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
{
2-
"offset":0,
3-
"limit":20,
4-
"count":2,
5-
"totalCount":2,
6-
"links":{
7-
"first":"https://rest.messagebird.com/hlr/?offset=0",
8-
"previous":null,
9-
"next":null,
10-
"last":"https://rest.messagebird.com/hlr/?offset=0"
2+
"offset": 0,
3+
"limit": 20,
4+
"count": 2,
5+
"totalCount": 2,
6+
"links": {
7+
"first": "https:\/\/rest.messagebird.com\/hlr\/?offset=0",
8+
"previous": null,
9+
"next": null,
10+
"last": "https:\/\/rest.messagebird.com\/hlr\/?offset=0"
1111
},
12-
"items":[
13-
{
14-
"id":"27978c50354a93ca0ca8de6h54340177",
15-
"href":"https://rest.messagebird.com/hlr/27978c50354a93ca0ca8de6h54340177",
16-
"msisdn":31612345678,
17-
"network":20406,
18-
"reference":"MyReference",
19-
"status":"sent",
20-
"createdDatetime":"2015-01-04T13:14:08+00:00",
21-
"statusDatetime":"2015-01-04T13:14:09+00:00"
22-
},
23-
{
24-
"id":"27978c50354a93ca0ca8de6h54340177",
25-
"href":"https://rest.messagebird.com/hlr/27978c50354a93ca0ca8de6h54340177",
26-
"msisdn":31612345678,
27-
"network":20406,
28-
"reference":"MyReference",
29-
"status":"sent",
30-
"createdDatetime":"2015-01-04T13:14:08+00:00",
31-
"statusDatetime":"2015-01-04T13:14:09+00:00"
32-
}
12+
"items": [
13+
{
14+
"id": "27978c50354a93ca0ca8de6h54340177",
15+
"href": "https:\/\/rest.messagebird.com\/hlr\/27978c50354a93ca0ca8de6h54340177",
16+
"msisdn": 31612345678,
17+
"network": 20406,
18+
"reference": "MyReference",
19+
"status": "sent",
20+
"createdDatetime": "2015-01-04T13:14:08+00:00",
21+
"statusDatetime": "2015-01-04T13:14:09+00:00"
22+
},
23+
{
24+
"id": "27978c50354a93ca0ca8de6h54340177",
25+
"href": "https:\/\/rest.messagebird.com\/hlr\/27978c50354a93ca0ca8de6h54340177",
26+
"msisdn": 31612345678,
27+
"network": 20406,
28+
"reference": "MyReference",
29+
"status": "sent",
30+
"createdDatetime": "2015-01-04T13:14:08+00:00",
31+
"statusDatetime": "2015-01-04T13:14:09+00:00"
32+
}
3333
]
34-
}
34+
}

hlr/testdata/hlrObject.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"id":"27978c50354a93ca0ca8de6h54340177",
3-
"href":"https://rest.messagebird.com/hlr/27978c50354a93ca0ca8de6h54340177",
4-
"msisdn":31612345678,
5-
"network":20406,
6-
"reference":"MyReference",
7-
"status":"sent",
8-
"createdDatetime":"2015-01-04T13:14:08+00:00",
9-
"statusDatetime":"2015-01-04T13:14:09+00:00"
10-
}
2+
"id": "27978c50354a93ca0ca8de6h54340177",
3+
"href": "https:\/\/rest.messagebird.com\/hlr\/27978c50354a93ca0ca8de6h54340177",
4+
"msisdn": 31612345678,
5+
"network": 20406,
6+
"reference": "MyReference",
7+
"status": "sent",
8+
"createdDatetime": "2015-01-04T13:14:08+00:00",
9+
"statusDatetime": "2015-01-04T13:14:09+00:00"
10+
}

internal/messagebirdtest/test_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type testWriter struct {
1717

1818
// Write logs the provided buffer to the current test's error log.
1919
func (w testWriter) Write(p []byte) (int, error) {
20-
w.t.Log(p)
20+
w.t.Logf("%s", p)
2121

2222
return len(p), nil
2323
}

lookup/testdata/lookupHLRObject.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"id":"6118d3f06566fcd0cdc8962h65065907",
3-
"network":20416,
4-
"reference":"referece2000",
5-
"status":"active",
6-
"createdDatetime":"2015-12-15T08:19:24+00:00",
7-
"statusDatetime":"2015-12-15T08:19:25+00:00"
2+
"id": "6118d3f06566fcd0cdc8962h65065907",
3+
"network": 20416,
4+
"reference": "referece2000",
5+
"status": "active",
6+
"createdDatetime": "2015-12-15T08:19:24+00:00",
7+
"statusDatetime": "2015-12-15T08:19:25+00:00"
88
}

lookup/testdata/lookupObject.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
{
2-
"href":"https://rest.messagebird.com/lookup/31624971134",
3-
"countryCode":"NL",
4-
"countryPrefix":31,
5-
"phoneNumber":31624971134,
6-
"type":"mobile",
7-
"formats":{
8-
"e164":"+31624971134",
9-
"international":"+31 6 24971134",
10-
"national":"06 24971134",
11-
"rfc3966":"tel:+31-6-24971134"
2+
"href": "https:\/\/rest.messagebird.com\/lookup\/31624971134",
3+
"countryCode": "NL",
4+
"countryPrefix": 31,
5+
"phoneNumber": 31624971134,
6+
"type": "mobile",
7+
"formats": {
8+
"e164": "+31624971134",
9+
"international": "+31 6 24971134",
10+
"national": "06 24971134",
11+
"rfc3966": "tel:+31-6-24971134"
1212
},
13-
"hlr":{
14-
"id":"6118d3f06566fcd0cdc8962h65065907",
15-
"network":20416,
16-
"reference":"referece2000",
17-
"status":"active",
18-
"createdDatetime":"2015-12-15T08:19:24+00:00",
19-
"statusDatetime":"2015-12-15T08:19:25+00:00"
13+
"hlr": {
14+
"id": "6118d3f06566fcd0cdc8962h65065907",
15+
"network": 20416,
16+
"reference": "referece2000",
17+
"status": "active",
18+
"createdDatetime": "2015-12-15T08:19:24+00:00",
19+
"statusDatetime": "2015-12-15T08:19:25+00:00"
2020
}
2121
}

message/testdata/binaryMessageObject.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"datacoding": "unicode",
55
"direction": "mt",
66
"gateway": 10,
7-
"href": "https://rest.messagebird.com/messages/6fe65f90454aa61536e6a88b88972670",
7+
"href": "https:\/\/rest.messagebird.com\/messages\/6fe65f90454aa61536e6a88b88972670",
88
"id": "6fe65f90454aa61536e6a88b88972670",
99
"mclass": 1,
1010
"originator": "TestName",

message/testdata/flashMessageObject.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"datacoding": "unicode",
55
"direction": "mt",
66
"gateway": 10,
7-
"href": "https://rest.messagebird.com/messages/6fe65f90454aa61536e6a88b88972670",
7+
"href": "https:\/\/rest.messagebird.com\/messages\/6fe65f90454aa61536e6a88b88972670",
88
"id": "6fe65f90454aa61536e6a88b88972670",
99
"mclass": 0,
1010
"originator": "TestName",
Lines changed: 71 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,72 @@
11
{
2-
"offset":0,
3-
"limit":20,
4-
"count":2,
5-
"totalCount":2,
6-
"links":{
7-
"first":"https://rest.messagebird.com/messages/?offset=0",
8-
"previous":null,
9-
"next":null,
10-
"last":"https://rest.messagebird.com/messages/?offset=0"
11-
},
12-
"items":[
13-
{
14-
"id":"6fe65f90454aa61536e6a88b88972670",
15-
"href":"https://rest.messagebird.com/messages/6fe65f90454aa61536e6a88b88972670",
16-
"direction":"mt",
17-
"type":"sms",
18-
"originator":"TestName",
19-
"body":"Hello World",
20-
"reference":null,
21-
"validity":null,
22-
"gateway":239,
23-
"typeDetails":{
24-
25-
},
26-
"datacoding":"plain",
27-
"mclass":1,
28-
"scheduledDatetime":null,
29-
"createdDatetime":"2015-01-05T10:02:59+00:00",
30-
"recipients":{
31-
"totalCount":1,
32-
"totalSentCount":1,
33-
"totalDeliveredCount":0,
34-
"totalDeliveryFailedCount":0,
35-
"items":[
36-
{
37-
"recipient":31612345678,
38-
"status":"sent",
39-
"statusDatetime":"2015-01-05T10:02:59+00:00"
40-
}
41-
]
42-
}
43-
},
44-
{
45-
"id":"6fe65f90454aa61536e6a88b88972670",
46-
"href":"https://rest.messagebird.com/messages/6fe65f90454aa61536e6a88b88972670",
47-
"direction":"mt",
48-
"type":"sms",
49-
"originator":"TestName",
50-
"body":"Hello World",
51-
"reference":null,
52-
"validity":null,
53-
"gateway":239,
54-
"typeDetails":{
55-
56-
},
57-
"datacoding":"plain",
58-
"mclass":1,
59-
"scheduledDatetime":null,
60-
"createdDatetime":"2015-01-05T10:02:59+00:00",
61-
"recipients":{
62-
"totalCount":1,
63-
"totalSentCount":1,
64-
"totalDeliveredCount":0,
65-
"totalDeliveryFailedCount":0,
66-
"items":[
67-
{
68-
"recipient":31612345678,
69-
"status":"sent",
70-
"statusDatetime":"2015-01-05T10:02:59+00:00"
71-
}
72-
]
73-
}
74-
}
75-
]
76-
}
2+
"offset": 0,
3+
"limit": 20,
4+
"count": 2,
5+
"totalCount": 2,
6+
"links": {
7+
"first": "https:\/\/rest.messagebird.com\/messages\/?offset=0",
8+
"previous": null,
9+
"next": null,
10+
"last": "https:\/\/rest.messagebird.com\/messages\/?offset=0"
11+
},
12+
"items": [
13+
{
14+
"id": "6fe65f90454aa61536e6a88b88972670",
15+
"href": "https:\/\/rest.messagebird.com\/messages\/6fe65f90454aa61536e6a88b88972670",
16+
"direction": "mt",
17+
"type": "sms",
18+
"originator": "TestName",
19+
"body": "Hello World",
20+
"reference": null,
21+
"validity": null,
22+
"gateway": 239,
23+
"typeDetails": {},
24+
"datacoding": "plain",
25+
"mclass": 1,
26+
"scheduledDatetime": null,
27+
"createdDatetime": "2015-01-05T10:02:59+00:00",
28+
"recipients": {
29+
"totalCount": 1,
30+
"totalSentCount": 1,
31+
"totalDeliveredCount": 0,
32+
"totalDeliveryFailedCount": 0,
33+
"items": [
34+
{
35+
"recipient": 31612345678,
36+
"status": "sent",
37+
"statusDatetime": "2015-01-05T10:02:59+00:00"
38+
}
39+
]
40+
}
41+
},
42+
{
43+
"id": "6fe65f90454aa61536e6a88b88972670",
44+
"href": "https:\/\/rest.messagebird.com\/messages\/6fe65f90454aa61536e6a88b88972670",
45+
"direction": "mt",
46+
"type": "sms",
47+
"originator": "TestName",
48+
"body": "Hello World",
49+
"reference": null,
50+
"validity": null,
51+
"gateway": 239,
52+
"typeDetails": {},
53+
"datacoding": "plain",
54+
"mclass": 1,
55+
"scheduledDatetime": null,
56+
"createdDatetime": "2015-01-05T10:02:59+00:00",
57+
"recipients": {
58+
"totalCount": 1,
59+
"totalSentCount": 1,
60+
"totalDeliveredCount": 0,
61+
"totalDeliveryFailedCount": 0,
62+
"items": [
63+
{
64+
"recipient": 31612345678,
65+
"status": "sent",
66+
"statusDatetime": "2015-01-05T10:02:59+00:00"
67+
}
68+
]
69+
}
70+
}
71+
]
72+
}

message/testdata/messageObject.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"datacoding": "plain",
55
"direction": "mt",
66
"gateway": 239,
7-
"href": "https://rest.messagebird.com/messages/6fe65f90454aa61536e6a88b88972670",
7+
"href": "https:\/\/rest.messagebird.com\/messages\/6fe65f90454aa61536e6a88b88972670",
88
"id": "6fe65f90454aa61536e6a88b88972670",
99
"mclass": 1,
1010
"originator": "TestName",

0 commit comments

Comments
 (0)