requestgen

package
v1.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRequestContext

func GenerateRequestContext(forProvider interfaces.MappedHTTPRequestSpec, patchedResponse interfaces.HTTPResponse) map[string]interface{}

GenerateRequestContext creates a JSON-compatible map from the specified Request's ForProvider and Response fields. It merges the two maps, converts JSON strings to nested maps, and returns the resulting map.

func IsRequestValid

func IsRequestValid(requestDetails RequestDetails) bool

IsRequestValid checks if the request details are valid.

Types

type RequestDetails

type RequestDetails struct {
	Url     string
	Body    httpClient.Data
	Headers httpClient.Data
}

func GenerateRequestDetails

func GenerateRequestDetails(svcCtx *service.ServiceContext, methodMapping interfaces.HTTPMapping, forProvider interfaces.MappedHTTPRequestSpec, response interfaces.HTTPResponse) (RequestDetails, error, bool)

GenerateRequestDetails generates request details.

func GenerateValidRequestDetails

func GenerateValidRequestDetails(svcCtx *service.ServiceContext, crCtx *service.RequestCRContext, mapping interfaces.HTTPMapping) (RequestDetails, error)

GenerateValidRequestDetails generates valid request details based on the given Request resource and Mapping configuration. It first attempts to generate request details using the HTTP response stored in the Request's status. If the generated details are valid, the function returns them. If not, it falls back to using the cached response in the Request's status and attempts to generate request details again. The function returns the generated request details or an error if the generation process fails.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL