Class: Twilio::REST::Intelligence::V2::OperatorAttachmentContext
- Inherits:
-
Twilio::REST::InstanceContext
- Object
- Twilio::REST::InstanceContext
- Twilio::REST::Intelligence::V2::OperatorAttachmentContext
- Defined in:
- lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb
Instance Method Summary collapse
-
#create ⇒ OperatorAttachmentInstance
Create the OperatorAttachmentInstance.
-
#create_with_metadata ⇒ OperatorAttachmentInstance
Create the OperatorAttachmentInstanceMetadata.
-
#delete ⇒ Boolean
Delete the OperatorAttachmentInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the OperatorAttachmentInstanceMetadata.
-
#initialize(version, service_sid, operator_sid) ⇒ OperatorAttachmentContext
constructor
Initialize the OperatorAttachmentContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, service_sid, operator_sid) ⇒ OperatorAttachmentContext
Initialize the OperatorAttachmentContext
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb', line 51 def initialize(version, service_sid, operator_sid) super(version) # Path Solution @solution = { service_sid: service_sid, operator_sid: operator_sid, } @uri = "/Services/#{@solution[:service_sid]}/Operators/#{@solution[:operator_sid]}" end |
Instance Method Details
#create ⇒ OperatorAttachmentInstance
Create the OperatorAttachmentInstance
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb', line 64 def create headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.create('POST', @uri, headers: headers) OperatorAttachmentInstance.new( @version, payload, service_sid: @solution[:service_sid], operator_sid: @solution[:operator_sid], ) end |
#create_with_metadata ⇒ OperatorAttachmentInstance
Create the OperatorAttachmentInstanceMetadata
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb', line 84 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('POST', @uri, headers: headers) = OperatorAttachmentInstance.new( @version, response.body, service_sid: @solution[:service_sid], operator_sid: @solution[:operator_sid], ) OperatorAttachmentInstanceMetadata.new( @version, , response.headers, response.status_code ) end |
#delete ⇒ Boolean
Delete the OperatorAttachmentInstance
110 111 112 113 114 115 116 117 118 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb', line 110 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#delete_with_metadata ⇒ Boolean
Delete the OperatorAttachmentInstanceMetadata
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb', line 123 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) operatorAttachment_instance = OperatorAttachmentInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) OperatorAttachmentInstanceMetadata.new(@version, operatorAttachment_instance, response.headers, response.status_code) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
149 150 151 152 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb', line 149 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Intelligence.V2.OperatorAttachmentContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
142 143 144 145 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb', line 142 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Intelligence.V2.OperatorAttachmentContext #{context}>" end |