github.com/thetreep/go-swagger@v0.0.0-20240223100711-35af64f14f01/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  	"context"
    10  
    11  	"github.com/go-openapi/strfmt"
    12  	"github.com/go-openapi/swag"
    13  )
    14  
    15  // User user
    16  //
    17  // swagger:model User
    18  type User struct {
    19  
    20  	// email
    21  	Email string `json:"email,omitempty"`
    22  
    23  	// first name
    24  	FirstName string `json:"firstName,omitempty"`
    25  
    26  	// id
    27  	ID int64 `json:"id,omitempty"`
    28  
    29  	// last name
    30  	LastName string `json:"lastName,omitempty"`
    31  
    32  	// password
    33  	Password string `json:"password,omitempty"`
    34  
    35  	// phone
    36  	Phone string `json:"phone,omitempty"`
    37  
    38  	// User Status
    39  	UserStatus int32 `json:"userStatus,omitempty"`
    40  
    41  	// username
    42  	Username string `json:"username,omitempty"`
    43  }
    44  
    45  // Validate validates this user
    46  func (m *User) Validate(formats strfmt.Registry) error {
    47  	return nil
    48  }
    49  
    50  // ContextValidate validates this user based on context it is used
    51  func (m *User) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
    52  	return nil
    53  }
    54  
    55  // MarshalBinary interface implementation
    56  func (m *User) 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 *User) UnmarshalBinary(b []byte) error {
    65  	var res User
    66  	if err := swag.ReadJSON(b, &res); err != nil {
    67  		return err
    68  	}
    69  	*m = res
    70  	return nil
    71  }