Class: Twilio::REST::FlexApi::V1::InsightsSessionContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ InsightsSessionContext

Initialize the InsightsSessionContext

Parameters:

  • version (Version)

    Version that contains the resource



49
50
51
52
53
54
55
56
57
58
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 49

def initialize(version)
    super(version)
    

    # Path Solution
    @solution = {  }
    @uri = "/Insights/Session"

    
end

Instance Method Details

#create(authorization: :unset) ⇒ InsightsSessionInstance

Create the InsightsSessionInstance

Parameters:

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

    The Authorization HTTP request header

Returns:



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 63

def create(
    authorization: :unset
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Authorization' => authorization, })
    
    
    
    
    
    payload = @version.create('POST', @uri, headers: headers)
    InsightsSessionInstance.new(
        @version,
        payload,
    )
end

#create_with_metadata(authorization: :unset) ⇒ InsightsSessionInstance

Create the InsightsSessionInstanceMetadata

Parameters:

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

    The Authorization HTTP request header

Returns:



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 84

def (
  authorization: :unset
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Authorization' => authorization, })
    
    
    
    
    
    response = @version.('POST', @uri, headers: headers)
    insights_session_instance = InsightsSessionInstance.new(
        @version,
        response.body,
    )
    .new(
        @version,
        insights_session_instance,
        response.headers,
        response.status_code
    )
end

#inspectObject

Provide a detailed, user friendly representation



117
118
119
120
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 117

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

#to_sObject

Provide a user friendly representation



110
111
112
113
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 110

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