Sha256: 88620f54295f59d65c43f00b3847ffb0c11f74e5af6b478574bc4d36cb42c161

Contents?: true

Size: 863 Bytes

Versions: 8

Compression:

Stored size: 863 Bytes

Contents

# frozen_string_literal: true

module DocomoNlu
  module Management::V26
    class Account < Base
      self.element_name = "accounts"
      self.prefix = "/management/v2.6/"

      # Parameter for create
      # {
      #     "accountName": "your account name",
      #     "password": "your account password",
      #     "description": "account description",
      #     "authorization": 2,
      #     "enable": true
      #     "eternity": true
      # }

      def self.count
        response_body = JSON.parse(connection.get("#{prefix}#{element_name}/count", headers).body)
        response_body["count"]
      end

      def to_json(options = {})
        enable_params = ["accountName", "password", "description", "authorization", "enable", "eternity"]
        attributes.select! {|a| enable_params.include?(a) }
        super
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
docomo-nlu-0.2.7 lib/docomo-nlu/management/V26/account.rb
docomo-nlu-0.2.6 lib/docomo-nlu/management/V26/account.rb
docomo-nlu-0.2.5 lib/docomo-nlu/management/V26/account.rb
docomo-nlu-0.2.4 lib/docomo-nlu/management/V26/account.rb
docomo-nlu-0.2.3 lib/docomo-nlu/management/V26/account.rb
docomo-nlu-0.2.2 lib/docomo-nlu/management/V26/account.rb
docomo-nlu-0.2.1 lib/docomo-nlu/management/V26/account.rb
docomo-nlu-0.2.0 lib/docomo-nlu/management/V26/account.rb