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



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

Parameters:

Returns:



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_sObject

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