Skip to content

Commit

Permalink
feat: add request calls
Browse files Browse the repository at this point in the history
  • Loading branch information
grokify committed Oct 4, 2023
1 parent 6c74f11 commit b70dd87
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions requests.go
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"`
}

0 comments on commit b70dd87

Please sign in to comment.