github.com/djarvur/go-swagger@v0.18.0/examples/generated/models/user.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/swag"
    12  )
    13  
    14  // User user
    15  // swagger:model User
    16  type User struct {
    17  
    18  	// email
    19  	Email string `json:"email,omitempty"`
    20  
    21  	// first name
    22  	FirstName string `json:"firstName,omitempty"`
    23  
    24  	// id
    25  	ID int64 `json:"id,omitempty"`
    26  
    27  	// last name
    28  	LastName string `json:"lastName,omitempty"`
    29  
    30  	// password
    31  	Password string `json:"password,omitempty"`
    32  
    33  	// phone
    34  	Phone string `json:"phone,omitempty"`
    35  
    36  	// User Status
    37  	UserStatus int32 `json:"userStatus,omitempty"`
    38  
    39  	// username
    40  	Username string `json:"username,omitempty"`
    41  }
    42  
    43  // Validate validates this user
    44  func (m *User) Validate(formats strfmt.Registry) error {
    45  	return nil
    46  }
    47  
    48  // MarshalBinary interface implementation
    49  func (m *User) MarshalBinary() ([]byte, error) {
    50  	if m == nil {
    51  		return nil, nil
    52  	}
    53  	return swag.WriteJSON(m)
    54  }
    55  
    56  // UnmarshalBinary interface implementation
    57  func (m *User) UnmarshalBinary(b []byte) error {
    58  	var res User
    59  	if err := swag.ReadJSON(b, &res); err != nil {
    60  		return err
    61  	}
    62  	*m = res
    63  	return nil
    64  }