Class: Twilio::REST::Messaging::V1::LinkshorteningMessagingServiceDomainAssociationInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, messaging_service_sid: nil) ⇒ LinkshorteningMessagingServiceDomainAssociationInstance

Initialize the LinkshorteningMessagingServiceDomainAssociationInstance

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

  • sid (String)

    The SID of the Call resource to fetch.



131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service_domain_association.rb', line 131

def initialize(version, payload , 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 = { 'messaging_service_sid' => messaging_service_sid  || @properties['messaging_service_sid']  , }
end

Instance Method Details

#contextLinkshorteningMessagingServiceDomainAssociationContext

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

Returns:



150
151
152
153
154
155
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service_domain_association.rb', line 150

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

#domain_sidString

Returns The unique string that we created to identify the Domain resource.

Returns:

  • (String)

    The unique string that we created to identify the Domain resource.



159
160
161
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service_domain_association.rb', line 159

def domain_sid
    @properties['domain_sid']
end

#fetchLinkshorteningMessagingServiceDomainAssociationInstance

Fetch the LinkshorteningMessagingServiceDomainAssociationInstance

Returns:



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

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#messaging_service_sidString

Returns The unique string that identifies the messaging service.

Returns:

  • (String)

    The unique string that identifies the messaging service



165
166
167
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service_domain_association.rb', line 165

def messaging_service_sid
    @properties['messaging_service_sid']
end

#to_sObject

Provide a user friendly representation



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

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

#urlString

Returns:

  • (String)


171
172
173
# File 'lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service_domain_association.rb', line 171

def url
    @properties['url']
end