github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/models/vulnerability_summary.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/strfmt"
    12  	"github.com/go-openapi/swag"
    13  )
    14  
    15  // VulnerabilitySummary VulnerabilitySummary contains the total number of the foun d vulnerabilities number and numbers of each severity level.
    16  //
    17  // swagger:model VulnerabilitySummary
    18  type VulnerabilitySummary struct {
    19  
    20  	// The number of the fixable vulnerabilities
    21  	// Example: 100
    22  	Fixable int64 `json:"fixable"`
    23  
    24  	// Numbers of the vulnerabilities with different severity
    25  	// Example: {"Critical":5,"High":5}
    26  	Summary map[string]int64 `json:"summary"`
    27  
    28  	// The total number of the found vulnerabilities
    29  	// Example: 500
    30  	Total int64 `json:"total"`
    31  }
    32  
    33  // Validate validates this vulnerability summary
    34  func (m *VulnerabilitySummary) Validate(formats strfmt.Registry) error {
    35  	return nil
    36  }
    37  
    38  // ContextValidate validates this vulnerability summary based on context it is used
    39  func (m *VulnerabilitySummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
    40  	return nil
    41  }
    42  
    43  // MarshalBinary interface implementation
    44  func (m *VulnerabilitySummary) MarshalBinary() ([]byte, error) {
    45  	if m == nil {
    46  		return nil, nil
    47  	}
    48  	return swag.WriteJSON(m)
    49  }
    50  
    51  // UnmarshalBinary interface implementation
    52  func (m *VulnerabilitySummary) UnmarshalBinary(b []byte) error {
    53  	var res VulnerabilitySummary
    54  	if err := swag.ReadJSON(b, &res); err != nil {
    55  		return err
    56  	}
    57  	*m = res
    58  	return nil
    59  }