package main

type TestDefinitions struct {
	Name         string        `json:"name"`
	TestCases    []TestCase    `json:"testCases"`
	BaseUrl      string        `json:"url"`
	CaptureCases []CaptureCase `json:"capture"`
	Headers      map[string]string
	Insecure     bool `json:"insecure"`
}

type TestCase struct {
	Name        string
	Disabled    bool          `json:"disabled"`
	Path        string        `json:"path"`
	Method      string        `json:"method"`
	Description string        `json:"description"`
	Expect      ExpectOptions `json:"expect"`

	Header map[string]string
	//Body   map[string]string
	Body []byte

	// Something to store results in
	ResultStatusCode int
	ResultHeaders    map[string][]string
	ResultBody       string
	ResultBodyMap    map[string]interface{}
}

type CaptureCase struct {
	TestCaseName string
	CaptureData  CaptureCaseData
}

type CaptureCaseData struct {
	Header CaptureHeader `json:"header"`
	Body   CaptureBody   `json:"body"`
}

type CaptureHeader struct {
	Data map[string]string
}

type CaptureBody struct {
	Data map[string]string
}

type CaptureValues struct {
	Data map[string]string
}

type ExpectOptions struct {
	Header HeaderTests `json:"header"`
	Body   BodyTests   `json:"body"`
}

// Test types
type HeaderTests struct {
	Contains map[string]string
	Equals   map[string]string
}

type BodyTests struct {
	Contains     map[string]string
	Equals       map[string]string
	HasKeys      []string
	PathEquals   string
	PathContains map[string]string
}
