Class: Twilio::REST::Messaging::V1::DomainConfigInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, domain_sid: nil) ⇒ DomainConfigInstance

Initialize the DomainConfigInstance

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

  • sid (String)

    The SID of the Call resource to fetch.



342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config.rb', line 342

def initialize(version, payload , domain_sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'domain_sid' => payload['domain_sid'],
        'config_sid' => payload['config_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'],
        'disable_https' => payload['disable_https'],
    }

    # Context
    @instance_context = nil
    @params = { 'domain_sid' => domain_sid  || @properties['domain_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.



395
396
397
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config.rb', line 395

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



383
384
385
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config.rb', line 383

def config_sid
    @properties['config_sid']
end

#contextDomainConfigContext

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

Returns:



368
369
370
371
372
373
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config.rb', line 368

def context
    unless @instance_context
        @instance_context = DomainConfigContext.new(@version , @params['domain_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



401
402
403
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config.rb', line 401

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.



407
408
409
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config.rb', line 407

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.



413
414
415
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config.rb', line 413

def date_updated
    @properties['date_updated']
end

#disable_httpsBoolean

Returns Customer’s choice to send links with/without "https://" attached to shortened url. If true, messages will not be sent with https:// at the beginning of the url. If false, messages will be sent with https:// at the beginning of the url. False is the default behavior if it is not specified.

Returns:

  • (Boolean)

    Customer’s choice to send links with/without "https://" attached to shortened url. If true, messages will not be sent with https:// at the beginning of the url. If false, messages will be sent with https:// at the beginning of the url. False is the default behavior if it is not specified.



425
426
427
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config.rb', line 425

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



377
378
379
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config.rb', line 377

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.



389
390
391
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config.rb', line 389

def fallback_url
    @properties['fallback_url']
end

#fetchDomainConfigInstance

Fetch the DomainConfigInstance

Returns:



432
433
434
435
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config.rb', line 432

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



468
469
470
471
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config.rb', line 468

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

#to_sObject

Provide a user friendly representation



461
462
463
464
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config.rb', line 461

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

#update(fallback_url: :unset, callback_url: :unset, continue_on_failure: :unset, disable_https: :unset) ⇒ DomainConfigInstance

Update the DomainConfigInstance

Parameters:

  • fallback_url (String) (defaults to: :unset)

    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.

  • callback_url (String) (defaults to: :unset)

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

  • continue_on_failure (Boolean) (defaults to: :unset)

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

  • disable_https (Boolean) (defaults to: :unset)

    Customer’s choice to send links with/without \"https://\" attached to shortened url. If true, messages will not be sent with https:// at the beginning of the url. If false, messages will be sent with https:// at the beginning of the url. False is the default behavior if it is not specified.

Returns:



444
445
446
447
448
449
450
451
452
453
454
455
456
457
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config.rb', line 444

def update(
    fallback_url: :unset, 
    callback_url: :unset, 
    continue_on_failure: :unset, 
    disable_https: :unset
)

    context.update(
        fallback_url: fallback_url, 
        callback_url: callback_url, 
        continue_on_failure: continue_on_failure, 
        disable_https: disable_https, 
    )
end

#urlString

Returns:

  • (String)


419
420
421
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config.rb', line 419

def url
    @properties['url']
end