Class: Twilio::REST::Studio::V2::FlowContext::FlowRevisionContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, sid, revision) ⇒ FlowRevisionContext

Initialize the FlowRevisionContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The SID of the Flow resource to fetch.

  • revision (String)

    Specific Revision number or can be ‘LatestPublished` and `LatestRevision`.



139
140
141
142
143
144
145
146
147
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 139

def initialize(version, sid, revision)
    super(version)

    # Path Solution
    @solution = { sid: sid, revision: revision,  }
    @uri = "/Flows/#{@solution[:sid]}/Revisions/#{@solution[:revision]}"

    
end

Instance Method Details

#fetchFlowRevisionInstance

Fetch the FlowRevisionInstance

Returns:



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 151

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    FlowRevisionInstance.new(
        @version,
        payload,
        sid: @solution[:sid],
        revision: @solution[:revision],
    )
end

#inspectObject

Provide a detailed, user friendly representation



178
179
180
181
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 178

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

#to_sObject

Provide a user friendly representation



171
172
173
174
# File 'lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb', line 171

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