Class: Telnyx::Resources::VerifyProfiles

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/verify_profiles.rb,
sig/telnyx/resources/verify_profiles.rbs

Overview

Two factor authentication API

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ VerifyProfiles

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of VerifyProfiles.

Parameters:



223
224
225
# File 'lib/telnyx/resources/verify_profiles.rb', line 223

def initialize(client:)
  @client = client
end

Instance Method Details

#create(name:, call: nil, daily_spend_limit: nil, daily_spend_limit_enabled: nil, flashcall: nil, language: nil, sms: nil, webhook_failover_url: nil, webhook_url: nil, whatsapp: nil, request_options: {}) ⇒ Telnyx::Models::VerifyProfileData

Creates a new Verify profile to associate verifications with.

Parameters:

Returns:

See Also:



36
37
38
39
40
41
42
43
44
45
# File 'lib/telnyx/resources/verify_profiles.rb', line 36

def create(params)
  parsed, options = Telnyx::VerifyProfileCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "verify_profiles",
    body: parsed,
    model: Telnyx::VerifyProfileData,
    options: options
  )
end

#create_template(text:, request_options: {}) ⇒ Telnyx::Models::MessageTemplate

Create a new Verify profile message template.

Parameters:

  • text (String)

    The text content of the message template.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



167
168
169
170
171
172
173
174
175
176
# File 'lib/telnyx/resources/verify_profiles.rb', line 167

def create_template(params)
  parsed, options = Telnyx::VerifyProfileCreateTemplateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "verify_profiles/templates",
    body: parsed,
    model: Telnyx::MessageTemplate,
    options: options
  )
end

#delete(verify_profile_id, request_options: {}) ⇒ Telnyx::Models::VerifyProfileData

Deletes the specified Verify profile and returns the deleted profile record.

Parameters:

  • verify_profile_id (String)

    The identifier of the Verify profile to delete.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



147
148
149
150
151
152
153
154
# File 'lib/telnyx/resources/verify_profiles.rb', line 147

def delete(verify_profile_id, params = {})
  @client.request(
    method: :delete,
    path: ["verify_profiles/%1$s", verify_profile_id],
    model: Telnyx::VerifyProfileData,
    options: params[:request_options]
  )
end

#list(filter: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::VerifyProfile>

Gets a paginated list of Verify profiles.

Parameters:

Returns:

See Also:



123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/telnyx/resources/verify_profiles.rb', line 123

def list(params = {})
  parsed, options = Telnyx::VerifyProfileListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "verify_profiles",
    query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::VerifyProfile,
    options: options
  )
end

#retrieve(verify_profile_id, request_options: {}) ⇒ Telnyx::Models::VerifyProfileData

Gets a single Verify profile.

Parameters:

  • verify_profile_id (String)

    The identifier of the Verify profile to retrieve.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



58
59
60
61
62
63
64
65
# File 'lib/telnyx/resources/verify_profiles.rb', line 58

def retrieve(verify_profile_id, params = {})
  @client.request(
    method: :get,
    path: ["verify_profiles/%1$s", verify_profile_id],
    model: Telnyx::VerifyProfileData,
    options: params[:request_options]
  )
end

#retrieve_templates(request_options: {}) ⇒ Telnyx::Models::VerifyProfileRetrieveTemplatesResponse

List all Verify profile message templates.

Parameters:

Returns:

See Also:



187
188
189
190
191
192
193
194
# File 'lib/telnyx/resources/verify_profiles.rb', line 187

def retrieve_templates(params = {})
  @client.request(
    method: :get,
    path: "verify_profiles/templates",
    model: Telnyx::Models::VerifyProfileRetrieveTemplatesResponse,
    options: params[:request_options]
  )
end

#update(verify_profile_id, call: nil, daily_spend_limit: nil, daily_spend_limit_enabled: nil, language: nil, name: nil, sms: nil, webhook_failover_url: nil, webhook_url: nil, whatsapp: nil, request_options: {}) ⇒ Telnyx::Models::VerifyProfileData

Updates the specified Verify profile's name, webhook destinations, language, daily spend limits, or channel-specific settings. Returns the updated profile.

Parameters:

Returns:

See Also:



97
98
99
100
101
102
103
104
105
106
# File 'lib/telnyx/resources/verify_profiles.rb', line 97

def update(verify_profile_id, params = {})
  parsed, options = Telnyx::VerifyProfileUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["verify_profiles/%1$s", verify_profile_id],
    body: parsed,
    model: Telnyx::VerifyProfileData,
    options: options
  )
end

#update_template(template_id, text:, request_options: {}) ⇒ Telnyx::Models::MessageTemplate

Update an existing Verify profile message template.

Parameters:

  • template_id (String)

    The identifier of the message template to update.

  • text (String)

    The text content of the message template.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



209
210
211
212
213
214
215
216
217
218
# File 'lib/telnyx/resources/verify_profiles.rb', line 209

def update_template(template_id, params)
  parsed, options = Telnyx::VerifyProfileUpdateTemplateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["verify_profiles/templates/%1$s", template_id],
    body: parsed,
    model: Telnyx::MessageTemplate,
    options: options
  )
end