github.com/weaviate/weaviate@v1.24.6/adapters/handlers/rest/operations/schema/schema_objects_get_parameters.go (about)

     1  //                           _       _
     2  // __      _____  __ ___   ___  __ _| |_ ___
     3  // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
     4  //  \ V  V /  __/ (_| |\ V /| | (_| | ||  __/
     5  //   \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
     6  //
     7  //  Copyright © 2016 - 2024 Weaviate B.V. All rights reserved.
     8  //
     9  //  CONTACT: hello@weaviate.io
    10  //
    11  
    12  // Code generated by go-swagger; DO NOT EDIT.
    13  
    14  package schema
    15  
    16  // This file was generated by the swagger tool.
    17  // Editing this file might prove futile when you re-run the swagger generate command
    18  
    19  import (
    20  	"net/http"
    21  
    22  	"github.com/go-openapi/errors"
    23  	"github.com/go-openapi/runtime/middleware"
    24  	"github.com/go-openapi/strfmt"
    25  )
    26  
    27  // NewSchemaObjectsGetParams creates a new SchemaObjectsGetParams object
    28  //
    29  // There are no default values defined in the spec.
    30  func NewSchemaObjectsGetParams() SchemaObjectsGetParams {
    31  
    32  	return SchemaObjectsGetParams{}
    33  }
    34  
    35  // SchemaObjectsGetParams contains all the bound params for the schema objects get operation
    36  // typically these are obtained from a http.Request
    37  //
    38  // swagger:parameters schema.objects.get
    39  type SchemaObjectsGetParams struct {
    40  
    41  	// HTTP Request Object
    42  	HTTPRequest *http.Request `json:"-"`
    43  
    44  	/*
    45  	  Required: true
    46  	  In: path
    47  	*/
    48  	ClassName string
    49  }
    50  
    51  // BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
    52  // for simple values it will use straight method calls.
    53  //
    54  // To ensure default values, the struct must have been initialized with NewSchemaObjectsGetParams() beforehand.
    55  func (o *SchemaObjectsGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
    56  	var res []error
    57  
    58  	o.HTTPRequest = r
    59  
    60  	rClassName, rhkClassName, _ := route.Params.GetOK("className")
    61  	if err := o.bindClassName(rClassName, rhkClassName, route.Formats); err != nil {
    62  		res = append(res, err)
    63  	}
    64  	if len(res) > 0 {
    65  		return errors.CompositeValidationError(res...)
    66  	}
    67  	return nil
    68  }
    69  
    70  // bindClassName binds and validates parameter ClassName from path.
    71  func (o *SchemaObjectsGetParams) bindClassName(rawData []string, hasKey bool, formats strfmt.Registry) error {
    72  	var raw string
    73  	if len(rawData) > 0 {
    74  		raw = rawData[len(rawData)-1]
    75  	}
    76  
    77  	// Required: true
    78  	// Parameter is provided by construction from the route
    79  	o.ClassName = raw
    80  
    81  	return nil
    82  }