github.com/hashicorp/hcp-sdk-go@v0.94.0/clients/cloud-log-service/preview/2021-03-30/models/log_service20210330_action.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package models
     4  
     5  // This file was generated by the swagger tool.
     6  // Editing this file might prove futile when you re-run the swagger generate command
     7  
     8  import (
     9  	"context"
    10  	"encoding/json"
    11  
    12  	"github.com/go-openapi/errors"
    13  	"github.com/go-openapi/strfmt"
    14  	"github.com/go-openapi/validate"
    15  )
    16  
    17  // LogService20210330Action Action is a classification for Control-Plane actions.
    18  //
    19  // swagger:model log_service_20210330Action
    20  type LogService20210330Action string
    21  
    22  func NewLogService20210330Action(value LogService20210330Action) *LogService20210330Action {
    23  	return &value
    24  }
    25  
    26  // Pointer returns a pointer to a freshly-allocated LogService20210330Action.
    27  func (m LogService20210330Action) Pointer() *LogService20210330Action {
    28  	return &m
    29  }
    30  
    31  const (
    32  
    33  	// LogService20210330ActionUNSET captures enum value "UNSET"
    34  	LogService20210330ActionUNSET LogService20210330Action = "UNSET"
    35  
    36  	// LogService20210330ActionREAD captures enum value "READ"
    37  	LogService20210330ActionREAD LogService20210330Action = "READ"
    38  
    39  	// LogService20210330ActionCREATE captures enum value "CREATE"
    40  	LogService20210330ActionCREATE LogService20210330Action = "CREATE"
    41  
    42  	// LogService20210330ActionUPDATE captures enum value "UPDATE"
    43  	LogService20210330ActionUPDATE LogService20210330Action = "UPDATE"
    44  
    45  	// LogService20210330ActionDELETE captures enum value "DELETE"
    46  	LogService20210330ActionDELETE LogService20210330Action = "DELETE"
    47  )
    48  
    49  // for schema
    50  var logService20210330ActionEnum []interface{}
    51  
    52  func init() {
    53  	var res []LogService20210330Action
    54  	if err := json.Unmarshal([]byte(`["UNSET","READ","CREATE","UPDATE","DELETE"]`), &res); err != nil {
    55  		panic(err)
    56  	}
    57  	for _, v := range res {
    58  		logService20210330ActionEnum = append(logService20210330ActionEnum, v)
    59  	}
    60  }
    61  
    62  func (m LogService20210330Action) validateLogService20210330ActionEnum(path, location string, value LogService20210330Action) error {
    63  	if err := validate.EnumCase(path, location, value, logService20210330ActionEnum, true); err != nil {
    64  		return err
    65  	}
    66  	return nil
    67  }
    68  
    69  // Validate validates this log service 20210330 action
    70  func (m LogService20210330Action) Validate(formats strfmt.Registry) error {
    71  	var res []error
    72  
    73  	// value enum
    74  	if err := m.validateLogService20210330ActionEnum("", "body", m); err != nil {
    75  		return err
    76  	}
    77  
    78  	if len(res) > 0 {
    79  		return errors.CompositeValidationError(res...)
    80  	}
    81  	return nil
    82  }
    83  
    84  // ContextValidate validates this log service 20210330 action based on context it is used
    85  func (m LogService20210330Action) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
    86  	return nil
    87  }