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

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this ApprovalFetch resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 133

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

Returns The SID of the [Account](www.twilio.com/docs/usage/api/account) that created Content resource.

Returns:



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

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

Returns:



153
154
155
156
157
158
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 153

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

#fetchApprovalFetchInstance

Fetch the ApprovalFetchInstance

Returns:



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

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



201
202
203
204
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 201

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

#sidString

Returns The unique string that that we created to identify the Content resource.

Returns:

  • (String)

    The unique string that that we created to identify the Content resource.



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

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



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

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

#urlString

Returns The URL of the resource, relative to ‘content.twilio.com`.

Returns:



180
181
182
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 180

def url
    @properties['url']
end

#whatsappHash

Returns Contains the whatsapp approval information for the Content resource, with fields such as approval status, rejection reason, and category, amongst others.

Returns:

  • (Hash)

    Contains the whatsapp approval information for the Content resource, with fields such as approval status, rejection reason, and category, amongst others.



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

def whatsapp
    @properties['whatsapp']
end