-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package saviyntconnectors | ||
|
||
import "encoding/json" | ||
|
||
type Requests struct { | ||
AccountIdPath string `json:"accountIdPath"` | ||
ResponseColsToPropsMap map[string]string `json:"responseColsToPropsMap"` | ||
Calls []Call `json:"call"` | ||
} | ||
|
||
func (r Requests) Bytes() ([]byte, error) { | ||
return json.Marshal(r) | ||
} | ||
|
||
func (r Requests) String() (string, error) { | ||
b, err := r.Bytes() | ||
if err != nil { | ||
return "", err | ||
} | ||
return string(b), nil | ||
} | ||
|
||
func (r Requests) MustString() string { | ||
s, err := r.String() | ||
if err != nil { | ||
panic(err) | ||
} | ||
return s | ||
} | ||
|
||
type Call struct { | ||
Connection string `json:"connection"` | ||
HTTPContentType string `json:"httpContentType"` | ||
HTTPHeaders map[string]string `json:"httpHeaders"` | ||
HTTPMethod string `json:"httpMethod"` | ||
HTTPParams string `json:"httpParams"` | ||
Name string `json:"name"` | ||
URL string `json:"url"` | ||
SuccessResponses Responses `json:"successResponses"` | ||
} | ||
|
||
type Responses struct { | ||
StatusCodes []uint `json:"statusCode"` | ||
} |