Class: ApplicationInsights::Channel::Contracts::RequestData

Inherits:
JsonSerializable show all
Defined in:
lib/application_insights/channel/contracts/request_data.rb

Overview

Data contract class for type RequestData.

Instance Method Summary collapse

Methods inherited from JsonSerializable

#to_h, #to_json

Constructor Details

#initialize(options = {}) ⇒ RequestData

Initializes a new instance of the RequestData class.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/application_insights/channel/contracts/request_data.rb', line 9

def initialize(options={})
  defaults = {
    'ver' => 2,
    'id' => nil,
    'name' => nil,
    'startTime' => nil,
    'duration' => nil,
    'responseCode' => nil,
    'success' => nil,
    'httpMethod' => nil,
    'url' => nil,
    'properties' => {},
    'measurements' => {}
  }
  values = {
    'ver' => 2,
    'id' => nil,
    'startTime' => nil,
    'duration' => nil,
    'responseCode' => nil,
    'success' => nil
  }
  super defaults, values, options
end

Instance Method Details

#durationObject

Gets the duration property.



81
82
83
# File 'lib/application_insights/channel/contracts/request_data.rb', line 81

def duration
  @values['duration']
end

#duration=(value) ⇒ Object

Sets the duration property.



86
87
88
# File 'lib/application_insights/channel/contracts/request_data.rb', line 86

def duration=(value)
  @values['duration'] = value
end

#http_methodObject

Gets the http_method property.



111
112
113
114
115
# File 'lib/application_insights/channel/contracts/request_data.rb', line 111

def http_method
  @values.fetch('httpMethod') { 
    @values['httpMethod'] = nil
  }
end

#http_method=(value) ⇒ Object

Sets the http_method property.



118
119
120
121
122
123
124
# File 'lib/application_insights/channel/contracts/request_data.rb', line 118

def http_method=(value)
  if value == @defaults['httpMethod']
    @values.delete 'httpMethod' if @values.key? 'httpMethod'
  else
    @values['httpMethod'] = value
  end
end

#idObject

Gets the id property.



45
46
47
# File 'lib/application_insights/channel/contracts/request_data.rb', line 45

def id
  @values['id']
end

#id=(value) ⇒ Object

Sets the id property.



50
51
52
# File 'lib/application_insights/channel/contracts/request_data.rb', line 50

def id=(value)
  @values['id'] = value
end

#measurementsObject

Gets the measurements property.



159
160
161
162
163
# File 'lib/application_insights/channel/contracts/request_data.rb', line 159

def measurements
  @values.fetch('measurements') { 
    @values['measurements'] = {}
  }
end

#measurements=(value) ⇒ Object

Sets the measurements property.



166
167
168
169
170
171
172
# File 'lib/application_insights/channel/contracts/request_data.rb', line 166

def measurements=(value)
  if value == @defaults['measurements']
    @values.delete 'measurements' if @values.key? 'measurements'
  else
    @values['measurements'] = value
  end
end

#nameObject

Gets the name property.



55
56
57
58
59
# File 'lib/application_insights/channel/contracts/request_data.rb', line 55

def name
  @values.fetch('name') { 
    @values['name'] = nil
  }
end

#name=(value) ⇒ Object

Sets the name property.



62
63
64
65
66
67
68
# File 'lib/application_insights/channel/contracts/request_data.rb', line 62

def name=(value)
  if value == @defaults['name']
    @values.delete 'name' if @values.key? 'name'
  else
    @values['name'] = value
  end
end

#propertiesObject

Gets the properties property.



143
144
145
146
147
# File 'lib/application_insights/channel/contracts/request_data.rb', line 143

def properties
  @values.fetch('properties') { 
    @values['properties'] = {}
  }
end

#properties=(value) ⇒ Object

Sets the properties property.



150
151
152
153
154
155
156
# File 'lib/application_insights/channel/contracts/request_data.rb', line 150

def properties=(value)
  if value == @defaults['properties']
    @values.delete 'properties' if @values.key? 'properties'
  else
    @values['properties'] = value
  end
end

#response_codeObject

Gets the response_code property.



91
92
93
# File 'lib/application_insights/channel/contracts/request_data.rb', line 91

def response_code
  @values['responseCode']
end

#response_code=(value) ⇒ Object

Sets the response_code property.



96
97
98
# File 'lib/application_insights/channel/contracts/request_data.rb', line 96

def response_code=(value)
  @values['responseCode'] = value
end

#start_timeObject

Gets the start_time property.



71
72
73
# File 'lib/application_insights/channel/contracts/request_data.rb', line 71

def start_time
  @values['startTime']
end

#start_time=(value) ⇒ Object

Sets the start_time property.



76
77
78
# File 'lib/application_insights/channel/contracts/request_data.rb', line 76

def start_time=(value)
  @values['startTime'] = value
end

#successObject

Gets the success property.



101
102
103
# File 'lib/application_insights/channel/contracts/request_data.rb', line 101

def success
  @values['success']
end

#success=(value) ⇒ Object

Sets the success property.



106
107
108
# File 'lib/application_insights/channel/contracts/request_data.rb', line 106

def success=(value)
  @values['success'] = value
end

#urlObject

Gets the url property.



127
128
129
130
131
# File 'lib/application_insights/channel/contracts/request_data.rb', line 127

def url
  @values.fetch('url') { 
    @values['url'] = nil
  }
end

#url=(value) ⇒ Object

Sets the url property.



134
135
136
137
138
139
140
# File 'lib/application_insights/channel/contracts/request_data.rb', line 134

def url=(value)
  if value == @defaults['url']
    @values.delete 'url' if @values.key? 'url'
  else
    @values['url'] = value
  end
end

#verObject

Gets the ver property.



35
36
37
# File 'lib/application_insights/channel/contracts/request_data.rb', line 35

def ver
  @values['ver']
end

#ver=(value) ⇒ Object

Sets the ver property.



40
41
42
# File 'lib/application_insights/channel/contracts/request_data.rb', line 40

def ver=(value)
  @values['ver'] = value
end