Class: Twilio::REST::Preview::BulkExports::ExportContext::DayInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Preview::BulkExports::ExportContext::DayInstance
- Defined in:
- lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb
Overview
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].
Instance Method Summary collapse
-
#context ⇒ DayContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#create_date ⇒ String
The date when resource is created.
-
#day ⇒ String
The date of the data in the file.
-
#fetch ⇒ DayInstance
Fetch the DayInstance.
-
#friendly_name ⇒ String
The friendly name specified when creating the job.
-
#initialize(version, payload, resource_type: nil, day: nil) ⇒ DayInstance
constructor
Initialize the DayInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#redirect_to ⇒ String
The redirect_to.
-
#resource_type ⇒ String
The type of communication – Messages, Calls, Conferences, and Participants.
-
#size ⇒ String
Size of the file in bytes.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, payload, resource_type: nil, day: nil) ⇒ DayInstance
Initialize the DayInstance
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb', line 204 def initialize(version, payload, resource_type: nil, day: nil) super(version) # Marshaled Properties @properties = { 'redirect_to' => payload['redirect_to'], 'day' => payload['day'], 'size' => payload['size'].to_i, 'create_date' => payload['create_date'], 'friendly_name' => payload['friendly_name'], 'resource_type' => payload['resource_type'], } # Context @instance_context = nil @params = {'resource_type' => resource_type, 'day' => day || @properties['day'], } end |
Instance Method Details
#context ⇒ DayContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
226 227 228 229 230 231 |
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb', line 226 def context unless @instance_context @instance_context = DayContext.new(@version, @params['resource_type'], @params['day'], ) end @instance_context end |
#create_date ⇒ String
Returns The date when resource is created.
253 254 255 |
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb', line 253 def create_date @properties['create_date'] end |
#day ⇒ String
Returns The date of the data in the file.
241 242 243 |
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb', line 241 def day @properties['day'] end |
#fetch ⇒ DayInstance
Fetch the DayInstance
272 273 274 |
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb', line 272 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The friendly name specified when creating the job.
259 260 261 |
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb', line 259 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
285 286 287 288 |
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb', line 285 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.BulkExports.DayInstance #{values}>" end |
#redirect_to ⇒ String
Returns The redirect_to.
235 236 237 |
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb', line 235 def redirect_to @properties['redirect_to'] end |
#resource_type ⇒ String
Returns The type of communication – Messages, Calls, Conferences, and Participants.
265 266 267 |
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb', line 265 def resource_type @properties['resource_type'] end |
#size ⇒ String
Returns Size of the file in bytes.
247 248 249 |
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb', line 247 def size @properties['size'] end |
#to_s ⇒ Object
Provide a user friendly representation
278 279 280 281 |
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb', line 278 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.BulkExports.DayInstance #{values}>" end |