class MoesifApi::EventRequestModel

Attributes

api_version[RW]

Optionally tag the call with your API or App version @return [String]

body[RW]

Request body @return [Object]

headers[RW]

Key/Value map of request headers @return [Object]

ip_address[RW]

IP Address of the client if known. @return [String]

time[RW]

Time when request was made @return [DateTime]

transfer_encoding[RW]

Transfer Encoding of body if other than JSON @return [String]

uri[RW]

full uri of request such as www.example.com/my_path?param=1 @return [String]

verb[RW]

verb of the API request such as GET or POST @return [String]

Public Class Methods

from_hash(hash) click to toggle source

Creates an instance of the object from a hash

# File lib/moesif_api/models/event_request_model.rb, line 73
def self.from_hash(hash)
  if hash == nil
    nil
  else
    # Extract variables from the hash
    time = DateTime.iso8601(hash["time"]) if hash["time"]
    uri = hash["uri"]
    verb = hash["verb"]
    headers = hash["headers"]
    api_version = hash["api_version"]
    ip_address = hash["ip_address"]
    body = hash["body"]
    transfer_encoding = hash["transfer_encoding"]

    # Create object from extracted values
    EventRequestModel.new(time,
                          uri,
                          verb,
                          headers,
                          api_version,
                          ip_address,
                          body,
                          transfer_encoding)
  end
end
names() click to toggle source

A mapping from model property names to API property names

# File lib/moesif_api/models/event_request_model.rb, line 39
def self.names
  if @hash.nil?
    @hash = {}
    @hash["time"] = "time"
    @hash["uri"] = "uri"
    @hash["verb"] = "verb"
    @hash["headers"] = "headers"
    @hash["api_version"] = "api_version"
    @hash["ip_address"] = "ip_address"
    @hash["body"] = "body"
    @hash["transfer_encoding"] = "transfer_encoding"
  end
  @hash
end
new(time = nil, uri = nil, verb = nil, headers = nil, api_version = nil, ip_address = nil, body = nil, transfer_encoding = nil) click to toggle source
# File lib/moesif_api/models/event_request_model.rb, line 54
def initialize(time = nil,
               uri = nil,
               verb = nil,
               headers = nil,
               api_version = nil,
               ip_address = nil,
               body = nil,
               transfer_encoding = nil)
  @time = time
  @uri = uri
  @verb = verb
  @headers = headers
  @api_version = api_version
  @ip_address = ip_address
  @body = body
  @transfer_encoding = transfer_encoding
end