github.com/aeternity/aepp-sdk-go/v4@v4.0.1/swagguard/compiler/models/calldata.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  	strfmt "github.com/go-openapi/strfmt"
    10  
    11  	"github.com/go-openapi/errors"
    12  	"github.com/go-openapi/swag"
    13  )
    14  
    15  // Calldata calldata
    16  // swagger:model Calldata
    17  type Calldata struct {
    18  
    19  	// calldata
    20  	// Required: true
    21  	Calldata EncodedByteArray `json:"calldata"`
    22  }
    23  
    24  // Validate validates this calldata
    25  func (m *Calldata) Validate(formats strfmt.Registry) error {
    26  	var res []error
    27  
    28  	if err := m.validateCalldata(formats); err != nil {
    29  		res = append(res, err)
    30  	}
    31  
    32  	if len(res) > 0 {
    33  		return errors.CompositeValidationError(res...)
    34  	}
    35  	return nil
    36  }
    37  
    38  func (m *Calldata) validateCalldata(formats strfmt.Registry) error {
    39  
    40  	if err := m.Calldata.Validate(formats); err != nil {
    41  		if ve, ok := err.(*errors.Validation); ok {
    42  			return ve.ValidateName("calldata")
    43  		}
    44  		return err
    45  	}
    46  
    47  	return nil
    48  }
    49  
    50  // MarshalBinary interface implementation
    51  func (m *Calldata) MarshalBinary() ([]byte, error) {
    52  	if m == nil {
    53  		return nil, nil
    54  	}
    55  	return swag.WriteJSON(m)
    56  }
    57  
    58  // UnmarshalBinary interface implementation
    59  func (m *Calldata) UnmarshalBinary(b []byte) error {
    60  	var res Calldata
    61  	if err := swag.ReadJSON(b, &res); err != nil {
    62  		return err
    63  	}
    64  	*m = res
    65  	return nil
    66  }