github.com/weaviate/weaviate@v1.24.6/adapters/handlers/rest/operations/backups/backups_restore_status_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 backups
    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  // NewBackupsRestoreStatusParams creates a new BackupsRestoreStatusParams object
    28  //
    29  // There are no default values defined in the spec.
    30  func NewBackupsRestoreStatusParams() BackupsRestoreStatusParams {
    31  
    32  	return BackupsRestoreStatusParams{}
    33  }
    34  
    35  // BackupsRestoreStatusParams contains all the bound params for the backups restore status operation
    36  // typically these are obtained from a http.Request
    37  //
    38  // swagger:parameters backups.restore.status
    39  type BackupsRestoreStatusParams struct {
    40  
    41  	// HTTP Request Object
    42  	HTTPRequest *http.Request `json:"-"`
    43  
    44  	/*Backup backend name e.g. filesystem, gcs, s3.
    45  	  Required: true
    46  	  In: path
    47  	*/
    48  	Backend string
    49  	/*The ID of a backup. Must be URL-safe and work as a filesystem path, only lowercase, numbers, underscore, minus characters allowed.
    50  	  Required: true
    51  	  In: path
    52  	*/
    53  	ID string
    54  }
    55  
    56  // BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
    57  // for simple values it will use straight method calls.
    58  //
    59  // To ensure default values, the struct must have been initialized with NewBackupsRestoreStatusParams() beforehand.
    60  func (o *BackupsRestoreStatusParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
    61  	var res []error
    62  
    63  	o.HTTPRequest = r
    64  
    65  	rBackend, rhkBackend, _ := route.Params.GetOK("backend")
    66  	if err := o.bindBackend(rBackend, rhkBackend, route.Formats); err != nil {
    67  		res = append(res, err)
    68  	}
    69  
    70  	rID, rhkID, _ := route.Params.GetOK("id")
    71  	if err := o.bindID(rID, rhkID, route.Formats); err != nil {
    72  		res = append(res, err)
    73  	}
    74  	if len(res) > 0 {
    75  		return errors.CompositeValidationError(res...)
    76  	}
    77  	return nil
    78  }
    79  
    80  // bindBackend binds and validates parameter Backend from path.
    81  func (o *BackupsRestoreStatusParams) bindBackend(rawData []string, hasKey bool, formats strfmt.Registry) error {
    82  	var raw string
    83  	if len(rawData) > 0 {
    84  		raw = rawData[len(rawData)-1]
    85  	}
    86  
    87  	// Required: true
    88  	// Parameter is provided by construction from the route
    89  	o.Backend = raw
    90  
    91  	return nil
    92  }
    93  
    94  // bindID binds and validates parameter ID from path.
    95  func (o *BackupsRestoreStatusParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error {
    96  	var raw string
    97  	if len(rawData) > 0 {
    98  		raw = rawData[len(rawData)-1]
    99  	}
   100  
   101  	// Required: true
   102  	// Parameter is provided by construction from the route
   103  	o.ID = raw
   104  
   105  	return nil
   106  }