github.com/crowdsecurity/crowdsec@v1.6.1/pkg/models/watcher_auth_response.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  // WatcherAuthResponse WatcherAuthResponse
    16  //
    17  // the response of a successful authentication
    18  //
    19  // swagger:model WatcherAuthResponse
    20  type WatcherAuthResponse struct {
    21  
    22  	// code
    23  	Code int64 `json:"code,omitempty"`
    24  
    25  	// expire
    26  	Expire string `json:"expire,omitempty"`
    27  
    28  	// token
    29  	Token string `json:"token,omitempty"`
    30  }
    31  
    32  // Validate validates this watcher auth response
    33  func (m *WatcherAuthResponse) Validate(formats strfmt.Registry) error {
    34  	return nil
    35  }
    36  
    37  // ContextValidate validates this watcher auth response based on context it is used
    38  func (m *WatcherAuthResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
    39  	return nil
    40  }
    41  
    42  // MarshalBinary interface implementation
    43  func (m *WatcherAuthResponse) MarshalBinary() ([]byte, error) {
    44  	if m == nil {
    45  		return nil, nil
    46  	}
    47  	return swag.WriteJSON(m)
    48  }
    49  
    50  // UnmarshalBinary interface implementation
    51  func (m *WatcherAuthResponse) UnmarshalBinary(b []byte) error {
    52  	var res WatcherAuthResponse
    53  	if err := swag.ReadJSON(b, &res); err != nil {
    54  		return err
    55  	}
    56  	*m = res
    57  	return nil
    58  }