Class: Telnyx::Resources::TermsOfService

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/terms_of_service.rb,
lib/telnyx/resources/terms_of_service/agreements.rb,
lib/telnyx/resources/terms_of_service/branded_calling.rb,
lib/telnyx/resources/terms_of_service/number_reputation.rb

Overview

Accept and review the Branded Calling and Phone Number Reputation terms of service.

Defined Under Namespace

Classes: Agreements, BrandedCalling, NumberReputation

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ TermsOfService

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

Parameters:



79
80
81
82
83
84
# File 'lib/telnyx/resources/terms_of_service.rb', line 79

def initialize(client:)
  @client = client
  @number_reputation = Telnyx::Resources::TermsOfService::NumberReputation.new(client: client)
  @agreements = Telnyx::Resources::TermsOfService::Agreements.new(client: client)
  @branded_calling = Telnyx::Resources::TermsOfService::BrandedCalling.new(client: client)
end

Instance Attribute Details

#agreementsTelnyx::Resources::TermsOfService::Agreements (readonly)

Accept and review the Branded Calling and Phone Number Reputation terms of service.



16
17
18
# File 'lib/telnyx/resources/terms_of_service.rb', line 16

def agreements
  @agreements
end

#branded_callingTelnyx::Resources::TermsOfService::BrandedCalling (readonly)

Accept and review the Branded Calling and Phone Number Reputation terms of service.



21
22
23
# File 'lib/telnyx/resources/terms_of_service.rb', line 21

def branded_calling
  @branded_calling
end

#number_reputationTelnyx::Resources::TermsOfService::NumberReputation (readonly)

Accept and review the Branded Calling and Phone Number Reputation terms of service.



11
12
13
# File 'lib/telnyx/resources/terms_of_service.rb', line 11

def number_reputation
  @number_reputation
end

Instance Method Details

#retrieve_info(product_type: nil, request_options: {}) ⇒ Telnyx::Models::TermsOfServiceRetrieveInfoResponse

Returns the available Terms of Service agreements (product, current version, terms URL, effective date). Omit ‘product_type` to return all products; pass it to scope to one.

Parameters:

Returns:

See Also:



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

def retrieve_info(params = {})
  parsed, options = Telnyx::TermsOfServiceRetrieveInfoParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "terms_of_service/info",
    query: query,
    model: Telnyx::Models::TermsOfServiceRetrieveInfoResponse,
    options: options
  )
end

#status(product_type: nil, request_options: {}) ⇒ Telnyx::Models::TermsOfServiceStatusResponse

Returns whether the authenticated user has agreed to the current Terms of Service for the product given by ‘product_type`. Used during onboarding to decide whether to prompt the user with the ToS dialog before continuing.

‘agreement_required: true` means the user has not yet agreed (or has agreed to an outdated version) and must agree before using that product’s endpoints.

Parameters:

Returns:

See Also:



64
65
66
67
68
69
70
71
72
73
74
# File 'lib/telnyx/resources/terms_of_service.rb', line 64

def status(params = {})
  parsed, options = Telnyx::TermsOfServiceStatusParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "terms_of_service/status",
    query: query,
    model: Telnyx::Models::TermsOfServiceStatusResponse,
    options: options
  )
end