Class: Twilio::REST::Verify::V2::ServiceInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/verify/v2/service.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ ServiceInstance

Initialize the ServiceInstance



1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1000

def initialize(version, payload , sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'account_sid' => payload['account_sid'],
        'friendly_name' => payload['friendly_name'],
        'code_length' => payload['code_length'] == nil ? payload['code_length'] : payload['code_length'].to_i,
        'lookup_enabled' => payload['lookup_enabled'],
        'psd2_enabled' => payload['psd2_enabled'],
        'skip_sms_to_landlines' => payload['skip_sms_to_landlines'],
        'dtmf_input_required' => payload['dtmf_input_required'],
        'tts_name' => payload['tts_name'],
        'do_not_share_warning_enabled' => payload['do_not_share_warning_enabled'],
        'custom_code_enabled' => payload['custom_code_enabled'],
        'push' => payload['push'],
        'totp' => payload['totp'],
        'default_template_sid' => payload['default_template_sid'],
        'whatsapp' => payload['whatsapp'],
        'passkeys' => payload['passkeys'],
        'verify_event_subscription_enabled' => payload['verify_event_subscription_enabled'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'url' => payload['url'],
        'links' => payload['links'],
    }

    # Context
    @instance_context = nil
    @params = { 'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#access_tokensaccess_tokens

Access the access_tokens



1313
1314
1315
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1313

def access_tokens
    context.access_tokens
end

#account_sidString



1053
1054
1055
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1053

def 
    @properties['account_sid']
end

#approve_challengeapprove_challenge

Access the approve_challenge



1299
1300
1301
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1299

def approve_challenge
    context.approve_challenge
end

#code_lengthString



1065
1066
1067
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1065

def code_length
    @properties['code_length']
end

#contextServiceContext

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



1038
1039
1040
1041
1042
1043
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1038

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

#custom_code_enabledBoolean



1107
1108
1109
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1107

def custom_code_enabled
    @properties['custom_code_enabled']
end

#date_createdTime



1149
1150
1151
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1149

def date_created
    @properties['date_created']
end

#date_updatedTime



1155
1156
1157
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1155

def date_updated
    @properties['date_updated']
end

#default_template_sidString



1125
1126
1127
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1125

def default_template_sid
    @properties['default_template_sid']
end

#deleteBoolean

Delete the ServiceInstance



1174
1175
1176
1177
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1174

def delete

    context.delete
end

#do_not_share_warning_enabledBoolean



1101
1102
1103
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1101

def do_not_share_warning_enabled
    @properties['do_not_share_warning_enabled']
end

#dtmf_input_requiredBoolean



1089
1090
1091
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1089

def dtmf_input_required
    @properties['dtmf_input_required']
end

#entitiesentities

Access the entities



1341
1342
1343
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1341

def entities
    context.entities
end

#fetchServiceInstance

Fetch the ServiceInstance



1182
1183
1184
1185
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1182

def fetch

    context.fetch
end

#friendly_nameString



1059
1060
1061
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1059

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



1361
1362
1363
1364
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1361

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


1167
1168
1169
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1167

def links
    @properties['links']
end

#lookup_enabledBoolean



1071
1072
1073
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1071

def lookup_enabled
    @properties['lookup_enabled']
end

#messaging_configurationsmessaging_configurations

Access the messaging_configurations



1327
1328
1329
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1327

def messaging_configurations
    context.messaging_configurations
end

#new_challengenew_challenge

Access the new_challenge



1334
1335
1336
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1334

def new_challenge
    context.new_challenge
end

#new_factorsnew_factors

Access the new_factors



1292
1293
1294
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1292

def new_factors
    context.new_factors
end

#new_verify_factorsnew_verify_factors

Access the new_verify_factors



1285
1286
1287
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1285

def new_verify_factors
    context.new_verify_factors
end

#passkeysHash



1137
1138
1139
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1137

def passkeys
    @properties['passkeys']
end

#psd2_enabledBoolean



1077
1078
1079
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1077

def psd2_enabled
    @properties['psd2_enabled']
end

#pushHash



1113
1114
1115
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1113

def push
    @properties['push']
end

#rate_limitsrate_limits

Access the rate_limits



1348
1349
1350
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1348

def rate_limits
    context.rate_limits
end

#sidString



1047
1048
1049
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1047

def sid
    @properties['sid']
end

#skip_sms_to_landlinesBoolean



1083
1084
1085
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1083

def skip_sms_to_landlines
    @properties['skip_sms_to_landlines']
end

#to_sObject

Provide a user friendly representation



1354
1355
1356
1357
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1354

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

#totpHash



1119
1120
1121
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1119

def totp
    @properties['totp']
end

#tts_nameString



1095
1096
1097
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1095

def tts_name
    @properties['tts_name']
end

#update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push_include_date: :unset, push_apn_credential_sid: :unset, push_fcm_credential_sid: :unset, totp_issuer: :unset, totp_time_step: :unset, totp_code_length: :unset, totp_skew: :unset, default_template_sid: :unset, whatsapp_msg_service_sid: :unset, whatsapp_from: :unset, passkeys_relying_party_id: :unset, passkeys_relying_party_name: :unset, passkeys_relying_party_origins: :unset, passkeys_authenticator_attachment: :unset, passkeys_discoverable_credentials: :unset, passkeys_user_verification: :unset, verify_event_subscription_enabled: :unset) ⇒ ServiceInstance

Update the ServiceInstance



1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1216

def update(
    friendly_name: :unset, 
    code_length: :unset, 
    lookup_enabled: :unset, 
    skip_sms_to_landlines: :unset, 
    dtmf_input_required: :unset, 
    tts_name: :unset, 
    psd2_enabled: :unset, 
    do_not_share_warning_enabled: :unset, 
    custom_code_enabled: :unset, 
    push_include_date: :unset, 
    push_apn_credential_sid: :unset, 
    push_fcm_credential_sid: :unset, 
    totp_issuer: :unset, 
    totp_time_step: :unset, 
    totp_code_length: :unset, 
    totp_skew: :unset, 
    default_template_sid: :unset, 
    whatsapp_msg_service_sid: :unset, 
    whatsapp_from: :unset, 
    passkeys_relying_party_id: :unset, 
    passkeys_relying_party_name: :unset, 
    passkeys_relying_party_origins: :unset, 
    passkeys_authenticator_attachment: :unset, 
    passkeys_discoverable_credentials: :unset, 
    passkeys_user_verification: :unset, 
    verify_event_subscription_enabled: :unset
)

    context.update(
        friendly_name: friendly_name, 
        code_length: code_length, 
        lookup_enabled: lookup_enabled, 
        skip_sms_to_landlines: skip_sms_to_landlines, 
        dtmf_input_required: dtmf_input_required, 
        tts_name: tts_name, 
        psd2_enabled: psd2_enabled, 
        do_not_share_warning_enabled: do_not_share_warning_enabled, 
        custom_code_enabled: custom_code_enabled, 
        push_include_date: push_include_date, 
        push_apn_credential_sid: push_apn_credential_sid, 
        push_fcm_credential_sid: push_fcm_credential_sid, 
        totp_issuer: totp_issuer, 
        totp_time_step: totp_time_step, 
        totp_code_length: totp_code_length, 
        totp_skew: totp_skew, 
        default_template_sid: default_template_sid, 
        whatsapp_msg_service_sid: whatsapp_msg_service_sid, 
        whatsapp_from: whatsapp_from, 
        passkeys_relying_party_id: passkeys_relying_party_id, 
        passkeys_relying_party_name: passkeys_relying_party_name, 
        passkeys_relying_party_origins: passkeys_relying_party_origins, 
        passkeys_authenticator_attachment: passkeys_authenticator_attachment, 
        passkeys_discoverable_credentials: passkeys_discoverable_credentials, 
        passkeys_user_verification: passkeys_user_verification, 
        verify_event_subscription_enabled: verify_event_subscription_enabled, 
    )
end

#urlString



1161
1162
1163
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1161

def url
    @properties['url']
end

#verification_checksverification_checks

Access the verification_checks



1278
1279
1280
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1278

def verification_checks
    context.verification_checks
end

#verificationsverifications

Access the verifications



1306
1307
1308
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1306

def verifications
    context.verifications
end

#verify_event_subscription_enabledBoolean



1143
1144
1145
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1143

def verify_event_subscription_enabled
    @properties['verify_event_subscription_enabled']
end

#webhookswebhooks

Access the webhooks



1320
1321
1322
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1320

def webhooks
    context.webhooks
end

#whatsappHash



1131
1132
1133
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 1131

def whatsapp
    @properties['whatsapp']
end