Class: Twilio::REST::Memory::V1::EventList

Inherits:
ListResource show all
Defined in:
lib/twilio-ruby/rest/memory/v1/event.rb

Defined Under Namespace

Classes: CommunicationLifecycleEventRecipient, CommunicationLifecycleEventSender, ProfileEventRequest, ProfileEventRequestEvents

Instance Method Summary collapse

Constructor Details

#initialize(version, store_id: nil, profile_id: nil) ⇒ EventList

Initialize the EventList

Parameters:

  • version (Version)

    Version that contains the resource



118
119
120
121
122
123
124
125
126
# File 'lib/twilio-ruby/rest/memory/v1/event.rb', line 118

def initialize(version, store_id: nil, profile_id: nil)
    
    apiV1Version = ApiV1Version.new version.domain, version
    super(apiV1Version)
    # Path Solution
    @solution = { store_id: store_id, profile_id: profile_id }
    @uri = "/Stores/#{@solution[:store_id]}/Profiles/#{@solution[:profile_id]}/Events"
    
end

Instance Method Details

#create(profile_event_request: :unset) ⇒ EventInstance

Create the EventInstance

Parameters:

Returns:



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

def create(profile_event_request: :unset
)

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

#create_with_metadata(profile_event_request: :unset) ⇒ EventInstance

Create the EventInstanceMetadata

Parameters:

Returns:



153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/twilio-ruby/rest/memory/v1/event.rb', line 153

def (profile_event_request: :unset
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    headers['Content-Type'] = 'application/json'
    
    
    
    
    response = @version.('POST', @uri, headers: headers, data: profile_event_request.to_json)
    event_instance = EventInstance.new(
        @version,
        response.body,
        store_id: @solution[:store_id],
        profile_id: @solution[:profile_id],
    )
    EventInstanceMetadata.new(
        @version,
        event_instance,
        response.headers,
        response.status_code
    )
end

#to_sObject

Provide a user friendly representation



181
182
183
# File 'lib/twilio-ruby/rest/memory/v1/event.rb', line 181

def to_s
    '#<Twilio.Memory.V1.EventList>'
end