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.



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb', line 131

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.



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

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).



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

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:



156
157
158
159
160
161
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb', line 156

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



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

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.



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

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.



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

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.



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

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.



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

def fallback_url
    @properties['fallback_url']
end

#fetchDomainConfigMessagingServiceInstance

Fetch the DomainConfigMessagingServiceInstance

Returns:



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

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



234
235
236
237
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb', line 234

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



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

def messaging_service_sid
    @properties['messaging_service_sid']
end

#to_sObject

Provide a user friendly representation



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

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

#urlString

Returns:

  • (String)


213
214
215
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb', line 213

def url
    @properties['url']
end