github.com/Files-com/files-sdk-go/v3@v3.1.81/ftpactionlog.go (about)

     1  package files_sdk
     2  
     3  import (
     4  	"encoding/json"
     5  	"time"
     6  
     7  	lib "github.com/Files-com/files-sdk-go/v3/lib"
     8  )
     9  
    10  type FtpActionLog struct {
    11  	Timestamp       *time.Time `json:"timestamp,omitempty" path:"timestamp,omitempty" url:"timestamp,omitempty"`
    12  	RemoteIp        string     `json:"remote_ip,omitempty" path:"remote_ip,omitempty" url:"remote_ip,omitempty"`
    13  	ServerIp        string     `json:"server_ip,omitempty" path:"server_ip,omitempty" url:"server_ip,omitempty"`
    14  	Username        string     `json:"username,omitempty" path:"username,omitempty" url:"username,omitempty"`
    15  	SessionUuid     string     `json:"session_uuid,omitempty" path:"session_uuid,omitempty" url:"session_uuid,omitempty"`
    16  	SeqId           int64      `json:"seq_id,omitempty" path:"seq_id,omitempty" url:"seq_id,omitempty"`
    17  	AuthCiphers     string     `json:"auth_ciphers,omitempty" path:"auth_ciphers,omitempty" url:"auth_ciphers,omitempty"`
    18  	ActionType      string     `json:"action_type,omitempty" path:"action_type,omitempty" url:"action_type,omitempty"`
    19  	Path            string     `json:"path,omitempty" path:"path,omitempty" url:"path,omitempty"`
    20  	TruePath        string     `json:"true_path,omitempty" path:"true_path,omitempty" url:"true_path,omitempty"`
    21  	Name            string     `json:"name,omitempty" path:"name,omitempty" url:"name,omitempty"`
    22  	Cmd             string     `json:"cmd,omitempty" path:"cmd,omitempty" url:"cmd,omitempty"`
    23  	Param           string     `json:"param,omitempty" path:"param,omitempty" url:"param,omitempty"`
    24  	ResponseCode    string     `json:"responseCode,omitempty" path:"responseCode,omitempty" url:"responseCode,omitempty"`
    25  	ResponseMessage string     `json:"responseMessage,omitempty" path:"responseMessage,omitempty" url:"responseMessage,omitempty"`
    26  	EntriesReturned int64      `json:"entries_returned,omitempty" path:"entries_returned,omitempty" url:"entries_returned,omitempty"`
    27  	Success         string     `json:"success,omitempty" path:"success,omitempty" url:"success,omitempty"`
    28  	DurationMs      int64      `json:"duration_ms,omitempty" path:"duration_ms,omitempty" url:"duration_ms,omitempty"`
    29  }
    30  
    31  func (f FtpActionLog) Identifier() interface{} {
    32  	return f.Path
    33  }
    34  
    35  type FtpActionLogCollection []FtpActionLog
    36  
    37  type FtpActionLogListParams struct {
    38  	Filter       FtpActionLog           `url:"filter,omitempty" required:"false" json:"filter,omitempty" path:"filter"`
    39  	FilterPrefix map[string]interface{} `url:"filter_prefix,omitempty" required:"false" json:"filter_prefix,omitempty" path:"filter_prefix"`
    40  	ListParams
    41  }
    42  
    43  func (f *FtpActionLog) UnmarshalJSON(data []byte) error {
    44  	type ftpActionLog FtpActionLog
    45  	var v ftpActionLog
    46  	if err := json.Unmarshal(data, &v); err != nil {
    47  		return lib.ErrorWithOriginalResponse{}.ProcessError(data, err, map[string]interface{}{})
    48  	}
    49  
    50  	*f = FtpActionLog(v)
    51  	return nil
    52  }
    53  
    54  func (f *FtpActionLogCollection) UnmarshalJSON(data []byte) error {
    55  	type ftpActionLogs FtpActionLogCollection
    56  	var v ftpActionLogs
    57  	if err := json.Unmarshal(data, &v); err != nil {
    58  		return lib.ErrorWithOriginalResponse{}.ProcessError(data, err, []map[string]interface{}{})
    59  	}
    60  
    61  	*f = FtpActionLogCollection(v)
    62  	return nil
    63  }
    64  
    65  func (f *FtpActionLogCollection) ToSlice() *[]interface{} {
    66  	ret := make([]interface{}, len(*f))
    67  	for i, v := range *f {
    68  		ret[i] = v
    69  	}
    70  
    71  	return &ret
    72  }