Class: Telnyx::Resources::TermsOfService::Agreements
- Inherits:
-
Object
- Object
- Telnyx::Resources::TermsOfService::Agreements
- Defined in:
- lib/telnyx/resources/terms_of_service/agreements.rb
Overview
Accept and review the Branded Calling and Phone Number Reputation terms of service.
Instance Method Summary collapse
-
#initialize(client:) ⇒ Agreements
constructor
private
A new instance of Agreements.
-
#list(page_number: nil, page_size: nil, product_type: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::TermsOfService::AgreementListResponse>
Some parameter documentations has been truncated, see Models::TermsOfService::AgreementListParams for more details.
-
#retrieve(agreement_id, request_options: {}) ⇒ Telnyx::Models::TermsOfService::AgreementRetrieveResponse
Retrieve a single ToS agreement record.
Constructor Details
#initialize(client:) ⇒ Agreements
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 Agreements.
73 74 75 |
# File 'lib/telnyx/resources/terms_of_service/agreements.rb', line 73 def initialize(client:) @client = client end |
Instance Method Details
#list(page_number: nil, page_size: nil, product_type: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::TermsOfService::AgreementListResponse>
Some parameter documentations has been truncated, see Models::TermsOfService::AgreementListParams for more details.
Returns the Terms of Service agreements the authenticated user has on file. Each entry records the version agreed to and when. Most users only have one agreement per product, but if the ToS is updated and the user re-agrees a new entry is added.
Results are paginated with the standard ‘page` / `page` parameters; the response uses the standard `meta` JSON:API envelope.
By default this returns agreements for all products the user has agreed to. Pass the ‘product_type` query parameter to scope the result to a single product.
57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/telnyx/resources/terms_of_service/agreements.rb', line 57 def list(params = {}) parsed, = Telnyx::TermsOfService::AgreementListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "terms_of_service/agreements", query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::Models::TermsOfService::AgreementListResponse, options: ) end |
#retrieve(agreement_id, request_options: {}) ⇒ Telnyx::Models::TermsOfService::AgreementRetrieveResponse
Retrieve a single ToS agreement record. Returns ‘404` if the agreement does not exist or does not belong to the authenticated user.
21 22 23 24 25 26 27 28 |
# File 'lib/telnyx/resources/terms_of_service/agreements.rb', line 21 def retrieve(agreement_id, params = {}) @client.request( method: :get, path: ["terms_of_service/agreements/%1$s", agreement_id], model: Telnyx::Models::TermsOfService::AgreementRetrieveResponse, options: params[:request_options] ) end |