// Package helloworldv3 provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.6.0 DO NOT EDIT.
package helloworldv3

import (
	"context"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"net/url"
	"strings"

	"github.com/oapi-codegen/runtime"
)

// GoogleRpcStatus The Status type defines a logical error model suitable for different programming environments.
type GoogleRpcStatus struct {
	// Code The status code, which should be an enum value of google.rpc.Code.
	Code *int32 `json:"code,omitempty"`

	// Details A list of messages that carry the error details.
	Details *[]GoogleRpcStatus_Details_Item `json:"details,omitempty"`

	// Message A developer-facing error message.
	Message *string `json:"message,omitempty"`
}

// GoogleRpcStatus_Details_Item defines model for google.rpc.Status.details.Item.
type GoogleRpcStatus_Details_Item struct {
	Type                 *string                `json:"@type,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

// GrpcGatewayExamplesInternalHelloworldHelloReply defines model for grpc.gateway.examples.internal.helloworld.HelloReply.
type GrpcGatewayExamplesInternalHelloworldHelloReply struct {
	Message *string `json:"message,omitempty"`
}

// GreeterSayHello4Params defines parameters for GreeterSayHello4.
type GreeterSayHello4Params struct {
	Name      *string  `form:"name,omitempty" json:"name,omitempty"`
	StrVal    *string  `form:"strVal,omitempty" json:"strVal,omitempty"`
	FloatVal  *float32 `form:"floatVal,omitempty" json:"floatVal,omitempty"`
	DoubleVal *float64 `form:"doubleVal,omitempty" json:"doubleVal,omitempty"`
	BytesVal  *[]byte  `form:"bytesVal,omitempty" json:"bytesVal,omitempty"`
	Int32Val  *int32   `form:"int32Val,omitempty" json:"int32Val,omitempty"`
	Uint32Val *int64   `form:"uint32Val,omitempty" json:"uint32Val,omitempty"`
	Int64Val  *string  `form:"int64Val,omitempty" json:"int64Val,omitempty"`
	Uint64Val *string  `form:"uint64Val,omitempty" json:"uint64Val,omitempty"`
}

// GreeterSayHello5Params defines parameters for GreeterSayHello5.
type GreeterSayHello5Params struct {
	Name      *string  `form:"name,omitempty" json:"name,omitempty"`
	StrVal    *string  `form:"strVal,omitempty" json:"strVal,omitempty"`
	FloatVal  *float32 `form:"floatVal,omitempty" json:"floatVal,omitempty"`
	DoubleVal *float64 `form:"doubleVal,omitempty" json:"doubleVal,omitempty"`
	BoolVal   *bool    `form:"boolVal,omitempty" json:"boolVal,omitempty"`
	Int32Val  *int32   `form:"int32Val,omitempty" json:"int32Val,omitempty"`
	Uint32Val *int64   `form:"uint32Val,omitempty" json:"uint32Val,omitempty"`
	Int64Val  *string  `form:"int64Val,omitempty" json:"int64Val,omitempty"`
	Uint64Val *string  `form:"uint64Val,omitempty" json:"uint64Val,omitempty"`
}

// GreeterSayHello3Params defines parameters for GreeterSayHello3.
type GreeterSayHello3Params struct {
	Name      *string  `form:"name,omitempty" json:"name,omitempty"`
	StrVal    *string  `form:"strVal,omitempty" json:"strVal,omitempty"`
	FloatVal  *float32 `form:"floatVal,omitempty" json:"floatVal,omitempty"`
	BoolVal   *bool    `form:"boolVal,omitempty" json:"boolVal,omitempty"`
	BytesVal  *[]byte  `form:"bytesVal,omitempty" json:"bytesVal,omitempty"`
	Int32Val  *int32   `form:"int32Val,omitempty" json:"int32Val,omitempty"`
	Uint32Val *int64   `form:"uint32Val,omitempty" json:"uint32Val,omitempty"`
	Int64Val  *string  `form:"int64Val,omitempty" json:"int64Val,omitempty"`
	Uint64Val *string  `form:"uint64Val,omitempty" json:"uint64Val,omitempty"`
}

// GreeterSayHello2Params defines parameters for GreeterSayHello2.
type GreeterSayHello2Params struct {
	Name      *string  `form:"name,omitempty" json:"name,omitempty"`
	StrVal    *string  `form:"strVal,omitempty" json:"strVal,omitempty"`
	DoubleVal *float64 `form:"doubleVal,omitempty" json:"doubleVal,omitempty"`
	BoolVal   *bool    `form:"boolVal,omitempty" json:"boolVal,omitempty"`
	BytesVal  *[]byte  `form:"bytesVal,omitempty" json:"bytesVal,omitempty"`
	Int32Val  *int32   `form:"int32Val,omitempty" json:"int32Val,omitempty"`
	Uint32Val *int64   `form:"uint32Val,omitempty" json:"uint32Val,omitempty"`
	Int64Val  *string  `form:"int64Val,omitempty" json:"int64Val,omitempty"`
	Uint64Val *string  `form:"uint64Val,omitempty" json:"uint64Val,omitempty"`
}

// GreeterSayHello6Params defines parameters for GreeterSayHello6.
type GreeterSayHello6Params struct {
	Name      *string  `form:"name,omitempty" json:"name,omitempty"`
	StrVal    *string  `form:"strVal,omitempty" json:"strVal,omitempty"`
	FloatVal  *float32 `form:"floatVal,omitempty" json:"floatVal,omitempty"`
	DoubleVal *float64 `form:"doubleVal,omitempty" json:"doubleVal,omitempty"`
	BoolVal   *bool    `form:"boolVal,omitempty" json:"boolVal,omitempty"`
	BytesVal  *[]byte  `form:"bytesVal,omitempty" json:"bytesVal,omitempty"`
	Uint32Val *int64   `form:"uint32Val,omitempty" json:"uint32Val,omitempty"`
	Int64Val  *string  `form:"int64Val,omitempty" json:"int64Val,omitempty"`
	Uint64Val *string  `form:"uint64Val,omitempty" json:"uint64Val,omitempty"`
}

// GreeterSayHello8Params defines parameters for GreeterSayHello8.
type GreeterSayHello8Params struct {
	Name      *string  `form:"name,omitempty" json:"name,omitempty"`
	StrVal    *string  `form:"strVal,omitempty" json:"strVal,omitempty"`
	FloatVal  *float32 `form:"floatVal,omitempty" json:"floatVal,omitempty"`
	DoubleVal *float64 `form:"doubleVal,omitempty" json:"doubleVal,omitempty"`
	BoolVal   *bool    `form:"boolVal,omitempty" json:"boolVal,omitempty"`
	BytesVal  *[]byte  `form:"bytesVal,omitempty" json:"bytesVal,omitempty"`
	Int32Val  *int32   `form:"int32Val,omitempty" json:"int32Val,omitempty"`
	Uint32Val *int64   `form:"uint32Val,omitempty" json:"uint32Val,omitempty"`
	Uint64Val *string  `form:"uint64Val,omitempty" json:"uint64Val,omitempty"`
}

// GreeterSayHello1Params defines parameters for GreeterSayHello1.
type GreeterSayHello1Params struct {
	Name      *string  `form:"name,omitempty" json:"name,omitempty"`
	FloatVal  *float32 `form:"floatVal,omitempty" json:"floatVal,omitempty"`
	DoubleVal *float64 `form:"doubleVal,omitempty" json:"doubleVal,omitempty"`
	BoolVal   *bool    `form:"boolVal,omitempty" json:"boolVal,omitempty"`
	BytesVal  *[]byte  `form:"bytesVal,omitempty" json:"bytesVal,omitempty"`
	Int32Val  *int32   `form:"int32Val,omitempty" json:"int32Val,omitempty"`
	Uint32Val *int64   `form:"uint32Val,omitempty" json:"uint32Val,omitempty"`
	Int64Val  *string  `form:"int64Val,omitempty" json:"int64Val,omitempty"`
	Uint64Val *string  `form:"uint64Val,omitempty" json:"uint64Val,omitempty"`
}

// GreeterSayHello7Params defines parameters for GreeterSayHello7.
type GreeterSayHello7Params struct {
	Name      *string  `form:"name,omitempty" json:"name,omitempty"`
	StrVal    *string  `form:"strVal,omitempty" json:"strVal,omitempty"`
	FloatVal  *float32 `form:"floatVal,omitempty" json:"floatVal,omitempty"`
	DoubleVal *float64 `form:"doubleVal,omitempty" json:"doubleVal,omitempty"`
	BoolVal   *bool    `form:"boolVal,omitempty" json:"boolVal,omitempty"`
	BytesVal  *[]byte  `form:"bytesVal,omitempty" json:"bytesVal,omitempty"`
	Int32Val  *int32   `form:"int32Val,omitempty" json:"int32Val,omitempty"`
	Int64Val  *string  `form:"int64Val,omitempty" json:"int64Val,omitempty"`
	Uint64Val *string  `form:"uint64Val,omitempty" json:"uint64Val,omitempty"`
}

// GreeterSayHello9Params defines parameters for GreeterSayHello9.
type GreeterSayHello9Params struct {
	Name      *string  `form:"name,omitempty" json:"name,omitempty"`
	StrVal    *string  `form:"strVal,omitempty" json:"strVal,omitempty"`
	FloatVal  *float32 `form:"floatVal,omitempty" json:"floatVal,omitempty"`
	DoubleVal *float64 `form:"doubleVal,omitempty" json:"doubleVal,omitempty"`
	BoolVal   *bool    `form:"boolVal,omitempty" json:"boolVal,omitempty"`
	BytesVal  *[]byte  `form:"bytesVal,omitempty" json:"bytesVal,omitempty"`
	Int32Val  *int32   `form:"int32Val,omitempty" json:"int32Val,omitempty"`
	Uint32Val *int64   `form:"uint32Val,omitempty" json:"uint32Val,omitempty"`
	Int64Val  *string  `form:"int64Val,omitempty" json:"int64Val,omitempty"`
}

// GreeterSayHelloParams defines parameters for GreeterSayHello.
type GreeterSayHelloParams struct {
	StrVal    *string  `form:"strVal,omitempty" json:"strVal,omitempty"`
	FloatVal  *float32 `form:"floatVal,omitempty" json:"floatVal,omitempty"`
	DoubleVal *float64 `form:"doubleVal,omitempty" json:"doubleVal,omitempty"`
	BoolVal   *bool    `form:"boolVal,omitempty" json:"boolVal,omitempty"`
	BytesVal  *[]byte  `form:"bytesVal,omitempty" json:"bytesVal,omitempty"`
	Int32Val  *int32   `form:"int32Val,omitempty" json:"int32Val,omitempty"`
	Uint32Val *int64   `form:"uint32Val,omitempty" json:"uint32Val,omitempty"`
	Int64Val  *string  `form:"int64Val,omitempty" json:"int64Val,omitempty"`
	Uint64Val *string  `form:"uint64Val,omitempty" json:"uint64Val,omitempty"`
}

// Getter for additional properties for GoogleRpcStatus_Details_Item. Returns the specified
// element and whether it was found
func (a GoogleRpcStatus_Details_Item) Get(fieldName string) (value interface{}, found bool) {
	if a.AdditionalProperties != nil {
		value, found = a.AdditionalProperties[fieldName]
	}
	return
}

// Setter for additional properties for GoogleRpcStatus_Details_Item
func (a *GoogleRpcStatus_Details_Item) Set(fieldName string, value interface{}) {
	if a.AdditionalProperties == nil {
		a.AdditionalProperties = make(map[string]interface{})
	}
	a.AdditionalProperties[fieldName] = value
}

// Override default JSON handling for GoogleRpcStatus_Details_Item to handle AdditionalProperties
func (a *GoogleRpcStatus_Details_Item) UnmarshalJSON(b []byte) error {
	object := make(map[string]json.RawMessage)
	err := json.Unmarshal(b, &object)
	if err != nil {
		return err
	}

	if raw, found := object["@type"]; found {
		err = json.Unmarshal(raw, &a.Type)
		if err != nil {
			return fmt.Errorf("error reading '@type': %w", err)
		}
		delete(object, "@type")
	}

	if len(object) != 0 {
		a.AdditionalProperties = make(map[string]interface{})
		for fieldName, fieldBuf := range object {
			var fieldVal interface{}
			err := json.Unmarshal(fieldBuf, &fieldVal)
			if err != nil {
				return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err)
			}
			a.AdditionalProperties[fieldName] = fieldVal
		}
	}
	return nil
}

// Override default JSON handling for GoogleRpcStatus_Details_Item to handle AdditionalProperties
func (a GoogleRpcStatus_Details_Item) MarshalJSON() ([]byte, error) {
	var err error
	object := make(map[string]json.RawMessage)

	if a.Type != nil {
		object["@type"], err = json.Marshal(a.Type)
		if err != nil {
			return nil, fmt.Errorf("error marshaling '@type': %w", err)
		}
	}

	for fieldName, field := range a.AdditionalProperties {
		object[fieldName], err = json.Marshal(field)
		if err != nil {
			return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err)
		}
	}
	return json.Marshal(object)
}

// RequestEditorFn  is the function signature for the RequestEditor callback function
type RequestEditorFn func(ctx context.Context, req *http.Request) error

// Doer performs HTTP requests.
//
// The standard http.Client implements this interface.
type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

// Client which conforms to the OpenAPI3 specification for this service.
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
}

// ClientOption allows setting custom parameters during construction
type ClientOption func(*Client) error

// Creates a new Client, with reasonable defaults
func NewClient(server string, opts ...ClientOption) (*Client, error) {
	// create a client with sane default values
	client := Client{
		Server: server,
	}
	// mutate client and add all optional params
	for _, o := range opts {
		if err := o(&client); err != nil {
			return nil, err
		}
	}
	// ensure the server URL always has a trailing slash
	if !strings.HasSuffix(client.Server, "/") {
		client.Server += "/"
	}
	// create httpClient, if not already present
	if client.Client == nil {
		client.Client = &http.Client{}
	}
	return &client, nil
}

// WithHTTPClient allows overriding the default Doer, which is
// automatically created using http.Client. This is useful for tests.
func WithHTTPClient(doer HttpRequestDoer) ClientOption {
	return func(c *Client) error {
		c.Client = doer
		return nil
	}
}

// WithRequestEditorFn allows setting up a callback function, which will be
// called right before sending the request. This can be used to mutate the request.
func WithRequestEditorFn(fn RequestEditorFn) ClientOption {
	return func(c *Client) error {
		c.RequestEditors = append(c.RequestEditors, fn)
		return nil
	}
}

// The interface specification for the client above.
type ClientInterface interface {
	// GreeterSayHello4 request
	GreeterSayHello4(ctx context.Context, boolVal bool, params *GreeterSayHello4Params, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GreeterSayHello5 request
	GreeterSayHello5(ctx context.Context, bytesVal []byte, params *GreeterSayHello5Params, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GreeterSayHello3 request
	GreeterSayHello3(ctx context.Context, doubleVal float64, params *GreeterSayHello3Params, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GreeterSayHello2 request
	GreeterSayHello2(ctx context.Context, floatVal float32, params *GreeterSayHello2Params, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GreeterSayHello6 request
	GreeterSayHello6(ctx context.Context, int32Val int32, params *GreeterSayHello6Params, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GreeterSayHello8 request
	GreeterSayHello8(ctx context.Context, int64Val string, params *GreeterSayHello8Params, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GreeterSayHello1 request
	GreeterSayHello1(ctx context.Context, strVal string, params *GreeterSayHello1Params, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GreeterSayHello7 request
	GreeterSayHello7(ctx context.Context, uint32Val int64, params *GreeterSayHello7Params, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GreeterSayHello9 request
	GreeterSayHello9(ctx context.Context, uint64Val string, params *GreeterSayHello9Params, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GreeterSayHello request
	GreeterSayHello(ctx context.Context, name string, params *GreeterSayHelloParams, reqEditors ...RequestEditorFn) (*http.Response, error)
}

func (c *Client) GreeterSayHello4(ctx context.Context, boolVal bool, params *GreeterSayHello4Params, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewGreeterSayHello4Request(c.Server, boolVal, params)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) GreeterSayHello5(ctx context.Context, bytesVal []byte, params *GreeterSayHello5Params, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewGreeterSayHello5Request(c.Server, bytesVal, params)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) GreeterSayHello3(ctx context.Context, doubleVal float64, params *GreeterSayHello3Params, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewGreeterSayHello3Request(c.Server, doubleVal, params)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) GreeterSayHello2(ctx context.Context, floatVal float32, params *GreeterSayHello2Params, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewGreeterSayHello2Request(c.Server, floatVal, params)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) GreeterSayHello6(ctx context.Context, int32Val int32, params *GreeterSayHello6Params, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewGreeterSayHello6Request(c.Server, int32Val, params)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) GreeterSayHello8(ctx context.Context, int64Val string, params *GreeterSayHello8Params, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewGreeterSayHello8Request(c.Server, int64Val, params)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) GreeterSayHello1(ctx context.Context, strVal string, params *GreeterSayHello1Params, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewGreeterSayHello1Request(c.Server, strVal, params)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) GreeterSayHello7(ctx context.Context, uint32Val int64, params *GreeterSayHello7Params, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewGreeterSayHello7Request(c.Server, uint32Val, params)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) GreeterSayHello9(ctx context.Context, uint64Val string, params *GreeterSayHello9Params, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewGreeterSayHello9Request(c.Server, uint64Val, params)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) GreeterSayHello(ctx context.Context, name string, params *GreeterSayHelloParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewGreeterSayHelloRequest(c.Server, name, params)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

// NewGreeterSayHello4Request generates requests for GreeterSayHello4
func NewGreeterSayHello4Request(server string, boolVal bool, params *GreeterSayHello4Params) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithOptions("simple", false, "boolVal", boolVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "boolean", Format: ""})
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/say/boolval/%s", pathParam0)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	if params != nil {
		queryValues := queryURL.Query()

		if params.Name != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "name", *params.Name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.StrVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "strVal", *params.StrVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.FloatVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "floatVal", *params.FloatVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "number", Format: "float"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.DoubleVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "doubleVal", *params.DoubleVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "number", Format: "double"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.BytesVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "bytesVal", *params.BytesVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "byte"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Int32Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "int32Val", *params.Int32Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Uint32Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "uint32Val", *params.Uint32Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Int64Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "int64Val", *params.Int64Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "int64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Uint64Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "uint64Val", *params.Uint64Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "uint64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		queryURL.RawQuery = queryValues.Encode()
	}

	req, err := http.NewRequest("GET", queryURL.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

// NewGreeterSayHello5Request generates requests for GreeterSayHello5
func NewGreeterSayHello5Request(server string, bytesVal []byte, params *GreeterSayHello5Params) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithOptions("simple", false, "bytesVal", bytesVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "byte"})
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/say/bytesval/%s", pathParam0)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	if params != nil {
		queryValues := queryURL.Query()

		if params.Name != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "name", *params.Name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.StrVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "strVal", *params.StrVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.FloatVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "floatVal", *params.FloatVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "number", Format: "float"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.DoubleVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "doubleVal", *params.DoubleVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "number", Format: "double"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.BoolVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "boolVal", *params.BoolVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Int32Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "int32Val", *params.Int32Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Uint32Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "uint32Val", *params.Uint32Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Int64Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "int64Val", *params.Int64Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "int64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Uint64Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "uint64Val", *params.Uint64Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "uint64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		queryURL.RawQuery = queryValues.Encode()
	}

	req, err := http.NewRequest("GET", queryURL.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

// NewGreeterSayHello3Request generates requests for GreeterSayHello3
func NewGreeterSayHello3Request(server string, doubleVal float64, params *GreeterSayHello3Params) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithOptions("simple", false, "doubleVal", doubleVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "number", Format: "double"})
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/say/doubleval/%s", pathParam0)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	if params != nil {
		queryValues := queryURL.Query()

		if params.Name != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "name", *params.Name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.StrVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "strVal", *params.StrVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.FloatVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "floatVal", *params.FloatVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "number", Format: "float"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.BoolVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "boolVal", *params.BoolVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.BytesVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "bytesVal", *params.BytesVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "byte"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Int32Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "int32Val", *params.Int32Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Uint32Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "uint32Val", *params.Uint32Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Int64Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "int64Val", *params.Int64Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "int64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Uint64Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "uint64Val", *params.Uint64Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "uint64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		queryURL.RawQuery = queryValues.Encode()
	}

	req, err := http.NewRequest("GET", queryURL.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

// NewGreeterSayHello2Request generates requests for GreeterSayHello2
func NewGreeterSayHello2Request(server string, floatVal float32, params *GreeterSayHello2Params) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithOptions("simple", false, "floatVal", floatVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "number", Format: "float"})
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/say/floatval/%s", pathParam0)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	if params != nil {
		queryValues := queryURL.Query()

		if params.Name != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "name", *params.Name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.StrVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "strVal", *params.StrVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.DoubleVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "doubleVal", *params.DoubleVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "number", Format: "double"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.BoolVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "boolVal", *params.BoolVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.BytesVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "bytesVal", *params.BytesVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "byte"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Int32Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "int32Val", *params.Int32Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Uint32Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "uint32Val", *params.Uint32Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Int64Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "int64Val", *params.Int64Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "int64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Uint64Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "uint64Val", *params.Uint64Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "uint64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		queryURL.RawQuery = queryValues.Encode()
	}

	req, err := http.NewRequest("GET", queryURL.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

// NewGreeterSayHello6Request generates requests for GreeterSayHello6
func NewGreeterSayHello6Request(server string, int32Val int32, params *GreeterSayHello6Params) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithOptions("simple", false, "int32Val", int32Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: "int32"})
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/say/int32val/%s", pathParam0)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	if params != nil {
		queryValues := queryURL.Query()

		if params.Name != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "name", *params.Name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.StrVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "strVal", *params.StrVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.FloatVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "floatVal", *params.FloatVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "number", Format: "float"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.DoubleVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "doubleVal", *params.DoubleVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "number", Format: "double"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.BoolVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "boolVal", *params.BoolVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.BytesVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "bytesVal", *params.BytesVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "byte"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Uint32Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "uint32Val", *params.Uint32Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Int64Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "int64Val", *params.Int64Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "int64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Uint64Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "uint64Val", *params.Uint64Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "uint64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		queryURL.RawQuery = queryValues.Encode()
	}

	req, err := http.NewRequest("GET", queryURL.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

// NewGreeterSayHello8Request generates requests for GreeterSayHello8
func NewGreeterSayHello8Request(server string, int64Val string, params *GreeterSayHello8Params) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithOptions("simple", false, "int64Val", int64Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "int64"})
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/say/int64val/%s", pathParam0)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	if params != nil {
		queryValues := queryURL.Query()

		if params.Name != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "name", *params.Name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.StrVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "strVal", *params.StrVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.FloatVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "floatVal", *params.FloatVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "number", Format: "float"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.DoubleVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "doubleVal", *params.DoubleVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "number", Format: "double"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.BoolVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "boolVal", *params.BoolVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.BytesVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "bytesVal", *params.BytesVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "byte"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Int32Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "int32Val", *params.Int32Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Uint32Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "uint32Val", *params.Uint32Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Uint64Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "uint64Val", *params.Uint64Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "uint64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		queryURL.RawQuery = queryValues.Encode()
	}

	req, err := http.NewRequest("GET", queryURL.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

// NewGreeterSayHello1Request generates requests for GreeterSayHello1
func NewGreeterSayHello1Request(server string, strVal string, params *GreeterSayHello1Params) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithOptions("simple", false, "strVal", strVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""})
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/say/strval/%s", pathParam0)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	if params != nil {
		queryValues := queryURL.Query()

		if params.Name != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "name", *params.Name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.FloatVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "floatVal", *params.FloatVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "number", Format: "float"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.DoubleVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "doubleVal", *params.DoubleVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "number", Format: "double"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.BoolVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "boolVal", *params.BoolVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.BytesVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "bytesVal", *params.BytesVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "byte"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Int32Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "int32Val", *params.Int32Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Uint32Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "uint32Val", *params.Uint32Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Int64Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "int64Val", *params.Int64Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "int64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Uint64Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "uint64Val", *params.Uint64Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "uint64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		queryURL.RawQuery = queryValues.Encode()
	}

	req, err := http.NewRequest("GET", queryURL.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

// NewGreeterSayHello7Request generates requests for GreeterSayHello7
func NewGreeterSayHello7Request(server string, uint32Val int64, params *GreeterSayHello7Params) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithOptions("simple", false, "uint32Val", uint32Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "integer", Format: "int64"})
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/say/uint32val/%s", pathParam0)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	if params != nil {
		queryValues := queryURL.Query()

		if params.Name != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "name", *params.Name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.StrVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "strVal", *params.StrVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.FloatVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "floatVal", *params.FloatVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "number", Format: "float"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.DoubleVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "doubleVal", *params.DoubleVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "number", Format: "double"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.BoolVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "boolVal", *params.BoolVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.BytesVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "bytesVal", *params.BytesVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "byte"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Int32Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "int32Val", *params.Int32Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Int64Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "int64Val", *params.Int64Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "int64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Uint64Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "uint64Val", *params.Uint64Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "uint64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		queryURL.RawQuery = queryValues.Encode()
	}

	req, err := http.NewRequest("GET", queryURL.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

// NewGreeterSayHello9Request generates requests for GreeterSayHello9
func NewGreeterSayHello9Request(server string, uint64Val string, params *GreeterSayHello9Params) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithOptions("simple", false, "uint64Val", uint64Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uint64"})
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/say/uint64val/%s", pathParam0)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	if params != nil {
		queryValues := queryURL.Query()

		if params.Name != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "name", *params.Name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.StrVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "strVal", *params.StrVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.FloatVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "floatVal", *params.FloatVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "number", Format: "float"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.DoubleVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "doubleVal", *params.DoubleVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "number", Format: "double"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.BoolVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "boolVal", *params.BoolVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.BytesVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "bytesVal", *params.BytesVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "byte"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Int32Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "int32Val", *params.Int32Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Uint32Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "uint32Val", *params.Uint32Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Int64Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "int64Val", *params.Int64Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "int64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		queryURL.RawQuery = queryValues.Encode()
	}

	req, err := http.NewRequest("GET", queryURL.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

// NewGreeterSayHelloRequest generates requests for GreeterSayHello
func NewGreeterSayHelloRequest(server string, name string, params *GreeterSayHelloParams) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithOptions("simple", false, "name", name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""})
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/say/%s", pathParam0)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	if params != nil {
		queryValues := queryURL.Query()

		if params.StrVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "strVal", *params.StrVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.FloatVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "floatVal", *params.FloatVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "number", Format: "float"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.DoubleVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "doubleVal", *params.DoubleVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "number", Format: "double"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.BoolVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "boolVal", *params.BoolVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.BytesVal != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "bytesVal", *params.BytesVal, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "byte"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Int32Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "int32Val", *params.Int32Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int32"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Uint32Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "uint32Val", *params.Uint32Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: "int64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Int64Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "int64Val", *params.Int64Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "int64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Uint64Val != nil {

			if queryFrag, err := runtime.StyleParamWithOptions("form", true, "uint64Val", *params.Uint64Val, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "uint64"}); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		queryURL.RawQuery = queryValues.Encode()
	}

	req, err := http.NewRequest("GET", queryURL.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error {
	for _, r := range c.RequestEditors {
		if err := r(ctx, req); err != nil {
			return err
		}
	}
	for _, r := range additionalEditors {
		if err := r(ctx, req); err != nil {
			return err
		}
	}
	return nil
}

// ClientWithResponses builds on ClientInterface to offer response payloads
type ClientWithResponses struct {
	ClientInterface
}

// NewClientWithResponses creates a new ClientWithResponses, which wraps
// Client with return type handling
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) {
	client, err := NewClient(server, opts...)
	if err != nil {
		return nil, err
	}
	return &ClientWithResponses{client}, nil
}

// WithBaseURL overrides the baseURL.
func WithBaseURL(baseURL string) ClientOption {
	return func(c *Client) error {
		newBaseURL, err := url.Parse(baseURL)
		if err != nil {
			return err
		}
		c.Server = newBaseURL.String()
		return nil
	}
}

// ClientWithResponsesInterface is the interface specification for the client with responses above.
type ClientWithResponsesInterface interface {
	// GreeterSayHello4WithResponse request
	GreeterSayHello4WithResponse(ctx context.Context, boolVal bool, params *GreeterSayHello4Params, reqEditors ...RequestEditorFn) (*GreeterSayHello4Response, error)

	// GreeterSayHello5WithResponse request
	GreeterSayHello5WithResponse(ctx context.Context, bytesVal []byte, params *GreeterSayHello5Params, reqEditors ...RequestEditorFn) (*GreeterSayHello5Response, error)

	// GreeterSayHello3WithResponse request
	GreeterSayHello3WithResponse(ctx context.Context, doubleVal float64, params *GreeterSayHello3Params, reqEditors ...RequestEditorFn) (*GreeterSayHello3Response, error)

	// GreeterSayHello2WithResponse request
	GreeterSayHello2WithResponse(ctx context.Context, floatVal float32, params *GreeterSayHello2Params, reqEditors ...RequestEditorFn) (*GreeterSayHello2Response, error)

	// GreeterSayHello6WithResponse request
	GreeterSayHello6WithResponse(ctx context.Context, int32Val int32, params *GreeterSayHello6Params, reqEditors ...RequestEditorFn) (*GreeterSayHello6Response, error)

	// GreeterSayHello8WithResponse request
	GreeterSayHello8WithResponse(ctx context.Context, int64Val string, params *GreeterSayHello8Params, reqEditors ...RequestEditorFn) (*GreeterSayHello8Response, error)

	// GreeterSayHello1WithResponse request
	GreeterSayHello1WithResponse(ctx context.Context, strVal string, params *GreeterSayHello1Params, reqEditors ...RequestEditorFn) (*GreeterSayHello1Response, error)

	// GreeterSayHello7WithResponse request
	GreeterSayHello7WithResponse(ctx context.Context, uint32Val int64, params *GreeterSayHello7Params, reqEditors ...RequestEditorFn) (*GreeterSayHello7Response, error)

	// GreeterSayHello9WithResponse request
	GreeterSayHello9WithResponse(ctx context.Context, uint64Val string, params *GreeterSayHello9Params, reqEditors ...RequestEditorFn) (*GreeterSayHello9Response, error)

	// GreeterSayHelloWithResponse request
	GreeterSayHelloWithResponse(ctx context.Context, name string, params *GreeterSayHelloParams, reqEditors ...RequestEditorFn) (*GreeterSayHelloResponse, error)
}

type GreeterSayHello4Response struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *GrpcGatewayExamplesInternalHelloworldHelloReply
	JSONDefault  *GoogleRpcStatus
}

// Status returns HTTPResponse.Status
func (r GreeterSayHello4Response) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r GreeterSayHello4Response) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type GreeterSayHello5Response struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *GrpcGatewayExamplesInternalHelloworldHelloReply
	JSONDefault  *GoogleRpcStatus
}

// Status returns HTTPResponse.Status
func (r GreeterSayHello5Response) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r GreeterSayHello5Response) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type GreeterSayHello3Response struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *GrpcGatewayExamplesInternalHelloworldHelloReply
	JSONDefault  *GoogleRpcStatus
}

// Status returns HTTPResponse.Status
func (r GreeterSayHello3Response) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r GreeterSayHello3Response) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type GreeterSayHello2Response struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *GrpcGatewayExamplesInternalHelloworldHelloReply
	JSONDefault  *GoogleRpcStatus
}

// Status returns HTTPResponse.Status
func (r GreeterSayHello2Response) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r GreeterSayHello2Response) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type GreeterSayHello6Response struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *GrpcGatewayExamplesInternalHelloworldHelloReply
	JSONDefault  *GoogleRpcStatus
}

// Status returns HTTPResponse.Status
func (r GreeterSayHello6Response) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r GreeterSayHello6Response) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type GreeterSayHello8Response struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *GrpcGatewayExamplesInternalHelloworldHelloReply
	JSONDefault  *GoogleRpcStatus
}

// Status returns HTTPResponse.Status
func (r GreeterSayHello8Response) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r GreeterSayHello8Response) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type GreeterSayHello1Response struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *GrpcGatewayExamplesInternalHelloworldHelloReply
	JSONDefault  *GoogleRpcStatus
}

// Status returns HTTPResponse.Status
func (r GreeterSayHello1Response) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r GreeterSayHello1Response) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type GreeterSayHello7Response struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *GrpcGatewayExamplesInternalHelloworldHelloReply
	JSONDefault  *GoogleRpcStatus
}

// Status returns HTTPResponse.Status
func (r GreeterSayHello7Response) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r GreeterSayHello7Response) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type GreeterSayHello9Response struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *GrpcGatewayExamplesInternalHelloworldHelloReply
	JSONDefault  *GoogleRpcStatus
}

// Status returns HTTPResponse.Status
func (r GreeterSayHello9Response) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r GreeterSayHello9Response) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type GreeterSayHelloResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *GrpcGatewayExamplesInternalHelloworldHelloReply
	JSONDefault  *GoogleRpcStatus
}

// Status returns HTTPResponse.Status
func (r GreeterSayHelloResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r GreeterSayHelloResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

// GreeterSayHello4WithResponse request returning *GreeterSayHello4Response
func (c *ClientWithResponses) GreeterSayHello4WithResponse(ctx context.Context, boolVal bool, params *GreeterSayHello4Params, reqEditors ...RequestEditorFn) (*GreeterSayHello4Response, error) {
	rsp, err := c.GreeterSayHello4(ctx, boolVal, params, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseGreeterSayHello4Response(rsp)
}

// GreeterSayHello5WithResponse request returning *GreeterSayHello5Response
func (c *ClientWithResponses) GreeterSayHello5WithResponse(ctx context.Context, bytesVal []byte, params *GreeterSayHello5Params, reqEditors ...RequestEditorFn) (*GreeterSayHello5Response, error) {
	rsp, err := c.GreeterSayHello5(ctx, bytesVal, params, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseGreeterSayHello5Response(rsp)
}

// GreeterSayHello3WithResponse request returning *GreeterSayHello3Response
func (c *ClientWithResponses) GreeterSayHello3WithResponse(ctx context.Context, doubleVal float64, params *GreeterSayHello3Params, reqEditors ...RequestEditorFn) (*GreeterSayHello3Response, error) {
	rsp, err := c.GreeterSayHello3(ctx, doubleVal, params, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseGreeterSayHello3Response(rsp)
}

// GreeterSayHello2WithResponse request returning *GreeterSayHello2Response
func (c *ClientWithResponses) GreeterSayHello2WithResponse(ctx context.Context, floatVal float32, params *GreeterSayHello2Params, reqEditors ...RequestEditorFn) (*GreeterSayHello2Response, error) {
	rsp, err := c.GreeterSayHello2(ctx, floatVal, params, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseGreeterSayHello2Response(rsp)
}

// GreeterSayHello6WithResponse request returning *GreeterSayHello6Response
func (c *ClientWithResponses) GreeterSayHello6WithResponse(ctx context.Context, int32Val int32, params *GreeterSayHello6Params, reqEditors ...RequestEditorFn) (*GreeterSayHello6Response, error) {
	rsp, err := c.GreeterSayHello6(ctx, int32Val, params, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseGreeterSayHello6Response(rsp)
}

// GreeterSayHello8WithResponse request returning *GreeterSayHello8Response
func (c *ClientWithResponses) GreeterSayHello8WithResponse(ctx context.Context, int64Val string, params *GreeterSayHello8Params, reqEditors ...RequestEditorFn) (*GreeterSayHello8Response, error) {
	rsp, err := c.GreeterSayHello8(ctx, int64Val, params, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseGreeterSayHello8Response(rsp)
}

// GreeterSayHello1WithResponse request returning *GreeterSayHello1Response
func (c *ClientWithResponses) GreeterSayHello1WithResponse(ctx context.Context, strVal string, params *GreeterSayHello1Params, reqEditors ...RequestEditorFn) (*GreeterSayHello1Response, error) {
	rsp, err := c.GreeterSayHello1(ctx, strVal, params, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseGreeterSayHello1Response(rsp)
}

// GreeterSayHello7WithResponse request returning *GreeterSayHello7Response
func (c *ClientWithResponses) GreeterSayHello7WithResponse(ctx context.Context, uint32Val int64, params *GreeterSayHello7Params, reqEditors ...RequestEditorFn) (*GreeterSayHello7Response, error) {
	rsp, err := c.GreeterSayHello7(ctx, uint32Val, params, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseGreeterSayHello7Response(rsp)
}

// GreeterSayHello9WithResponse request returning *GreeterSayHello9Response
func (c *ClientWithResponses) GreeterSayHello9WithResponse(ctx context.Context, uint64Val string, params *GreeterSayHello9Params, reqEditors ...RequestEditorFn) (*GreeterSayHello9Response, error) {
	rsp, err := c.GreeterSayHello9(ctx, uint64Val, params, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseGreeterSayHello9Response(rsp)
}

// GreeterSayHelloWithResponse request returning *GreeterSayHelloResponse
func (c *ClientWithResponses) GreeterSayHelloWithResponse(ctx context.Context, name string, params *GreeterSayHelloParams, reqEditors ...RequestEditorFn) (*GreeterSayHelloResponse, error) {
	rsp, err := c.GreeterSayHello(ctx, name, params, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseGreeterSayHelloResponse(rsp)
}

// ParseGreeterSayHello4Response parses an HTTP response from a GreeterSayHello4WithResponse call
func ParseGreeterSayHello4Response(rsp *http.Response) (*GreeterSayHello4Response, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &GreeterSayHello4Response{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest GrpcGatewayExamplesInternalHelloworldHelloReply
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON200 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true:
		var dest GoogleRpcStatus
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSONDefault = &dest

	}

	return response, nil
}

// ParseGreeterSayHello5Response parses an HTTP response from a GreeterSayHello5WithResponse call
func ParseGreeterSayHello5Response(rsp *http.Response) (*GreeterSayHello5Response, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &GreeterSayHello5Response{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest GrpcGatewayExamplesInternalHelloworldHelloReply
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON200 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true:
		var dest GoogleRpcStatus
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSONDefault = &dest

	}

	return response, nil
}

// ParseGreeterSayHello3Response parses an HTTP response from a GreeterSayHello3WithResponse call
func ParseGreeterSayHello3Response(rsp *http.Response) (*GreeterSayHello3Response, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &GreeterSayHello3Response{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest GrpcGatewayExamplesInternalHelloworldHelloReply
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON200 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true:
		var dest GoogleRpcStatus
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSONDefault = &dest

	}

	return response, nil
}

// ParseGreeterSayHello2Response parses an HTTP response from a GreeterSayHello2WithResponse call
func ParseGreeterSayHello2Response(rsp *http.Response) (*GreeterSayHello2Response, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &GreeterSayHello2Response{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest GrpcGatewayExamplesInternalHelloworldHelloReply
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON200 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true:
		var dest GoogleRpcStatus
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSONDefault = &dest

	}

	return response, nil
}

// ParseGreeterSayHello6Response parses an HTTP response from a GreeterSayHello6WithResponse call
func ParseGreeterSayHello6Response(rsp *http.Response) (*GreeterSayHello6Response, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &GreeterSayHello6Response{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest GrpcGatewayExamplesInternalHelloworldHelloReply
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON200 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true:
		var dest GoogleRpcStatus
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSONDefault = &dest

	}

	return response, nil
}

// ParseGreeterSayHello8Response parses an HTTP response from a GreeterSayHello8WithResponse call
func ParseGreeterSayHello8Response(rsp *http.Response) (*GreeterSayHello8Response, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &GreeterSayHello8Response{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest GrpcGatewayExamplesInternalHelloworldHelloReply
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON200 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true:
		var dest GoogleRpcStatus
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSONDefault = &dest

	}

	return response, nil
}

// ParseGreeterSayHello1Response parses an HTTP response from a GreeterSayHello1WithResponse call
func ParseGreeterSayHello1Response(rsp *http.Response) (*GreeterSayHello1Response, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &GreeterSayHello1Response{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest GrpcGatewayExamplesInternalHelloworldHelloReply
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON200 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true:
		var dest GoogleRpcStatus
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSONDefault = &dest

	}

	return response, nil
}

// ParseGreeterSayHello7Response parses an HTTP response from a GreeterSayHello7WithResponse call
func ParseGreeterSayHello7Response(rsp *http.Response) (*GreeterSayHello7Response, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &GreeterSayHello7Response{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest GrpcGatewayExamplesInternalHelloworldHelloReply
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON200 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true:
		var dest GoogleRpcStatus
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSONDefault = &dest

	}

	return response, nil
}

// ParseGreeterSayHello9Response parses an HTTP response from a GreeterSayHello9WithResponse call
func ParseGreeterSayHello9Response(rsp *http.Response) (*GreeterSayHello9Response, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &GreeterSayHello9Response{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest GrpcGatewayExamplesInternalHelloworldHelloReply
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON200 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true:
		var dest GoogleRpcStatus
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSONDefault = &dest

	}

	return response, nil
}

// ParseGreeterSayHelloResponse parses an HTTP response from a GreeterSayHelloWithResponse call
func ParseGreeterSayHelloResponse(rsp *http.Response) (*GreeterSayHelloResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &GreeterSayHelloResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest GrpcGatewayExamplesInternalHelloworldHelloReply
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON200 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true:
		var dest GoogleRpcStatus
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSONDefault = &dest

	}

	return response, nil
}
