Class: Telnyx::Resources::VerifyProfiles

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

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:



211
212
213
# File 'lib/telnyx/resources/verify_profiles.rb', line 211

def initialize(client:)
  @client = client
end

Instance Method Details

#create(name:, call: nil, flashcall: nil, language: nil, rcs: 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.



25
26
27
28
29
30
31
32
33
34
# File 'lib/telnyx/resources/verify_profiles.rb', line 25

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:



155
156
157
158
159
160
161
162
163
164
# File 'lib/telnyx/resources/verify_profiles.rb', line 155

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

Delete Verify profile

Parameters:

  • verify_profile_id (String)

    The identifier of the Verify profile to delete.

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

Returns:

See Also:



135
136
137
138
139
140
141
142
# File 'lib/telnyx/resources/verify_profiles.rb', line 135

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:



111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/telnyx/resources/verify_profiles.rb', line 111

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:



47
48
49
50
51
52
53
54
# File 'lib/telnyx/resources/verify_profiles.rb', line 47

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:



175
176
177
178
179
180
181
182
# File 'lib/telnyx/resources/verify_profiles.rb', line 175

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, flashcall: nil, language: nil, name: nil, rcs: nil, sms: nil, webhook_failover_url: nil, webhook_url: nil, whatsapp: nil, request_options: {}) ⇒ Telnyx::Models::VerifyProfileData

Update Verify profile

Parameters:

Returns:

See Also:



85
86
87
88
89
90
91
92
93
94
# File 'lib/telnyx/resources/verify_profiles.rb', line 85

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:



197
198
199
200
201
202
203
204
205
206
# File 'lib/telnyx/resources/verify_profiles.rb', line 197

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