Class: Twilio::REST::Content::V1::ContentContext::ApprovalFetchInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ ApprovalFetchInstance

Initialize the ApprovalFetchInstance



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 128

def initialize(version, payload , sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'account_sid' => payload['account_sid'],
        'whatsapp' => payload['whatsapp'],
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = { 'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#account_sidString



163
164
165
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 163

def 
    @properties['account_sid']
end

#contextApprovalFetchContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context



148
149
150
151
152
153
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 148

def context
    unless @instance_context
        @instance_context = ApprovalFetchContext.new(@version , @params['sid'])
    end
    @instance_context
end

#fetchApprovalFetchInstance

Fetch the ApprovalFetchInstance



182
183
184
185
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 182

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



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

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Content.V1.ApprovalFetchInstance #{values}>"
end

#sidString



157
158
159
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 157

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



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

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Content.V1.ApprovalFetchInstance #{values}>"
end

#urlString



175
176
177
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 175

def url
    @properties['url']
end

#whatsappHash



169
170
171
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 169

def whatsapp
    @properties['whatsapp']
end