Class: Twilio::REST::Insights::V3::ResultList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/insights/v3/result.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, operation_id: nil) ⇒ ResultList

Initialize the ResultList

Parameters:

  • version (Version) —

    Version that contains the resource



26
27
28
29
30
31
32
33
34
# File 'lib/twilio-ruby/rest/insights/v3/result.rb', line 26

def initialize(version, operation_id: nil)
    
    apiV1Version = ApiV1Version.new version.domain, version
    super(apiV1Version)
    # Path Solution
    @solution = { operation_id: operation_id }
    @uri = "/InsightsDomains/Conversations/QueryJobs/#{@solution[:operation_id]}/Results"
    
end

Instance Method Details

#fetch(page_size: :unset, page_token: :unset) ⇒ ResultInstance

Fetch the ResultInstance

Parameters:

  • page_size (String) (defaults to: :unset) —

    The maximum number of resources to return

  • page_token (String) (defaults to: :unset) —

    Token for pagination

Returns:



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/twilio-ruby/rest/insights/v3/result.rb', line 40

def fetch(
  page_size: :unset, 
  page_token: :unset
)

    params = Twilio::Values.of({
        'pageSize' => page_size,
        'pageToken' => page_token,
    })
    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, params: params, headers: headers)
    ResultInstance.new(
        @version,
        payload,
        operation_id: @solution[:operation_id],
    )
end

#fetch_with_metadata(page_size: :unset, page_token: :unset) ⇒ ResultInstance

Fetch the ResultInstanceMetadata

Parameters:

  • page_size (String) (defaults to: :unset) —

    The maximum number of resources to return

  • page_token (String) (defaults to: :unset) —

    Token for pagination

Returns:



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/twilio-ruby/rest/insights/v3/result.rb', line 68

def (
  page_size: :unset, 
  page_token: :unset
)

    params = Twilio::Values.of({
        'pageSize' => page_size,
        'pageToken' => page_token,
    })
    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('GET', @uri, params: params, headers: headers)
    result_instance = ResultInstance.new(
        @version,
        response.body,
        operation_id: @solution[:operation_id],
    )
    .new(
        @version,
        result_instance,
        response.headers,
        response.status_code
    )
end

#to_s ⇒ Object

Provide a user friendly representation



101
102
103
# File 'lib/twilio-ruby/rest/insights/v3/result.rb', line 101

def to_s
    '#<Twilio.Insights.V3.ResultList>'
end