Class: Twilio::REST::Messaging::V1::DomainConfigMessagingServiceInstance

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

Instance Method Summary collapse

Constructor Details

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

Initialize the DomainConfigMessagingServiceInstance

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

  • sid (String)

    The SID of the Call resource to fetch.



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb', line 126

def initialize(version, payload , messaging_service_sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'domain_sid' => payload['domain_sid'],
        'config_sid' => payload['config_sid'],
        'messaging_service_sid' => payload['messaging_service_sid'],
        'fallback_url' => payload['fallback_url'],
        'callback_url' => payload['callback_url'],
        'continue_on_failure' => payload['continue_on_failure'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'url' => payload['url'],
    }

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

Instance Method Details

#callback_urlString

Returns URL to receive click events to your webhook whenever the recipients click on the shortened links.

Returns:

  • (String)

    URL to receive click events to your webhook whenever the recipients click on the shortened links.



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

def callback_url
    @properties['callback_url']
end

#config_sidString

Returns The unique string that we created to identify the Domain config (prefix ZK).

Returns:

  • (String)

    The unique string that we created to identify the Domain config (prefix ZK).



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

def config_sid
    @properties['config_sid']
end

#contextDomainConfigMessagingServiceContext

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

Returns:



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

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

#continue_on_failureBoolean

Returns Boolean field to set customer delivery preference when there is a failure in linkShortening service.

Returns:

  • (Boolean)

    Boolean field to set customer delivery preference when there is a failure in linkShortening service



190
191
192
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb', line 190

def continue_on_failure
    @properties['continue_on_failure']
end

#date_createdTime

Returns Date this Domain Config was created.

Returns:

  • (Time)

    Date this Domain Config was created.



196
197
198
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb', line 196

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns Date that this Domain Config was last updated.

Returns:

  • (Time)

    Date that this Domain Config was last updated.



202
203
204
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb', line 202

def date_updated
    @properties['date_updated']
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.



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

def domain_sid
    @properties['domain_sid']
end

#fallback_urlString

Returns Any requests we receive to this domain that do not match an existing shortened message will be redirected to the fallback url. These will likely be either expired messages, random misdirected traffic, or intentional scraping.

Returns:

  • (String)

    Any requests we receive to this domain that do not match an existing shortened message will be redirected to the fallback url. These will likely be either expired messages, random misdirected traffic, or intentional scraping.



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

def fallback_url
    @properties['fallback_url']
end

#fetchDomainConfigMessagingServiceInstance

Fetch the DomainConfigMessagingServiceInstance

Returns:



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

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



229
230
231
232
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb', line 229

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

#messaging_service_sidString

Returns The unique string that identifies the messaging service.

Returns:

  • (String)

    The unique string that identifies the messaging service



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

def messaging_service_sid
    @properties['messaging_service_sid']
end

#to_sObject

Provide a user friendly representation



222
223
224
225
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb', line 222

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

#urlString

Returns:

  • (String)


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

def url
    @properties['url']
end