Class: ApplicationInsights::Channel::Contracts::RequestData
- Inherits:
-
JsonSerializable
- Object
- JsonSerializable
- ApplicationInsights::Channel::Contracts::RequestData
- Defined in:
- lib/application_insights/channel/contracts/request_data.rb
Overview
Data contract class for type RequestData.
Instance Method Summary collapse
-
#duration ⇒ Object
Gets the duration property.
-
#duration=(value) ⇒ Object
Sets the duration property.
-
#http_method ⇒ Object
Gets the http_method property.
-
#http_method=(value) ⇒ Object
Sets the http_method property.
-
#id ⇒ Object
Gets the id property.
-
#id=(value) ⇒ Object
Sets the id property.
-
#initialize(options = {}) ⇒ RequestData
constructor
Initializes a new instance of the RequestData class.
-
#measurements ⇒ Object
Gets the measurements property.
-
#measurements=(value) ⇒ Object
Sets the measurements property.
-
#name ⇒ Object
Gets the name property.
-
#name=(value) ⇒ Object
Sets the name property.
-
#properties ⇒ Object
Gets the properties property.
-
#properties=(value) ⇒ Object
Sets the properties property.
-
#response_code ⇒ Object
Gets the response_code property.
-
#response_code=(value) ⇒ Object
Sets the response_code property.
-
#start_time ⇒ Object
Gets the start_time property.
-
#start_time=(value) ⇒ Object
Sets the start_time property.
-
#success ⇒ Object
Gets the success property.
-
#success=(value) ⇒ Object
Sets the success property.
-
#url ⇒ Object
Gets the url property.
-
#url=(value) ⇒ Object
Sets the url property.
-
#ver ⇒ Object
Gets the ver property.
-
#ver=(value) ⇒ Object
Sets the ver property.
Methods inherited from JsonSerializable
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(={}) 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, end |
Instance Method Details
#duration ⇒ Object
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_method ⇒ Object
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 |
#id ⇒ Object
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 |
#measurements ⇒ Object
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 |
#name ⇒ Object
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 |
#properties ⇒ Object
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_code ⇒ Object
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_time ⇒ Object
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 |
#success ⇒ Object
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 |
#url ⇒ Object
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 |
#ver ⇒ Object
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 |