Class: Twilio::REST::FlexApi::V1::InsightsSegmentsContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/flex_api/v1/insights_segments.rb

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].

Instance Method Summary collapse

Constructor Details

#initialize(version, segment_id) ⇒ InsightsSegmentsContext

Initialize the InsightsSegmentsContext

Parameters:

  • version (Version)

    Version that contains the resource

  • segment_id (String)

    To unique id of the segment



167
168
169
170
171
172
173
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_segments.rb', line 167

def initialize(version, segment_id)
  super(version)

  # Path Solution
  @solution = {segment_id: segment_id, }
  @uri = "/Insights/Segments/#{@solution[:segment_id]}"
end

Instance Method Details

#fetch(token: :unset) ⇒ InsightsSegmentsInstance

Fetch the InsightsSegmentsInstance

Parameters:

  • token (String) (defaults to: :unset)

    The Token HTTP request header

Returns:



179
180
181
182
183
184
185
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_segments.rb', line 179

def fetch(token: :unset)
  headers = Twilio::Values.of({'Token' => token, })

  payload = @version.fetch('GET', @uri, headers: headers)

  InsightsSegmentsInstance.new(@version, payload, segment_id: @solution[:segment_id], )
end

#inspectObject

Provide a detailed, user friendly representation



196
197
198
199
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_segments.rb', line 196

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.FlexApi.V1.InsightsSegmentsContext #{context}>"
end

#to_sObject

Provide a user friendly representation



189
190
191
192
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_segments.rb', line 189

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.FlexApi.V1.InsightsSegmentsContext #{context}>"
end