github.com/hashicorp/hcp-sdk-go@v0.94.0/clients/cloud-billing/preview/2020-11-05/models/cloudbilling20201105_status.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 // Cloudbilling20201105Status Status represents the status of a given statement. 18 // 19 // swagger:model cloudbilling_20201105Status 20 type Cloudbilling20201105Status string 21 22 func NewCloudbilling20201105Status(value Cloudbilling20201105Status) *Cloudbilling20201105Status { 23 return &value 24 } 25 26 // Pointer returns a pointer to a freshly-allocated Cloudbilling20201105Status. 27 func (m Cloudbilling20201105Status) Pointer() *Cloudbilling20201105Status { 28 return &m 29 } 30 31 const ( 32 33 // Cloudbilling20201105StatusOPEN captures enum value "OPEN" 34 Cloudbilling20201105StatusOPEN Cloudbilling20201105Status = "OPEN" 35 36 // Cloudbilling20201105StatusPAID captures enum value "PAID" 37 Cloudbilling20201105StatusPAID Cloudbilling20201105Status = "PAID" 38 39 // Cloudbilling20201105StatusOVERDUE captures enum value "OVERDUE" 40 Cloudbilling20201105StatusOVERDUE Cloudbilling20201105Status = "OVERDUE" 41 ) 42 43 // for schema 44 var cloudbilling20201105StatusEnum []interface{} 45 46 func init() { 47 var res []Cloudbilling20201105Status 48 if err := json.Unmarshal([]byte(`["OPEN","PAID","OVERDUE"]`), &res); err != nil { 49 panic(err) 50 } 51 for _, v := range res { 52 cloudbilling20201105StatusEnum = append(cloudbilling20201105StatusEnum, v) 53 } 54 } 55 56 func (m Cloudbilling20201105Status) validateCloudbilling20201105StatusEnum(path, location string, value Cloudbilling20201105Status) error { 57 if err := validate.EnumCase(path, location, value, cloudbilling20201105StatusEnum, true); err != nil { 58 return err 59 } 60 return nil 61 } 62 63 // Validate validates this cloudbilling 20201105 status 64 func (m Cloudbilling20201105Status) Validate(formats strfmt.Registry) error { 65 var res []error 66 67 // value enum 68 if err := m.validateCloudbilling20201105StatusEnum("", "body", m); err != nil { 69 return err 70 } 71 72 if len(res) > 0 { 73 return errors.CompositeValidationError(res...) 74 } 75 return nil 76 } 77 78 // ContextValidate validates this cloudbilling 20201105 status based on context it is used 79 func (m Cloudbilling20201105Status) ContextValidate(ctx context.Context, formats strfmt.Registry) error { 80 return nil 81 }