Class: Twilio::REST::Intelligence::V2::OperatorAttachmentsInstance

Inherits:
Twilio::REST::InstanceResource show all
Defined in:
lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, service_sid: nil) ⇒ OperatorAttachmentsInstance

Initialize the OperatorAttachmentsInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this OperatorAttachments resource.

  • sid (String)

    The SID of the Call resource to fetch.



126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb', line 126

def initialize(version, payload , service_sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'service_sid' => payload['service_sid'],
        'operator_sids' => payload['operator_sids'],
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = { 'service_sid' => service_sid  || @properties['service_sid']  , }
end

Instance Method Details

#contextOperatorAttachmentsContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



145
146
147
148
149
150
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb', line 145

def context
    unless @instance_context
        @instance_context = OperatorAttachmentsContext.new(@version , @params['service_sid'])
    end
    @instance_context
end

#fetchOperatorAttachmentsInstance

Fetch the OperatorAttachmentsInstance

Returns:



173
174
175
176
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb', line 173

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



187
188
189
190
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb', line 187

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Intelligence.V2.OperatorAttachmentsInstance #{values}>"
end

#operator_sidsArray<String>

Returns List of Operator SIDs attached to the service. Includes both Custom and Pre-built Operators.

Returns:

  • (Array<String>)

    List of Operator SIDs attached to the service. Includes both Custom and Pre-built Operators.



160
161
162
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb', line 160

def operator_sids
    @properties['operator_sids']
end

#service_sidString

Returns The unique SID identifier of the Service.

Returns:

  • (String)

    The unique SID identifier of the Service.



154
155
156
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb', line 154

def service_sid
    @properties['service_sid']
end

#to_sObject

Provide a user friendly representation



180
181
182
183
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb', line 180

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Intelligence.V2.OperatorAttachmentsInstance #{values}>"
end

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



166
167
168
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb', line 166

def url
    @properties['url']
end