Debian Codegraph @

dynect/json.go

raw symbols SCIP
1 package dynect
2
3 /*
4 This struct represents the request body that would be sent to the DynECT API
5 for logging in and getting a session token for future requests.
6 */
7 type LoginBlock struct {
8 Username string `json:"user_name"`
9 Password string `json:"password"`
10 CustomerName string `json:"customer_name"`
11 }
12
13 // Type ResponseBlock holds the "header" information returned by any call to
14 // the DynECT API.
15 //
16 // All response-type structs should include this as an anonymous/embedded field.
17 type ResponseBlock struct {
18 Status string `json:"status"`
19 JobId int `json:"job_id,omitempty"`
20 Messages []MessageBlock `json:"msgs,omitempty"`
21 }
22
23 // Type MessageBlock holds the message information from the server, and is
24 // nested within the ResponseBlock type.
25 type MessageBlock struct {
26 Info string `json:"INFO"`
27 Source string `json:"SOURCE"`
28 ErrorCode string `json:"ERR_CD"`
29 Level string `json:"LVL"`
30 }
31
32 // Type LoginResponse holds the data returned by an HTTP POST call to
33 // https://api.dynect.net/REST/Session/.
34 type LoginResponse struct {
35 ResponseBlock
36 Data LoginDataBlock `json:"data"`
37 }
38
39 // Type LoginDataBlock holds the token and API version information from an HTTP
40 // POST call to https://api.dynect.net/REST/Session/.
41 //
42 // It is nested within the LoginResponse struct.
43 type LoginDataBlock struct {
44 Token string `json:"token"`
45 Version string `json:"version"`
46 }
47
48 // RecordRequest holds the request body for a record create/update
49 type RecordRequest struct {
50 RData DataBlock `json:"rdata"`
51 TTL string `json:"ttl,omitempty"`
52 }
53
54 // CreateZoneBlock holds the request body for a zone create
55 type CreateZoneBlock struct {
56 RName string `json:"rname"`
57 SerialStyle string `json:"serial_style,omitempty"`
58 TTL string `json:"ttl"`
59 }
60
61 // PublishZoneBlock holds the request body for a publish zone request
62 // https://help.dyn.com/update-zone-api/
63 type PublishZoneBlock struct {
64 Publish bool `json:"publish"`
65 }
66
67 //PublishZoneResponseBlock holds the response for a zone publish request
68 type PublishZoneResponseBlock struct {
69 Status string `json:"status"`
70 Data PublishZoneDataBlock `json:"data"`
71 JobID int `json:"job_id"`
72 Msgs string `json:"-"`
73 }
74
75 // PublishZoneDataBlock holds the response data filed for a zone publish request
76 type PublishZoneDataBlock struct {
77 TaskID string `json:"task_id"`
78 Serial int `json:"serial"`
79 SerialStyle string `json:"serial_style"`
80 Zone string `json:"zone"`
81 ZoneType string `json:"zone_type"`
82 }
83
84 // TaskStateResponse hold the response body of a get one DNS task request
85 // https://help.dyn.com/get-one-dns-task-api/
86 type TaskStateResponse struct {
87 Status string `json:"status"`
88 Blocking bool `json:"blocking"`
89 Data TaskStateResponseData `json:"data"`
90 }
91
92 // TaskStateResponseData hold the response data of a get one DNS task request
93 type TaskStateResponseData struct {
94 TaskID string `json:"task_id"`
95 Name string `json:"name"`
96 CustomerName string `json:"customer_name"`
97 ZoneName string `json:"zone_name"`
98 Status string `json:"status"`
99 StepCount int `json:"step_count"`
100 TotalSteps int `json:"total_steps"`
101 Blocking bool `json:"blocking"`
102 Debug string `json:"blocking,omitempty"`
103 CreateTS int `json:"created_ts"`
104 ModifiedTS int `json:"modified_ts"`
105 }