github.com/minio/console@v1.4.1/api/operations/bucket/delete_remote_bucket_parameters.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  // This file is part of MinIO Console Server
     4  // Copyright (c) 2023 MinIO, Inc.
     5  //
     6  // This program is free software: you can redistribute it and/or modify
     7  // it under the terms of the GNU Affero General Public License as published by
     8  // the Free Software Foundation, either version 3 of the License, or
     9  // (at your option) any later version.
    10  //
    11  // This program is distributed in the hope that it will be useful,
    12  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    13  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14  // GNU Affero General Public License for more details.
    15  //
    16  // You should have received a copy of the GNU Affero General Public License
    17  // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    18  //
    19  
    20  package bucket
    21  
    22  // This file was generated by the swagger tool.
    23  // Editing this file might prove futile when you re-run the swagger generate command
    24  
    25  import (
    26  	"net/http"
    27  
    28  	"github.com/go-openapi/errors"
    29  	"github.com/go-openapi/runtime/middleware"
    30  	"github.com/go-openapi/strfmt"
    31  )
    32  
    33  // NewDeleteRemoteBucketParams creates a new DeleteRemoteBucketParams object
    34  //
    35  // There are no default values defined in the spec.
    36  func NewDeleteRemoteBucketParams() DeleteRemoteBucketParams {
    37  
    38  	return DeleteRemoteBucketParams{}
    39  }
    40  
    41  // DeleteRemoteBucketParams contains all the bound params for the delete remote bucket operation
    42  // typically these are obtained from a http.Request
    43  //
    44  // swagger:parameters DeleteRemoteBucket
    45  type DeleteRemoteBucketParams struct {
    46  
    47  	// HTTP Request Object
    48  	HTTPRequest *http.Request `json:"-"`
    49  
    50  	/*
    51  	  Required: true
    52  	  In: path
    53  	*/
    54  	Arn string
    55  	/*
    56  	  Required: true
    57  	  In: path
    58  	*/
    59  	SourceBucketName string
    60  }
    61  
    62  // BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
    63  // for simple values it will use straight method calls.
    64  //
    65  // To ensure default values, the struct must have been initialized with NewDeleteRemoteBucketParams() beforehand.
    66  func (o *DeleteRemoteBucketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
    67  	var res []error
    68  
    69  	o.HTTPRequest = r
    70  
    71  	rArn, rhkArn, _ := route.Params.GetOK("arn")
    72  	if err := o.bindArn(rArn, rhkArn, route.Formats); err != nil {
    73  		res = append(res, err)
    74  	}
    75  
    76  	rSourceBucketName, rhkSourceBucketName, _ := route.Params.GetOK("source-bucket-name")
    77  	if err := o.bindSourceBucketName(rSourceBucketName, rhkSourceBucketName, route.Formats); err != nil {
    78  		res = append(res, err)
    79  	}
    80  	if len(res) > 0 {
    81  		return errors.CompositeValidationError(res...)
    82  	}
    83  	return nil
    84  }
    85  
    86  // bindArn binds and validates parameter Arn from path.
    87  func (o *DeleteRemoteBucketParams) bindArn(rawData []string, hasKey bool, formats strfmt.Registry) error {
    88  	var raw string
    89  	if len(rawData) > 0 {
    90  		raw = rawData[len(rawData)-1]
    91  	}
    92  
    93  	// Required: true
    94  	// Parameter is provided by construction from the route
    95  	o.Arn = raw
    96  
    97  	return nil
    98  }
    99  
   100  // bindSourceBucketName binds and validates parameter SourceBucketName from path.
   101  func (o *DeleteRemoteBucketParams) bindSourceBucketName(rawData []string, hasKey bool, formats strfmt.Registry) error {
   102  	var raw string
   103  	if len(rawData) > 0 {
   104  		raw = rawData[len(rawData)-1]
   105  	}
   106  
   107  	// Required: true
   108  	// Parameter is provided by construction from the route
   109  	o.SourceBucketName = raw
   110  
   111  	return nil
   112  }