github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/models/project_scanner.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  // ProjectScanner project scanner
    18  //
    19  // swagger:model ProjectScanner
    20  type ProjectScanner struct {
    21  
    22  	// The identifier of the scanner registration
    23  	// Required: true
    24  	UUID *string `json:"uuid"`
    25  }
    26  
    27  // Validate validates this project scanner
    28  func (m *ProjectScanner) Validate(formats strfmt.Registry) error {
    29  	var res []error
    30  
    31  	if err := m.validateUUID(formats); err != nil {
    32  		res = append(res, err)
    33  	}
    34  
    35  	if len(res) > 0 {
    36  		return errors.CompositeValidationError(res...)
    37  	}
    38  	return nil
    39  }
    40  
    41  func (m *ProjectScanner) validateUUID(formats strfmt.Registry) error {
    42  
    43  	if err := validate.Required("uuid", "body", m.UUID); err != nil {
    44  		return err
    45  	}
    46  
    47  	return nil
    48  }
    49  
    50  // ContextValidate validates this project scanner based on context it is used
    51  func (m *ProjectScanner) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
    52  	return nil
    53  }
    54  
    55  // MarshalBinary interface implementation
    56  func (m *ProjectScanner) MarshalBinary() ([]byte, error) {
    57  	if m == nil {
    58  		return nil, nil
    59  	}
    60  	return swag.WriteJSON(m)
    61  }
    62  
    63  // UnmarshalBinary interface implementation
    64  func (m *ProjectScanner) UnmarshalBinary(b []byte) error {
    65  	var res ProjectScanner
    66  	if err := swag.ReadJSON(b, &res); err != nil {
    67  		return err
    68  	}
    69  	*m = res
    70  	return nil
    71  }