github.com/minio/console@v1.4.1/models/object_legal_hold_status.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 models
    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  	"context"
    27  	"encoding/json"
    28  
    29  	"github.com/go-openapi/errors"
    30  	"github.com/go-openapi/strfmt"
    31  	"github.com/go-openapi/validate"
    32  )
    33  
    34  // ObjectLegalHoldStatus object legal hold status
    35  //
    36  // swagger:model objectLegalHoldStatus
    37  type ObjectLegalHoldStatus string
    38  
    39  func NewObjectLegalHoldStatus(value ObjectLegalHoldStatus) *ObjectLegalHoldStatus {
    40  	return &value
    41  }
    42  
    43  // Pointer returns a pointer to a freshly-allocated ObjectLegalHoldStatus.
    44  func (m ObjectLegalHoldStatus) Pointer() *ObjectLegalHoldStatus {
    45  	return &m
    46  }
    47  
    48  const (
    49  
    50  	// ObjectLegalHoldStatusEnabled captures enum value "enabled"
    51  	ObjectLegalHoldStatusEnabled ObjectLegalHoldStatus = "enabled"
    52  
    53  	// ObjectLegalHoldStatusDisabled captures enum value "disabled"
    54  	ObjectLegalHoldStatusDisabled ObjectLegalHoldStatus = "disabled"
    55  )
    56  
    57  // for schema
    58  var objectLegalHoldStatusEnum []interface{}
    59  
    60  func init() {
    61  	var res []ObjectLegalHoldStatus
    62  	if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
    63  		panic(err)
    64  	}
    65  	for _, v := range res {
    66  		objectLegalHoldStatusEnum = append(objectLegalHoldStatusEnum, v)
    67  	}
    68  }
    69  
    70  func (m ObjectLegalHoldStatus) validateObjectLegalHoldStatusEnum(path, location string, value ObjectLegalHoldStatus) error {
    71  	if err := validate.EnumCase(path, location, value, objectLegalHoldStatusEnum, true); err != nil {
    72  		return err
    73  	}
    74  	return nil
    75  }
    76  
    77  // Validate validates this object legal hold status
    78  func (m ObjectLegalHoldStatus) Validate(formats strfmt.Registry) error {
    79  	var res []error
    80  
    81  	// value enum
    82  	if err := m.validateObjectLegalHoldStatusEnum("", "body", m); err != nil {
    83  		return err
    84  	}
    85  
    86  	if len(res) > 0 {
    87  		return errors.CompositeValidationError(res...)
    88  	}
    89  	return nil
    90  }
    91  
    92  // ContextValidate validates this object legal hold status based on context it is used
    93  func (m ObjectLegalHoldStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
    94  	return nil
    95  }