Class: Twilio::REST::Content::V1::ContentContext::ApprovalCreateList
- Inherits:
-
ListResource
- Object
- ListResource
- Twilio::REST::Content::V1::ContentContext::ApprovalCreateList
- Defined in:
- lib/twilio-ruby/rest/content/v1/content/approval_create.rb
Defined Under Namespace
Classes: ContentApprovalRequest
Instance Method Summary collapse
-
#create(content_approval_request: nil) ⇒ ApprovalCreateInstance
Create the ApprovalCreateInstance.
-
#initialize(version, content_sid: nil) ⇒ ApprovalCreateList
constructor
Initialize the ApprovalCreateList.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, content_sid: nil) ⇒ ApprovalCreateList
Initialize the ApprovalCreateList
45 46 47 48 49 50 51 |
# File 'lib/twilio-ruby/rest/content/v1/content/approval_create.rb', line 45 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
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/twilio-ruby/rest/content/v1/content/approval_create.rb', line 56 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_s ⇒ Object
Provide a user friendly representation
77 78 79 |
# File 'lib/twilio-ruby/rest/content/v1/content/approval_create.rb', line 77 def to_s '#<Twilio.Content.V1.ApprovalCreateList>' end |