Help us shape the future of Go! Take the 2026 Go Developer Survey

gentest

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package gentest provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCreateEricTestSimulationRequest

func NewCreateEricTestSimulationRequest(server string, tenantId Tenant, productId Product, params *CreateEricTestSimulationParams, body CreateEricTestSimulationJSONRequestBody) (*http.Request, error)

NewCreateEricTestSimulationRequest calls the generic CreateEricTestSimulation builder with application/json body

func NewCreateEricTestSimulationRequestWithBody

func NewCreateEricTestSimulationRequestWithBody(server string, tenantId Tenant, productId Product, params *CreateEricTestSimulationParams, contentType string, body io.Reader) (*http.Request, error)

NewCreateEricTestSimulationRequestWithBody constructs an http.Request for the CreateEricTestSimulation method, with any body, and a specified content type

func NewGetEricTestSimulationRequest

func NewGetEricTestSimulationRequest(server string, tenantId Tenant, productId Product, simulationId openapi_types.UUID, params *GetEricTestSimulationParams) (*http.Request, error)

NewGetEricTestSimulationRequest constructs an http.Request for the GetEricTestSimulation method

Types

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) CreateEricTestSimulation

func (c *Client) CreateEricTestSimulation(ctx context.Context, tenantId Tenant, productId Product, params *CreateEricTestSimulationParams, body CreateEricTestSimulationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateEricTestSimulation performs a POST /v1/tenants/{tenantId}/products/{productId}/simulations (the `CreateEricTestSimulation` operationId) request. Takes a body of the `application/json` content type.

func (*Client) CreateEricTestSimulationWithBody

func (c *Client) CreateEricTestSimulationWithBody(ctx context.Context, tenantId Tenant, productId Product, params *CreateEricTestSimulationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateEricTestSimulationWithBody performs a POST /v1/tenants/{tenantId}/products/{productId}/simulations (the `CreateEricTestSimulation` operationId) request, with any type of body and a specified content type.

func (*Client) GetEricTestSimulation

func (c *Client) GetEricTestSimulation(ctx context.Context, tenantId Tenant, productId Product, simulationId openapi_types.UUID, params *GetEricTestSimulationParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetEricTestSimulation performs a GET /v1/tenants/{tenantId}/products/{productId}/simulations/{simulationId} (the `GetEricTestSimulation` operationId) request.

type ClientInterface

type ClientInterface interface {

	// CreateEricTestSimulationWithBody performs a POST /v1/tenants/{tenantId}/products/{productId}/simulations (the `CreateEricTestSimulation` operationId) request,
	// with any type of body and a specified content type.
	CreateEricTestSimulationWithBody(ctx context.Context, tenantId Tenant, productId Product, params *CreateEricTestSimulationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateEricTestSimulation performs a POST /v1/tenants/{tenantId}/products/{productId}/simulations (the `CreateEricTestSimulation` operationId) request.
	// Takes a body of the `application/json` content type.
	CreateEricTestSimulation(ctx context.Context, tenantId Tenant, productId Product, params *CreateEricTestSimulationParams, body CreateEricTestSimulationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetEricTestSimulation performs a GET /v1/tenants/{tenantId}/products/{productId}/simulations/{simulationId} (the `GetEricTestSimulation` operationId) request.
	GetEricTestSimulation(ctx context.Context, tenantId Tenant, productId Product, simulationId openapi_types.UUID, params *GetEricTestSimulationParams, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) CreateEricTestSimulationWithBodyWithResponse

func (c *ClientWithResponses) CreateEricTestSimulationWithBodyWithResponse(ctx context.Context, tenantId Tenant, productId Product, params *CreateEricTestSimulationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEricTestSimulationResponse, error)

CreateEricTestSimulationWithBodyWithResponse performs a POST /v1/tenants/{tenantId}/products/{productId}/simulations (the `CreateEricTestSimulation` operationId) request, with any type of body and a specified content type.

Returns a wrapper object for the known response body format(s).

func (*ClientWithResponses) CreateEricTestSimulationWithResponse

func (c *ClientWithResponses) CreateEricTestSimulationWithResponse(ctx context.Context, tenantId Tenant, productId Product, params *CreateEricTestSimulationParams, body CreateEricTestSimulationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEricTestSimulationResponse, error)

CreateEricTestSimulationWithResponse performs a POST /v1/tenants/{tenantId}/products/{productId}/simulations (the `CreateEricTestSimulation` operationId) request. Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

func (*ClientWithResponses) GetEricTestSimulationWithResponse

func (c *ClientWithResponses) GetEricTestSimulationWithResponse(ctx context.Context, tenantId Tenant, productId Product, simulationId openapi_types.UUID, params *GetEricTestSimulationParams, reqEditors ...RequestEditorFn) (*GetEricTestSimulationResponse, error)

GetEricTestSimulationWithResponse performs a GET /v1/tenants/{tenantId}/products/{productId}/simulations/{simulationId} (the `GetEricTestSimulation` operationId) request.

Returns a wrapper object for the known response body format(s).

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {

	// CreateEricTestSimulationWithBodyWithResponse performs a POST /v1/tenants/{tenantId}/products/{productId}/simulations (the `CreateEricTestSimulation` operationId) request,
	// with any type of body and a specified content type.
	//
	// Returns a wrapper object for the known response body format(s).
	CreateEricTestSimulationWithBodyWithResponse(ctx context.Context, tenantId Tenant, productId Product, params *CreateEricTestSimulationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateEricTestSimulationResponse, error)

	// CreateEricTestSimulationWithResponse performs a POST /v1/tenants/{tenantId}/products/{productId}/simulations (the `CreateEricTestSimulation` operationId) request.
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	CreateEricTestSimulationWithResponse(ctx context.Context, tenantId Tenant, productId Product, params *CreateEricTestSimulationParams, body CreateEricTestSimulationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateEricTestSimulationResponse, error)

	// GetEricTestSimulationWithResponse performs a GET /v1/tenants/{tenantId}/products/{productId}/simulations/{simulationId} (the `GetEricTestSimulation` operationId) request.
	//
	// Returns a wrapper object for the known response body format(s).
	GetEricTestSimulationWithResponse(ctx context.Context, tenantId Tenant, productId Product, simulationId openapi_types.UUID, params *GetEricTestSimulationParams, reqEditors ...RequestEditorFn) (*GetEricTestSimulationResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type CreateEricTestSimulationJSONBody

type CreateEricTestSimulationJSONBody struct {
	Fixture interface{} `json:"fixture"`
}

CreateEricTestSimulationJSONBody defines parameters for CreateEricTestSimulation.

type CreateEricTestSimulationJSONRequestBody

type CreateEricTestSimulationJSONRequestBody CreateEricTestSimulationJSONBody

CreateEricTestSimulationJSONRequestBody defines body for CreateEricTestSimulation for application/json ContentType.

type CreateEricTestSimulationParams

type CreateEricTestSimulationParams struct {
	IdempotencyKey Idempotency  `json:"Idempotency-Key"`
	XERICTenant    TenantHeader `json:"X-ERIC-Tenant"`
}

CreateEricTestSimulationParams defines parameters for CreateEricTestSimulation.

type CreateEricTestSimulationResponse

type CreateEricTestSimulationResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON202 the response for an HTTP 202 `application/json` response
	JSON202 *Simulation
	// ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response
	ApplicationproblemJSONDefault *Problem
}

func ParseCreateEricTestSimulationResponse

func ParseCreateEricTestSimulationResponse(rsp *http.Response) (*CreateEricTestSimulationResponse, error)

ParseCreateEricTestSimulationResponse parses an HTTP response from a CreateEricTestSimulationWithResponse call

func (CreateEricTestSimulationResponse) ContentType

func (r CreateEricTestSimulationResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CreateEricTestSimulationResponse) GetApplicationproblemJSONDefault

func (r CreateEricTestSimulationResponse) GetApplicationproblemJSONDefault() *Problem

GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response

func (CreateEricTestSimulationResponse) GetBody

func (r CreateEricTestSimulationResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CreateEricTestSimulationResponse) GetJSON202

GetJSON202 returns the response for an HTTP 202 `application/json` response

func (CreateEricTestSimulationResponse) Status

Status returns HTTPResponse.Status

func (CreateEricTestSimulationResponse) StatusCode

func (r CreateEricTestSimulationResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetEricTestSimulationParams

type GetEricTestSimulationParams struct {
	XERICTenant TenantHeader `json:"X-ERIC-Tenant"`
}

GetEricTestSimulationParams defines parameters for GetEricTestSimulation.

type GetEricTestSimulationResponse

type GetEricTestSimulationResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Simulation
	// ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response
	ApplicationproblemJSONDefault *Problem
}

func ParseGetEricTestSimulationResponse

func ParseGetEricTestSimulationResponse(rsp *http.Response) (*GetEricTestSimulationResponse, error)

ParseGetEricTestSimulationResponse parses an HTTP response from a GetEricTestSimulationWithResponse call

func (GetEricTestSimulationResponse) ContentType

func (r GetEricTestSimulationResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetEricTestSimulationResponse) GetApplicationproblemJSONDefault

func (r GetEricTestSimulationResponse) GetApplicationproblemJSONDefault() *Problem

GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response

func (GetEricTestSimulationResponse) GetBody

func (r GetEricTestSimulationResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetEricTestSimulationResponse) GetJSON200

func (r GetEricTestSimulationResponse) GetJSON200() *Simulation

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetEricTestSimulationResponse) Status

Status returns HTTPResponse.Status

func (GetEricTestSimulationResponse) StatusCode

func (r GetEricTestSimulationResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type Idempotency

type Idempotency = string

Idempotency defines model for idempotency.

type Problem

type Problem = map[string]interface{}

Problem defines model for problem.

type Product

type Product = openapi_types.UUID

Product defines model for product.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type Simulation

type Simulation struct {
	Fixture   interface{}        `json:"fixture"`
	Id        openapi_types.UUID `json:"id"`
	Outcome   interface{}        `json:"outcome"`
	Simulated interface{}        `json:"simulated"`
	Status    interface{}        `json:"status"`
}

Simulation defines model for simulation.

type Tenant

type Tenant = openapi_types.UUID

Tenant defines model for tenant.

type TenantHeader

type TenantHeader = openapi_types.UUID

TenantHeader defines model for tenantHeader.

Jump to

Keyboard shortcuts

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