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

Parameters:

  • version (Version)

    Version that contains the resource



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

Parameters:

Returns:



55
56
57
58
59
60
61
62
63
64
65
# 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/json"})
    payload = @version.create('POST', @uri, data: content_approval_request.to_json, headers: headers)
    ApprovalCreateInstance.new(
        @version,
        payload,
        content_sid: @solution[:content_sid],
    )
end

#to_sObject

Provide a user friendly representation



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

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