github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/models/scan_data_export_execution.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 11 "github.com/go-openapi/errors" 12 "github.com/go-openapi/strfmt" 13 "github.com/go-openapi/swag" 14 "github.com/go-openapi/validate" 15 ) 16 17 // ScanDataExportExecution The replication execution 18 // 19 // swagger:model ScanDataExportExecution 20 type ScanDataExportExecution struct { 21 22 // The end time 23 // Format: date-time 24 EndTime strfmt.DateTime `json:"end_time,omitempty"` 25 26 // Indicates whether the export artifact is present in registry 27 FilePresent bool `json:"file_present"` 28 29 // The ID of the execution 30 ID int64 `json:"id,omitempty"` 31 32 // The start time 33 // Format: date-time 34 StartTime strfmt.DateTime `json:"start_time,omitempty"` 35 36 // The status of the execution 37 Status string `json:"status,omitempty"` 38 39 // The status text 40 StatusText string `json:"status_text"` 41 42 // The trigger mode 43 Trigger string `json:"trigger,omitempty"` 44 45 // The ID if the user triggering the export job 46 UserID int64 `json:"user_id,omitempty"` 47 48 // The name of the user triggering the job 49 UserName string `json:"user_name"` 50 } 51 52 // Validate validates this scan data export execution 53 func (m *ScanDataExportExecution) Validate(formats strfmt.Registry) error { 54 var res []error 55 56 if err := m.validateEndTime(formats); err != nil { 57 res = append(res, err) 58 } 59 60 if err := m.validateStartTime(formats); err != nil { 61 res = append(res, err) 62 } 63 64 if len(res) > 0 { 65 return errors.CompositeValidationError(res...) 66 } 67 return nil 68 } 69 70 func (m *ScanDataExportExecution) validateEndTime(formats strfmt.Registry) error { 71 if swag.IsZero(m.EndTime) { // not required 72 return nil 73 } 74 75 if err := validate.FormatOf("end_time", "body", "date-time", m.EndTime.String(), formats); err != nil { 76 return err 77 } 78 79 return nil 80 } 81 82 func (m *ScanDataExportExecution) validateStartTime(formats strfmt.Registry) error { 83 if swag.IsZero(m.StartTime) { // not required 84 return nil 85 } 86 87 if err := validate.FormatOf("start_time", "body", "date-time", m.StartTime.String(), formats); err != nil { 88 return err 89 } 90 91 return nil 92 } 93 94 // ContextValidate validates this scan data export execution based on context it is used 95 func (m *ScanDataExportExecution) ContextValidate(ctx context.Context, formats strfmt.Registry) error { 96 return nil 97 } 98 99 // MarshalBinary interface implementation 100 func (m *ScanDataExportExecution) MarshalBinary() ([]byte, error) { 101 if m == nil { 102 return nil, nil 103 } 104 return swag.WriteJSON(m) 105 } 106 107 // UnmarshalBinary interface implementation 108 func (m *ScanDataExportExecution) UnmarshalBinary(b []byte) error { 109 var res ScanDataExportExecution 110 if err := swag.ReadJSON(b, &res); err != nil { 111 return err 112 } 113 *m = res 114 return nil 115 }