Class: Twilio::REST::Memory::V1::RecallList

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

Defined Under Namespace

Classes: CommunicationContent, CommunicationRecipients, MemoryRetrievalRequest, Participant

Instance Method Summary collapse

Constructor Details

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

Initialize the RecallList

Parameters:

  • version (Version)

    Version that contains the resource



133
134
135
136
137
138
139
140
141
# File 'lib/twilio-ruby/rest/memory/v1/recall.rb', line 133

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]}/Recall"
    
end

Instance Method Details

#create(accept_encoding: :unset, content_encoding: :unset, memory_retrieval_request: nil) ⇒ RecallInstance

Create the RecallInstance

Parameters:

  • accept_encoding (String) (defaults to: :unset)

    Compression algorithms supported by the client (e.g., gzip, deflate, br)

  • content_encoding (String) (defaults to: :unset)

    Compression algorithm used for the request body (e.g., gzip, deflate, br)

  • memory_retrieval_request (MemoryRetrievalRequest) (defaults to: nil)

Returns:



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/twilio-ruby/rest/memory/v1/recall.rb', line 148

def create(
  accept_encoding: :unset, 
  content_encoding: :unset,
  memory_retrieval_request: nil
)

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

#create_with_metadata(accept_encoding: :unset, content_encoding: :unset, memory_retrieval_request: nil) ⇒ RecallInstance

Create the RecallInstanceMetadata

Parameters:

  • accept_encoding (String) (defaults to: :unset)

    Compression algorithms supported by the client (e.g., gzip, deflate, br)

  • content_encoding (String) (defaults to: :unset)

    Compression algorithm used for the request body (e.g., gzip, deflate, br)

  • memory_retrieval_request (MemoryRetrievalRequest) (defaults to: nil)

Returns:



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/twilio-ruby/rest/memory/v1/recall.rb', line 175

def (
  accept_encoding: :unset, 
  content_encoding: :unset,
memory_retrieval_request: nil
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Accept-Encoding' => accept_encoding, 'Content-Encoding' => content_encoding, })
    headers['Content-Type'] = 'application/json'
    
    
    
    
    response = @version.('POST', @uri, headers: headers, data: memory_retrieval_request.to_json)
    recall_instance = RecallInstance.new(
        @version,
        response.body,
        store_id: @solution[:store_id],
        profile_id: @solution[:profile_id],
    )
    RecallInstanceMetadata.new(
        @version,
        recall_instance,
        response.headers,
        response.status_code
    )
end

#to_sObject

Provide a user friendly representation



206
207
208
# File 'lib/twilio-ruby/rest/memory/v1/recall.rb', line 206

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