Class: Twilio::REST::Messaging::V1::LinkshorteningMessagingServiceContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Instance Method Summary collapse

Constructor Details

#initialize(version, domain_sid, messaging_service_sid) ⇒ LinkshorteningMessagingServiceContext

Initialize the LinkshorteningMessagingServiceContext

Parameters:

  • version (Version)

    Version that contains the resource

  • domain_sid (String)

    The domain SID to dissociate from a messaging service. With URL shortening enabled, links in messages sent with the associated messaging service will be shortened to the provided domain

  • messaging_service_sid (String)

    A messaging service SID to dissociate from a domain. With URL shortening enabled, links in messages sent with the provided messaging service will be shortened to the associated domain



78
79
80
81
82
83
84
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb', line 78

def initialize(version, domain_sid, messaging_service_sid)
  super(version)

  # Path Solution
  @solution = {domain_sid: domain_sid, messaging_service_sid: messaging_service_sid, }
  @uri = "/LinkShortening/Domains/#{@solution[:domain_sid]}/MessagingServices/#{@solution[:messaging_service_sid]}"
end

Instance Method Details

#createLinkshorteningMessagingServiceInstance

Create the LinkshorteningMessagingServiceInstance

Returns:



89
90
91
92
93
94
95
96
97
98
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb', line 89

def create
  payload = @version.create('POST', @uri)

  LinkshorteningMessagingServiceInstance.new(
      @version,
      payload,
      domain_sid: @solution[:domain_sid],
      messaging_service_sid: @solution[:messaging_service_sid],
  )
end

#deleteBoolean

Delete the LinkshorteningMessagingServiceInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise



103
104
105
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb', line 103

def delete
   @version.delete('DELETE', @uri)
end

#inspectObject

Provide a detailed, user friendly representation



116
117
118
119
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb', line 116

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Messaging.V1.LinkshorteningMessagingServiceContext #{context}>"
end

#to_sObject

Provide a user friendly representation



109
110
111
112
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb', line 109

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Messaging.V1.LinkshorteningMessagingServiceContext #{context}>"
end