Class: Twilio::REST::Accounts::V1::AuthTokenPromotionInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ AuthTokenPromotionInstance

Initialize the AuthTokenPromotionInstance



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 124

def initialize(version, payload )
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'auth_token' => payload['auth_token'],
        '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 = {  }
end

Instance Method Details

#account_sidString



154
155
156
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 154

def 
    @properties['account_sid']
end

#auth_tokenString



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

def auth_token
    @properties['auth_token']
end

#contextAuthTokenPromotionContext

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



145
146
147
148
149
150
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 145

def context
    unless @instance_context
        @instance_context = AuthTokenPromotionContext.new(@version )
    end
    @instance_context
end

#date_createdTime



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

def date_created
    @properties['date_created']
end

#date_updatedTime



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

def date_updated
    @properties['date_updated']
end

#inspectObject

Provide a detailed, user friendly representation



199
200
201
202
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 199

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

#to_sObject

Provide a user friendly representation



192
193
194
195
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 192

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

#updateAuthTokenPromotionInstance

Update the AuthTokenPromotionInstance



185
186
187
188
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 185

def update

    context.update
end

#urlString



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

def url
    @properties['url']
end