<commit_before># frozen_string_literal: true

module Nexmo
  class Numbers < Namespace
    include Keys

    self.host = 'rest.nexmo.com'

    # Retrieve all the inbound numbers associated with your Nexmo account.
    #
    # @example
    #   response = client.numbers.list
    #   response.each do |item|
    #     puts "#{item.msisdn} #{item.country} #{item.type}"
    #   end
    #
    # @option params [Integer] :index
    #   Page index.
    #
    # @option params [Integer] :size
    #   Page size.
    #
    # @option params [String] :pattern
    #   The number pattern you want to search for. Use in conjunction with **:search_pattern**.
    #
    # @option params [Integer] :search_pattern
    #   The strategy you want to use for matching:
    #   - `0` - Search for numbers that start with **:pattern**
    #   - `1` - Search for numbers that contain **:pattern**
    #   - `2` - Search for numbers that end with **:pattern**
    #
    # @param [Hash] params
    #
    # @return [ListResponse]
    #
    # @see https://developer.nexmo.com/api/developer/numbers#getOwnedNumbers
    #
    def list(params = nil)
      request('/account/numbers', params: params, response_class: ListResponse)
    end

    # Retrieve inbound numbers that are available for the specified country.
    #
    # @example
    #   response = client.numbers.search(country: 'GB')
    #   response.each do |item|
    #     puts "#{item.msisdn} #{item.type} #{item.cost}"
    #   end
    #<commit_msg>Numbers API v1.0.10<commit_after># frozen_string_literal: true

module Nexmo
  class Numbers < Namespace
    include Keys

    self.host = 'rest.nexmo.com'

    # Retrieve all the inbound numbers associated with your Nexmo account.
    #
    # @example
    #   response = client.numbers.list
    #   response.each do |item|
    #     puts "#{item.msisdn} #{item.country} #{item.type}"
    #   end
    #
    # @option params [Integer] :index
    #   Page index.
    #
    # @option params [Integer] :size
    #   Page size.
    #
    # @option params [String] :pattern
    #   The number pattern you want to search for. Use in conjunction with **:search_pattern**.
    #
    # @option params [Integer] :search_pattern
    #   The strategy you want to use for matching:
    #   - `0` - Search for numbers that start with **:pattern**
    #   - `1` - Search for numbers that contain **:pattern**
    #   - `2` - Search for numbers that end with **:pattern**
    #
    # @option params [Boolean] :has_application
    #   Set this optional field to `true` to restrict your results to numbers associated with an application (any application).
    #   Set to `false` to find all numbers not associated with any application.
    #   Omit the field to avoid filtering on whether or not the number is assigned to an application.
    #
    # @option params [String] :application_id
    #   The application that you want to return the numbers for.
    #
    # @param [Hash] params
    #
    # @return [ListResponse]
    #
    # @see https://developer.nexmo.com/api/developer/numbers#getOwnedNumbers
    #
    def list(params = nil)
      request('/account/numbers', params: params, response_class: ListResponse)
    end

    # Retrieve inbound numbers that are available for the specified country.
    #
    # @example
    #   response = client.numbers.search(country: 'GB')
    #   response.each do |item|
    #     puts "#{item.msisdn} #{item.type} #{item.cost}"
    #   end
    #
{'fraction_non_alphanumeric': 0.1123660584998552, 'fraction_numerical': 0.0028960324355632784, 'mean_word_length': 2.5316973415132926, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3058150', 'n_tokens_mistral': 1062, 'n_tokens_neox': 1032, 'n_words': 337}