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

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

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

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

  • messaging_service_sid (String) (defaults to: nil)

    Unique string used to identify the Messaging service that this domain should be associated with.



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb', line 120

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.



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

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



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

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:



144
145
146
147
148
149
150
151
152
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb', line 144

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.



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

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.



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

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.



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

def domain_sid
  @properties['domain_sid']
end

#fallback_urlString

Returns We will redirect requests to urls we are unable to identify to this url.

Returns:

  • (String)

    We will redirect requests to urls we are unable to identify to this url.



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

def fallback_url
  @properties['fallback_url']
end

#fetchDomainConfigMessagingServiceInstance

Fetch the DomainConfigMessagingServiceInstance

Returns:



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

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



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

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



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

def messaging_service_sid
  @properties['messaging_service_sid']
end

#to_sObject

Provide a user friendly representation



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

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

#urlString

Returns The url.

Returns:

  • (String)

    The url



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

def url
  @properties['url']
end