Class: Twilio::REST::Messaging::V1::LinkshorteningMessagingServiceInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, domain_sid: nil, messaging_service_sid: nil) ⇒ LinkshorteningMessagingServiceInstance

Initialize the LinkshorteningMessagingServiceInstance

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 LinkshorteningMessagingService resource.

  • sid (String)

    The SID of the Call resource to fetch.



145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb', line 145

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

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

Instance Method Details

#contextLinkshorteningMessagingServiceContext

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

Returns:



164
165
166
167
168
169
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb', line 164

def context
    unless @instance_context
        @instance_context = LinkshorteningMessagingServiceContext.new(@version , @params['domain_sid'], @params['messaging_service_sid'])
    end
    @instance_context
end

#createLinkshorteningMessagingServiceInstance

Create the LinkshorteningMessagingServiceInstance

Returns:



192
193
194
195
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb', line 192

def create

    context.create
end

#deleteBoolean

Delete the LinkshorteningMessagingServiceInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



200
201
202
203
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb', line 200

def delete

    context.delete
end

#domain_sidString

Returns The unique string identifies the domain resource.

Returns:

  • (String)

    The unique string identifies the domain resource



173
174
175
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb', line 173

def domain_sid
    @properties['domain_sid']
end

#inspectObject

Provide a detailed, user friendly representation



214
215
216
217
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb', line 214

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

#messaging_service_sidString

Returns The unique string that identifies the messaging service.

Returns:

  • (String)

    The unique string that identifies the messaging service



179
180
181
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb', line 179

def messaging_service_sid
    @properties['messaging_service_sid']
end

#to_sObject

Provide a user friendly representation



207
208
209
210
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb', line 207

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

#urlString

Returns:

  • (String)


185
186
187
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb', line 185

def url
    @properties['url']
end