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

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

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



50
51
52
53
54
55
56
57
58
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb', line 50

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:



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb', line 62

def create

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.create('POST', @uri, headers: headers)
    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



82
83
84
85
86
87
88
89
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb', line 82

def delete

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    @version.delete('DELETE', @uri, headers: headers)
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#to_sObject

Provide a user friendly representation



94
95
96
97
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb', line 94

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