github.com/minio/console@v1.3.0/models/nofitication_service.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  // NofiticationService nofitication service
    35  //
    36  // swagger:model nofiticationService
    37  type NofiticationService string
    38  
    39  func NewNofiticationService(value NofiticationService) *NofiticationService {
    40  	return &value
    41  }
    42  
    43  // Pointer returns a pointer to a freshly-allocated NofiticationService.
    44  func (m NofiticationService) Pointer() *NofiticationService {
    45  	return &m
    46  }
    47  
    48  const (
    49  
    50  	// NofiticationServiceWebhook captures enum value "webhook"
    51  	NofiticationServiceWebhook NofiticationService = "webhook"
    52  
    53  	// NofiticationServiceAmqp captures enum value "amqp"
    54  	NofiticationServiceAmqp NofiticationService = "amqp"
    55  
    56  	// NofiticationServiceKafka captures enum value "kafka"
    57  	NofiticationServiceKafka NofiticationService = "kafka"
    58  
    59  	// NofiticationServiceMqtt captures enum value "mqtt"
    60  	NofiticationServiceMqtt NofiticationService = "mqtt"
    61  
    62  	// NofiticationServiceNats captures enum value "nats"
    63  	NofiticationServiceNats NofiticationService = "nats"
    64  
    65  	// NofiticationServiceNsq captures enum value "nsq"
    66  	NofiticationServiceNsq NofiticationService = "nsq"
    67  
    68  	// NofiticationServiceMysql captures enum value "mysql"
    69  	NofiticationServiceMysql NofiticationService = "mysql"
    70  
    71  	// NofiticationServicePostgres captures enum value "postgres"
    72  	NofiticationServicePostgres NofiticationService = "postgres"
    73  
    74  	// NofiticationServiceElasticsearch captures enum value "elasticsearch"
    75  	NofiticationServiceElasticsearch NofiticationService = "elasticsearch"
    76  
    77  	// NofiticationServiceRedis captures enum value "redis"
    78  	NofiticationServiceRedis NofiticationService = "redis"
    79  )
    80  
    81  // for schema
    82  var nofiticationServiceEnum []interface{}
    83  
    84  func init() {
    85  	var res []NofiticationService
    86  	if err := json.Unmarshal([]byte(`["webhook","amqp","kafka","mqtt","nats","nsq","mysql","postgres","elasticsearch","redis"]`), &res); err != nil {
    87  		panic(err)
    88  	}
    89  	for _, v := range res {
    90  		nofiticationServiceEnum = append(nofiticationServiceEnum, v)
    91  	}
    92  }
    93  
    94  func (m NofiticationService) validateNofiticationServiceEnum(path, location string, value NofiticationService) error {
    95  	if err := validate.EnumCase(path, location, value, nofiticationServiceEnum, true); err != nil {
    96  		return err
    97  	}
    98  	return nil
    99  }
   100  
   101  // Validate validates this nofitication service
   102  func (m NofiticationService) Validate(formats strfmt.Registry) error {
   103  	var res []error
   104  
   105  	// value enum
   106  	if err := m.validateNofiticationServiceEnum("", "body", m); err != nil {
   107  		return err
   108  	}
   109  
   110  	if len(res) > 0 {
   111  		return errors.CompositeValidationError(res...)
   112  	}
   113  	return nil
   114  }
   115  
   116  // ContextValidate validates this nofitication service based on context it is used
   117  func (m NofiticationService) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
   118  	return nil
   119  }