| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
|
|
| package models |
|
|
| |
| |
|
|
| import ( |
| "context" |
|
|
| "github.com/go-openapi/errors" |
| "github.com/go-openapi/strfmt" |
| "github.com/go-openapi/swag" |
| ) |
|
|
| |
| |
| |
| type BatchDelete struct { |
|
|
| |
| DeletionTimeUnixMilli *int64 `json:"deletionTimeUnixMilli,omitempty"` |
|
|
| |
| DryRun *bool `json:"dryRun,omitempty"` |
|
|
| |
| Match *BatchDeleteMatch `json:"match,omitempty"` |
|
|
| |
| Output *string `json:"output,omitempty"` |
| } |
|
|
| |
| func (m *BatchDelete) Validate(formats strfmt.Registry) error { |
| var res []error |
|
|
| if err := m.validateMatch(formats); err != nil { |
| res = append(res, err) |
| } |
|
|
| if len(res) > 0 { |
| return errors.CompositeValidationError(res...) |
| } |
| return nil |
| } |
|
|
| func (m *BatchDelete) validateMatch(formats strfmt.Registry) error { |
| if swag.IsZero(m.Match) { |
| return nil |
| } |
|
|
| if m.Match != nil { |
| if err := m.Match.Validate(formats); err != nil { |
| if ve, ok := err.(*errors.Validation); ok { |
| return ve.ValidateName("match") |
| } else if ce, ok := err.(*errors.CompositeError); ok { |
| return ce.ValidateName("match") |
| } |
| return err |
| } |
| } |
|
|
| return nil |
| } |
|
|
| |
| func (m *BatchDelete) ContextValidate(ctx context.Context, formats strfmt.Registry) error { |
| var res []error |
|
|
| if err := m.contextValidateMatch(ctx, formats); err != nil { |
| res = append(res, err) |
| } |
|
|
| if len(res) > 0 { |
| return errors.CompositeValidationError(res...) |
| } |
| return nil |
| } |
|
|
| func (m *BatchDelete) contextValidateMatch(ctx context.Context, formats strfmt.Registry) error { |
|
|
| if m.Match != nil { |
| if err := m.Match.ContextValidate(ctx, formats); err != nil { |
| if ve, ok := err.(*errors.Validation); ok { |
| return ve.ValidateName("match") |
| } else if ce, ok := err.(*errors.CompositeError); ok { |
| return ce.ValidateName("match") |
| } |
| return err |
| } |
| } |
|
|
| return nil |
| } |
|
|
| |
| func (m *BatchDelete) MarshalBinary() ([]byte, error) { |
| if m == nil { |
| return nil, nil |
| } |
| return swag.WriteJSON(m) |
| } |
|
|
| |
| func (m *BatchDelete) UnmarshalBinary(b []byte) error { |
| var res BatchDelete |
| if err := swag.ReadJSON(b, &res); err != nil { |
| return err |
| } |
| *m = res |
| return nil |
| } |
|
|
| |
| |
| |
| type BatchDeleteMatch struct { |
|
|
| |
| |
| Class string `json:"class,omitempty"` |
|
|
| |
| Where *WhereFilter `json:"where,omitempty"` |
| } |
|
|
| |
| func (m *BatchDeleteMatch) Validate(formats strfmt.Registry) error { |
| var res []error |
|
|
| if err := m.validateWhere(formats); err != nil { |
| res = append(res, err) |
| } |
|
|
| if len(res) > 0 { |
| return errors.CompositeValidationError(res...) |
| } |
| return nil |
| } |
|
|
| func (m *BatchDeleteMatch) validateWhere(formats strfmt.Registry) error { |
| if swag.IsZero(m.Where) { |
| return nil |
| } |
|
|
| if m.Where != nil { |
| if err := m.Where.Validate(formats); err != nil { |
| if ve, ok := err.(*errors.Validation); ok { |
| return ve.ValidateName("match" + "." + "where") |
| } else if ce, ok := err.(*errors.CompositeError); ok { |
| return ce.ValidateName("match" + "." + "where") |
| } |
| return err |
| } |
| } |
|
|
| return nil |
| } |
|
|
| |
| func (m *BatchDeleteMatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { |
| var res []error |
|
|
| if err := m.contextValidateWhere(ctx, formats); err != nil { |
| res = append(res, err) |
| } |
|
|
| if len(res) > 0 { |
| return errors.CompositeValidationError(res...) |
| } |
| return nil |
| } |
|
|
| func (m *BatchDeleteMatch) contextValidateWhere(ctx context.Context, formats strfmt.Registry) error { |
|
|
| if m.Where != nil { |
| if err := m.Where.ContextValidate(ctx, formats); err != nil { |
| if ve, ok := err.(*errors.Validation); ok { |
| return ve.ValidateName("match" + "." + "where") |
| } else if ce, ok := err.(*errors.CompositeError); ok { |
| return ce.ValidateName("match" + "." + "where") |
| } |
| return err |
| } |
| } |
|
|
| return nil |
| } |
|
|
| |
| func (m *BatchDeleteMatch) MarshalBinary() ([]byte, error) { |
| if m == nil { |
| return nil, nil |
| } |
| return swag.WriteJSON(m) |
| } |
|
|
| |
| func (m *BatchDeleteMatch) UnmarshalBinary(b []byte) error { |
| var res BatchDeleteMatch |
| if err := swag.ReadJSON(b, &res); err != nil { |
| return err |
| } |
| *m = res |
| return nil |
| } |
|
|