<commit_before># coding: utf-8

require 'httparty'
require 'json'

module Moip::Assinaturas

  class WebServerResponseError < StandardError ; end
  class MissingTokenError < StandardError ; end

  class Client
    include HTTParty
    
    if Moip::Assinaturas.http_debug
      debug_output $stdout
    end

    if Moip::Assinaturas.sandbox
      base_uri "https://sandbox.moip.com.br/assinaturas-api/v1"
    else
      base_uri "https://api.moip.com.br/assinaturas/v1"
    end

  #  basic_auth Moip::Assinaturas.token, Moip::Assinaturas.key

    class << self

      def create_plan(plan, opts={})
        prepare_options(opts, { body: plan.to_json, headers: { 'Content-Type' => 'application/json' } })
        peform_action!(:post, "/plans", opts)
      end

      def list_plans(opts={})
        prepare_options(opts, { headers: { 'Content-Type' => 'application/json' } })
        peform_action!(:get, "/plans", opts)
      end

      def details_plan(code, opts={})
        prepare_options(opts, { headers: { 'Content-Type' => 'application/json' } })
        peform_action!(:get, "/plans/#{code}", opts, true)
      end

      def update_plan(plan, opts={})
        prepare_options(opts, { body: plan.to_json, headers: { 'Content-Type' => 'application/json' } })<commit_msg>alterando autenticação basico como preferencial<commit_after># coding: utf-8

require 'httparty'
require 'json'

module Moip::Assinaturas

  class WebServerResponseError < StandardError ; end
  class MissingTokenError < StandardError ; end

  class Client
    include HTTParty
    
    if Moip::Assinaturas.http_debug
      debug_output $stdout
    end

    if Moip::Assinaturas.sandbox
      base_uri "https://sandbox.moip.com.br/assinaturas-api/v1"
    else
      base_uri "https://api.moip.com.br/assinaturas/v1"
    end

    if Moip::Assinaturas.token && Moip::Assinaturas.key
      basic_auth Moip::Assinaturas.token, Moip::Assinaturas.key
    end

    class << self

      def create_plan(plan, opts={})
        prepare_options(opts, { body: plan.to_json, headers: { 'Content-Type' => 'application/json' } })
        peform_action!(:post, "/plans", opts)
      end

      def list_plans(opts={})
        prepare_options(opts, { headers: { 'Content-Type' => 'application/json' } })
        peform_action!(:get, "/plans", opts)
      end

      def details_plan(code, opts={})
        prepare_options(opts, { headers: { 'Content-Type' => 'application/json' } })
        peform_action!(:get, "/plans/#{code}", opts, true)
      end

      def update_plan(plan, opts={})
        prepare_options(opts, { body: plan.to_json, headers: { 'Content-Type' => 'application/json' } })
{'fraction_non_alphanumeric': 0.1374764595103578, 'fraction_numerical': 0.0022598870056497176, 'mean_word_length': 3.124223602484472, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 4, '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': '3197157', 'n_tokens_mistral': 904, 'n_tokens_neox': 880, 'n_words': 174}