Class: Twilio::REST::Insights::V3::QueryList
- Inherits:
-
ListResource
- Object
- ListResource
- Twilio::REST::Insights::V3::QueryList
- Defined in:
- lib/twilio-ruby/rest/insights/v3/query.rb
Defined Under Namespace
Classes: InsightsQueryRequest, QueryDefinition, QueryDefinitionFilters, QueryDefinitionFiltersExpressions, QueryDefinitionOrderBy
Instance Method Summary collapse
-
#create(page_size: :unset, insights_query_request: nil) ⇒ QueryInstance
Create the QueryInstance.
-
#create_with_metadata(page_size: :unset, insights_query_request: nil) ⇒ QueryInstance
Create the QueryInstanceMetadata.
-
#fetch(page_token: nil) ⇒ QueryInstance
Fetch the QueryInstance.
-
#fetch_with_metadata(page_token: nil) ⇒ QueryInstance
Fetch the QueryInstanceMetadata.
-
#initialize(version) ⇒ QueryList
constructor
Initialize the QueryList.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version) ⇒ QueryList
Initialize the QueryList
116 117 118 119 120 121 122 123 124 |
# File 'lib/twilio-ruby/rest/insights/v3/query.rb', line 116 def initialize(version) apiV1Version = ApiV1Version.new version.domain, version super(apiV1Version) # Path Solution @solution = { } @uri = "/InsightsDomains/Conversations/Query" end |
Instance Method Details
#create(page_size: :unset, insights_query_request: nil) ⇒ QueryInstance
Create the QueryInstance
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/twilio-ruby/rest/insights/v3/query.rb', line 130 def create( page_size: :unset, insights_query_request: nil ) params = Twilio::Values.of({ 'pageSize' => page_size, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' payload = @version.create('POST', @uri, params: params, headers: headers, data: insights_query_request.to_json) QueryInstance.new( @version, payload, ) end |
#create_with_metadata(page_size: :unset, insights_query_request: nil) ⇒ QueryInstance
Create the QueryInstanceMetadata
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 |
# File 'lib/twilio-ruby/rest/insights/v3/query.rb', line 156 def ( page_size: :unset, insights_query_request: nil ) params = Twilio::Values.of({ 'pageSize' => page_size, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' response = @version.('POST', @uri, params: params, headers: headers, data: insights_query_request.to_json) query_instance = QueryInstance.new( @version, response.body, ) QueryInstanceMetadata.new( @version, query_instance, response.headers, response.status_code ) end |
#fetch(page_token: nil) ⇒ QueryInstance
Fetch the QueryInstance
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'lib/twilio-ruby/rest/insights/v3/query.rb', line 187 def fetch( page_token: nil ) params = Twilio::Values.of({ 'pageToken' => page_token, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, params: params, headers: headers) QueryInstance.new( @version, payload, ) end |
#fetch_with_metadata(page_token: nil) ⇒ QueryInstance
Fetch the QueryInstanceMetadata
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/twilio-ruby/rest/insights/v3/query.rb', line 211 def ( page_token: nil ) params = Twilio::Values.of({ 'pageToken' => page_token, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, params: params, headers: headers) query_instance = QueryInstance.new( @version, response.body, ) QueryInstanceMetadata.new( @version, query_instance, response.headers, response.status_code ) end |
#to_s ⇒ Object
Provide a user friendly representation
241 242 243 |
# File 'lib/twilio-ruby/rest/insights/v3/query.rb', line 241 def to_s '#<Twilio.Insights.V3.QueryList>' end |