Class: Twilio::REST::Content::V1::ContentContext::ApprovalCreateList

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

Defined Under Namespace

Classes: ContentApprovalRequest

Instance Method Summary collapse

Constructor Details

#initialize(version, content_sid: nil) ⇒ ApprovalCreateList

Initialize the ApprovalCreateList



44
45
46
47
48
49
50
# File 'lib/twilio-ruby/rest/content/v1/content/approval_create.rb', line 44

def initialize(version, content_sid: nil)
    super(version)
    # Path Solution
    @solution = { content_sid: content_sid }
    @uri = "/Content/#{@solution[:content_sid]}/ApprovalRequests/whatsapp"
    
end

Instance Method Details

#create(content_approval_request: nil) ⇒ ApprovalCreateInstance

Create the ApprovalCreateInstance



55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/twilio-ruby/rest/content/v1/content/approval_create.rb', line 55

def create(content_approval_request: nil
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    headers['Content-Type'] = 'application/json'
    payload = @version.create('POST', @uri, headers: headers, data: content_approval_request.to_json)
    ApprovalCreateInstance.new(
        @version,
        payload,
        content_sid: @solution[:content_sid],
    )
end

#to_sObject

Provide a user friendly representation



72
73
74
# File 'lib/twilio-ruby/rest/content/v1/content/approval_create.rb', line 72

def to_s
    '#<Twilio.Content.V1.ApprovalCreateList>'
end