Files
2024-01-19 11:33:42 +00:00

83 lines
2.3 KiB
Go

// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
package operations
import (
"github.com/formancehq/formance-sdk-go/v2/pkg/models/shared"
"net/http"
)
type RunScriptRequest struct {
Script shared.Script `request:"mediaType=application/json"`
// Name of the ledger.
Ledger string `pathParam:"style=simple,explode=false,name=ledger"`
// Set the preview mode. Preview mode doesn't add the logs to the database or publish a message to the message broker.
Preview *bool `queryParam:"style=form,explode=true,name=preview"`
}
func (o *RunScriptRequest) GetScript() shared.Script {
if o == nil {
return shared.Script{}
}
return o.Script
}
func (o *RunScriptRequest) GetLedger() string {
if o == nil {
return ""
}
return o.Ledger
}
func (o *RunScriptRequest) GetPreview() *bool {
if o == nil {
return nil
}
return o.Preview
}
type RunScriptResponse struct {
// HTTP response content type for this operation
ContentType string
// On success, it will return a 200 status code, and the resulting transaction under the `transaction` field.
//
// On failure, it will also return a 200 status code, and the following fields:
// - `details`: contains a URL. When there is an error parsing Numscript, the result can be difficult to read—the provided URL will render the error in an easy-to-read format.
// - `errorCode` and `error_code` (deprecated): contains the string code of the error
// - `errorMessage` and `error_message` (deprecated): contains a human-readable indication of what went wrong, for example that an account had insufficient funds, or that there was an error in the provided Numscript.
//
ScriptResponse *shared.ScriptResponse
// HTTP response status code for this operation
StatusCode int
// Raw HTTP response; suitable for custom response parsing
RawResponse *http.Response
}
func (o *RunScriptResponse) GetContentType() string {
if o == nil {
return ""
}
return o.ContentType
}
func (o *RunScriptResponse) GetScriptResponse() *shared.ScriptResponse {
if o == nil {
return nil
}
return o.ScriptResponse
}
func (o *RunScriptResponse) GetStatusCode() int {
if o == nil {
return 0
}
return o.StatusCode
}
func (o *RunScriptResponse) GetRawResponse() *http.Response {
if o == nil {
return nil
}
return o.RawResponse
}