Class: Files::ClientLog

Inherits:
Object
  • Object
show all
Defined in:
lib/files.com/models/client_log.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}, options = {}) ⇒ ClientLog

Returns a new instance of ClientLog.



7
8
9
10
# File 'lib/files.com/models/client_log.rb', line 7

def initialize(attributes = {}, options = {})
  @attributes = attributes || {}
  @options = options || {}
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



5
6
7
# File 'lib/files.com/models/client_log.rb', line 5

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/files.com/models/client_log.rb', line 5

def options
  @options
end

Class Method Details

.log(params = {}, options = {}) ⇒ Object

Parameters:

identifier (required) - string - Client log stream identifier
body (required) - string - NDJSON log records


15
16
17
18
19
20
21
22
23
# File 'lib/files.com/models/client_log.rb', line 15

def self.log(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: identifier must be an String") if params[:identifier] and !params[:identifier].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: body must be an String") if params[:body] and !params[:body].is_a?(String)
  raise MissingParameterError.new("Parameter missing: identifier") unless params[:identifier]
  raise MissingParameterError.new("Parameter missing: body") unless params[:body]

  Api.send_request("/client_logs/log", :post, params, options)
  nil
end