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
# 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'],
        '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.



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

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



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

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:



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

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

#date_createdTime

Returns Date this Domain Config was created.

Returns:

  • (Time)

    Date this Domain Config was created.



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

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.



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

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.



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

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.



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

def fallback_url
    @properties['fallback_url']
end

#fetchDomainConfigMessagingServiceInstance

Fetch the DomainConfigMessagingServiceInstance

Returns:



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

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



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

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



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

def messaging_service_sid
    @properties['messaging_service_sid']
end

#to_sObject

Provide a user friendly representation



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

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

#urlString

Returns:

  • (String)


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

def url
    @properties['url']
end