docomo-nlu 0.2.6 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +48 -0
- data/.reek.yml +98 -0
- data/.rubocop.rspec.yml +67 -0
- data/.rubocop.ruby.yml +419 -0
- data/.rubocop.yml +18 -16
- data/.ruby-version +1 -1
- data/Gemfile.lock +114 -130
- data/docomo-nlu.gemspec +8 -7
- data/lib/docomo-nlu.rb +4 -4
- data/lib/{docomo-nlu → docomo_nlu}/config.rb +3 -3
- data/lib/docomo_nlu/management.rb +32 -0
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/account.rb +1 -1
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/aiml_base.rb +6 -5
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/base.rb +2 -2
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/bot.rb +1 -1
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/bot_log.rb +3 -2
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/config.rb +1 -1
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/default_predicate.rb +1 -1
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/entry.rb +1 -1
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/log.rb +1 -1
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/map.rb +1 -1
- data/lib/docomo_nlu/management/multipart_base.rb +85 -0
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/ng_word.rb +3 -2
- data/lib/{docomo-nlu/management/V23/multipart_base.rb → docomo_nlu/management/ok_ng_base.rb} +19 -24
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/ok_word.rb +3 -2
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/organization.rb +1 -1
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/organization_member.rb +1 -1
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/predicate_name.rb +1 -1
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/project.rb +1 -1
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/project_member.rb +1 -1
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/property.rb +1 -1
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/provider.rb +1 -1
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/scenario.rb +1 -1
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/scenario_project.rb +1 -1
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/scenario_util.rb +1 -1
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/set.rb +1 -1
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/task_project.rb +1 -1
- data/lib/{docomo-nlu → docomo_nlu}/spontaneous.rb +5 -5
- data/lib/{docomo-nlu → docomo_nlu}/version.rb +1 -1
- data/vcr/vcr_cassettes/{V26 → management}/account/count.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/account/create.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/account/delete.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/account/index.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/account/show.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/account/update.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/base/login.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/base/login_400.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/base/logout.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/base/logout_400.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/bot/create.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/bot/create_conflict.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/bot/delete.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/bot/deploy.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/bot/download_aiml.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/bot/download_archive.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/bot/download_dat.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/bot/index.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/bot/index_not_found.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/bot/show.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/bot/upload_aiml.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/bot/upload_archive.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/bot/upload_dat.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/bot_log/all.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/bot_log/query.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/config/delete.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/config/index.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/config/show.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/config/update.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/default_predicate/create.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/default_predicate/delete.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/default_predicate/index.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/default_predicate/index_not_found.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/default_predicate/update.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/entry/delete.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/entry/save.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/log/all.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/log/count.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/log/count/all.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/log/count/query.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/log/query.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/map/create.yml +6 -6
- data/vcr/vcr_cassettes/{V26 → management}/map/create_400.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/map/delete.yml +2 -2
- data/vcr/vcr_cassettes/{V26 → management}/map/index_all.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/map/index_find.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/map/index_where.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/map/save.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/map/save_400.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/map/show_find.yml +3 -3
- data/vcr/vcr_cassettes/{V26 → management}/map/show_where.yml +0 -0
- data/vcr/vcr_cassettes/management/ng_word/create.yml +46 -0
- data/vcr/vcr_cassettes/management/ng_word/create_400.yml +50 -0
- data/vcr/vcr_cassettes/management/ng_word/create_409.yml +48 -0
- data/vcr/vcr_cassettes/management/ng_word/delete.yml +38 -0
- data/vcr/vcr_cassettes/management/ng_word/download.yml +44 -0
- data/vcr/vcr_cassettes/management/ng_word/index_all.yml +44 -0
- data/vcr/vcr_cassettes/management/ng_word/index_find.yml +44 -0
- data/vcr/vcr_cassettes/management/ng_word/index_where.yml +44 -0
- data/vcr/vcr_cassettes/management/ng_word/save.yml +46 -0
- data/vcr/vcr_cassettes/management/ng_word/save_400.yml +50 -0
- data/vcr/vcr_cassettes/management/ng_word/save_409.yml +48 -0
- data/vcr/vcr_cassettes/management/ng_word/show_find.yml +44 -0
- data/vcr/vcr_cassettes/management/ok_word/create.yml +46 -0
- data/vcr/vcr_cassettes/management/ok_word/create_400.yml +50 -0
- data/vcr/vcr_cassettes/{V23/set/create_400.yml → management/ok_word/create_409.yml} +14 -14
- data/vcr/vcr_cassettes/management/ok_word/delete.yml +38 -0
- data/vcr/vcr_cassettes/management/ok_word/download.yml +44 -0
- data/vcr/vcr_cassettes/management/ok_word/index_all.yml +44 -0
- data/vcr/vcr_cassettes/management/ok_word/index_find.yml +44 -0
- data/vcr/vcr_cassettes/management/ok_word/index_where.yml +44 -0
- data/vcr/vcr_cassettes/management/ok_word/save.yml +46 -0
- data/vcr/vcr_cassettes/management/ok_word/save_400.yml +50 -0
- data/vcr/vcr_cassettes/{V23/set/save_400.yml → management/ok_word/save_409.yml} +14 -14
- data/vcr/vcr_cassettes/management/ok_word/show_find.yml +44 -0
- data/vcr/vcr_cassettes/{V26 → management}/organization/create.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/organization/delete.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/organization/index.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/organization/show.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/organization/update.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/organization_member/create.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/organization_member/delete.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/organization_member/index.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/organization_member/index_404.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/organization_member/index_not_found.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/predicate_name/create.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/predicate_name/delete.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/predicate_name/index.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/predicate_name/index_all.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/predicate_name/index_find.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/predicate_name/index_where.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/project/create.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/project/create_conflict.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/project/delete.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/project/index.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/project/show.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/project_member/create.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/project_member/delete.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/project_member/index.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/project_member/index_403.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/project_member/index_not_found.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/provider/create.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/provider/delete.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/provider/index.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/provider/show.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/scenario/create.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/scenario/create_conflict.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/scenario/delete.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/scenario/deploy.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/scenario/download_aiml.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/scenario/index.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/scenario/show.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/scenario/update.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/scenario/upload_aiml.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/scenario/upload_archive.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/scenario/upload_dat.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/set/create.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/set/create_400.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/set/delete.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/set/index_all.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/set/index_find.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/set/index_where.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/set/save.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/set/save_400.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/set/show_find.yml +0 -0
- data/vcr/vcr_cassettes/{V26 → management}/set/show_where.yml +0 -0
- metadata +209 -278
- data/lib/docomo-nlu/management.rb +0 -88
- data/lib/docomo-nlu/management/V23/account.rb +0 -30
- data/lib/docomo-nlu/management/V23/aiml_base.rb +0 -204
- data/lib/docomo-nlu/management/V23/base.rb +0 -88
- data/lib/docomo-nlu/management/V23/bot.rb +0 -18
- data/lib/docomo-nlu/management/V23/bot_log.rb +0 -8
- data/lib/docomo-nlu/management/V23/config.rb +0 -25
- data/lib/docomo-nlu/management/V23/default_predicate.rb +0 -15
- data/lib/docomo-nlu/management/V23/entry.rb +0 -8
- data/lib/docomo-nlu/management/V23/log.rb +0 -8
- data/lib/docomo-nlu/management/V23/map.rb +0 -10
- data/lib/docomo-nlu/management/V23/ng_word.rb +0 -10
- data/lib/docomo-nlu/management/V23/ok_word.rb +0 -10
- data/lib/docomo-nlu/management/V23/organization.rb +0 -23
- data/lib/docomo-nlu/management/V23/organization_member.rb +0 -15
- data/lib/docomo-nlu/management/V23/predicate_name.rb +0 -15
- data/lib/docomo-nlu/management/V23/project.rb +0 -16
- data/lib/docomo-nlu/management/V23/project_member.rb +0 -15
- data/lib/docomo-nlu/management/V23/property.rb +0 -10
- data/lib/docomo-nlu/management/V23/provider.rb +0 -17
- data/lib/docomo-nlu/management/V23/scenario.rb +0 -29
- data/lib/docomo-nlu/management/V23/scenario_project.rb +0 -10
- data/lib/docomo-nlu/management/V23/scenario_util.rb +0 -30
- data/lib/docomo-nlu/management/V23/set.rb +0 -10
- data/lib/docomo-nlu/management/V23/task_project.rb +0 -20
- data/lib/docomo-nlu/management/V26/multipart_base.rb +0 -83
- data/vcr/vcr_cassettes/V23/account/count.yml +0 -42
- data/vcr/vcr_cassettes/V23/account/create.yml +0 -44
- data/vcr/vcr_cassettes/V23/account/delete.yml +0 -38
- data/vcr/vcr_cassettes/V23/account/index.yml +0 -43
- data/vcr/vcr_cassettes/V23/account/show.yml +0 -43
- data/vcr/vcr_cassettes/V23/account/update.yml +0 -41
- data/vcr/vcr_cassettes/V23/base/login.yml +0 -44
- data/vcr/vcr_cassettes/V23/base/login_400.yml +0 -42
- data/vcr/vcr_cassettes/V23/base/logout.yml +0 -40
- data/vcr/vcr_cassettes/V23/base/logout_400.yml +0 -40
- data/vcr/vcr_cassettes/V23/bot/create.yml +0 -43
- data/vcr/vcr_cassettes/V23/bot/create_conflict.yml +0 -45
- data/vcr/vcr_cassettes/V23/bot/delete.yml +0 -38
- data/vcr/vcr_cassettes/V23/bot/deploy.yml +0 -164
- data/vcr/vcr_cassettes/V23/bot/download_aiml.yml +0 -43
- data/vcr/vcr_cassettes/V23/bot/download_archive.yml +0 -43
- data/vcr/vcr_cassettes/V23/bot/download_dat.yml +0 -43
- data/vcr/vcr_cassettes/V23/bot/index.yml +0 -44
- data/vcr/vcr_cassettes/V23/bot/index_not_found.yml +0 -42
- data/vcr/vcr_cassettes/V23/bot/show.yml +0 -43
- data/vcr/vcr_cassettes/V23/bot/upload_aiml.yml +0 -45
- data/vcr/vcr_cassettes/V23/bot/upload_archive.yml +0 -46
- data/vcr/vcr_cassettes/V23/bot/upload_dat.yml +0 -46
- data/vcr/vcr_cassettes/V23/config/delete.yml +0 -38
- data/vcr/vcr_cassettes/V23/config/index.yml +0 -120
- data/vcr/vcr_cassettes/V23/config/update.yml +0 -42
- data/vcr/vcr_cassettes/V23/default_predicate/create.yml +0 -42
- data/vcr/vcr_cassettes/V23/default_predicate/delete.yml +0 -38
- data/vcr/vcr_cassettes/V23/default_predicate/index.yml +0 -120
- data/vcr/vcr_cassettes/V23/default_predicate/index_not_found.yml +0 -120
- data/vcr/vcr_cassettes/V23/default_predicate/update.yml +0 -40
- data/vcr/vcr_cassettes/V23/map/create.yml +0 -45
- data/vcr/vcr_cassettes/V23/map/create_400.yml +0 -48
- data/vcr/vcr_cassettes/V23/map/delete.yml +0 -38
- data/vcr/vcr_cassettes/V23/map/index_all.yml +0 -43
- data/vcr/vcr_cassettes/V23/map/index_find.yml +0 -43
- data/vcr/vcr_cassettes/V23/map/index_where.yml +0 -43
- data/vcr/vcr_cassettes/V23/map/save.yml +0 -45
- data/vcr/vcr_cassettes/V23/map/save_400.yml +0 -48
- data/vcr/vcr_cassettes/V23/map/show_find.yml +0 -43
- data/vcr/vcr_cassettes/V23/map/show_where.yml +0 -43
- data/vcr/vcr_cassettes/V23/organization/create.yml +0 -44
- data/vcr/vcr_cassettes/V23/organization/delete.yml +0 -38
- data/vcr/vcr_cassettes/V23/organization/index.yml +0 -138
- data/vcr/vcr_cassettes/V23/organization/show.yml +0 -42
- data/vcr/vcr_cassettes/V23/organization/update.yml +0 -40
- data/vcr/vcr_cassettes/V23/organization_member/create.yml +0 -42
- data/vcr/vcr_cassettes/V23/organization_member/delete.yml +0 -38
- data/vcr/vcr_cassettes/V23/organization_member/index.yml +0 -42
- data/vcr/vcr_cassettes/V23/organization_member/index_404.yml +0 -42
- data/vcr/vcr_cassettes/V23/organization_member/index_not_found.yml +0 -42
- data/vcr/vcr_cassettes/V23/predicate_name/create.yml +0 -42
- data/vcr/vcr_cassettes/V23/predicate_name/delete.yml +0 -38
- data/vcr/vcr_cassettes/V23/predicate_name/index.yml +0 -42
- data/vcr/vcr_cassettes/V23/predicate_name/index_all.yml +0 -42
- data/vcr/vcr_cassettes/V23/predicate_name/index_find.yml +0 -42
- data/vcr/vcr_cassettes/V23/predicate_name/index_where.yml +0 -42
- data/vcr/vcr_cassettes/V23/project/create.yml +0 -44
- data/vcr/vcr_cassettes/V23/project/create_conflict.yml +0 -44
- data/vcr/vcr_cassettes/V23/project/delete.yml +0 -38
- data/vcr/vcr_cassettes/V23/project/index.yml +0 -474
- data/vcr/vcr_cassettes/V23/project/show.yml +0 -43
- data/vcr/vcr_cassettes/V23/project_member/create.yml +0 -42
- data/vcr/vcr_cassettes/V23/project_member/delete.yml +0 -38
- data/vcr/vcr_cassettes/V23/project_member/index.yml +0 -42
- data/vcr/vcr_cassettes/V23/project_member/index_403.yml +0 -40
- data/vcr/vcr_cassettes/V23/project_member/index_not_found.yml +0 -42
- data/vcr/vcr_cassettes/V23/provider/create.yml +0 -44
- data/vcr/vcr_cassettes/V23/provider/delete.yml +0 -38
- data/vcr/vcr_cassettes/V23/provider/index.yml +0 -42
- data/vcr/vcr_cassettes/V23/provider/show.yml +0 -42
- data/vcr/vcr_cassettes/V23/scenario/create.yml +0 -42
- data/vcr/vcr_cassettes/V23/scenario/create_conflict.yml +0 -44
- data/vcr/vcr_cassettes/V23/scenario/delete.yml +0 -38
- data/vcr/vcr_cassettes/V23/scenario/deploy.yml +0 -164
- data/vcr/vcr_cassettes/V23/scenario/download_aiml.yml +0 -43
- data/vcr/vcr_cassettes/V23/scenario/index.yml +0 -43
- data/vcr/vcr_cassettes/V23/scenario/show.yml +0 -42
- data/vcr/vcr_cassettes/V23/scenario/update.yml +0 -40
- data/vcr/vcr_cassettes/V23/scenario/upload_aiml.yml +0 -45
- data/vcr/vcr_cassettes/V23/scenario/upload_archive.yml +0 -46
- data/vcr/vcr_cassettes/V23/scenario/upload_dat.yml +0 -46
- data/vcr/vcr_cassettes/V23/set/create.yml +0 -45
- data/vcr/vcr_cassettes/V23/set/delete.yml +0 -38
- data/vcr/vcr_cassettes/V23/set/index_all.yml +0 -43
- data/vcr/vcr_cassettes/V23/set/index_find.yml +0 -43
- data/vcr/vcr_cassettes/V23/set/index_where.yml +0 -43
- data/vcr/vcr_cassettes/V23/set/save.yml +0 -45
- data/vcr/vcr_cassettes/V23/set/show_find.yml +0 -43
- data/vcr/vcr_cassettes/V23/set/show_where.yml +0 -43
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DocomoNlu
|
4
|
+
module Management
|
5
|
+
autoload :Account, "docomo_nlu/management/account"
|
6
|
+
autoload :AIMLBase, "docomo_nlu/management/aiml_base"
|
7
|
+
autoload :Base, "docomo_nlu/management/base"
|
8
|
+
autoload :Bot, "docomo_nlu/management/bot"
|
9
|
+
autoload :BotLog, "docomo_nlu/management/bot_log"
|
10
|
+
autoload :Config, "docomo_nlu/management/config"
|
11
|
+
autoload :DefaultPredicate, "docomo_nlu/management/default_predicate"
|
12
|
+
autoload :Entry, "docomo_nlu/management/entry"
|
13
|
+
autoload :Log, "docomo_nlu/management/log"
|
14
|
+
autoload :MultipartBase, "docomo_nlu/management/multipart_base"
|
15
|
+
autoload :Map, "docomo_nlu/management/map"
|
16
|
+
autoload :NGWord, "docomo_nlu/management/ng_word"
|
17
|
+
autoload :OKWord, "docomo_nlu/management/ok_word"
|
18
|
+
autoload :OKNGBase, "docomo_nlu/management/ok_ng_base"
|
19
|
+
autoload :OrganizationMember, "docomo_nlu/management/organization_member"
|
20
|
+
autoload :Organization, "docomo_nlu/management/organization"
|
21
|
+
autoload :PredicateName, "docomo_nlu/management/predicate_name"
|
22
|
+
autoload :ProjectMember, "docomo_nlu/management/project_member"
|
23
|
+
autoload :Project, "docomo_nlu/management/project"
|
24
|
+
autoload :Property, "docomo_nlu/management/property"
|
25
|
+
autoload :Provider, "docomo_nlu/management/provider"
|
26
|
+
autoload :ScenarioProject, "docomo_nlu/management/scenario_project"
|
27
|
+
autoload :ScenarioUtil, "docomo_nlu/management/scenario_util"
|
28
|
+
autoload :Scenario, "docomo_nlu/management/scenario"
|
29
|
+
autoload :Set, "docomo_nlu/management/set"
|
30
|
+
autoload :TaskProject, "docomo_nlu/management/task_project"
|
31
|
+
end
|
32
|
+
end
|
@@ -17,7 +17,7 @@
|
|
17
17
|
|
18
18
|
require "tempfile"
|
19
19
|
module DocomoNlu
|
20
|
-
module Management
|
20
|
+
module Management
|
21
21
|
class AIMLBase < Base
|
22
22
|
def download(extra_path = "")
|
23
23
|
prefix_options[:bot_id] ||= botId
|
@@ -37,7 +37,7 @@ module DocomoNlu
|
|
37
37
|
|
38
38
|
def transfer
|
39
39
|
prefix_options[:bot_id] ||= botId
|
40
|
-
self.class.
|
40
|
+
self.class.transfer(prefix_options)
|
41
41
|
end
|
42
42
|
|
43
43
|
def deploy
|
@@ -54,13 +54,14 @@ module DocomoNlu
|
|
54
54
|
response = conn.get("#{FileModel.collection_path(prefix_options)}/#{extra_path}")
|
55
55
|
|
56
56
|
if check_response(response)
|
57
|
-
instantiate_record({}, prefix_options).tap do |record|
|
57
|
+
return instantiate_record({}, prefix_options).tap do |record|
|
58
58
|
record.file = Tempfile.open(["docomo-nlu", ".#{prefix_options[:method]}"]) do |f|
|
59
59
|
f.write response.body.force_encoding("UTF-8")
|
60
60
|
f
|
61
61
|
end
|
62
62
|
end
|
63
63
|
end
|
64
|
+
nil
|
64
65
|
end
|
65
66
|
|
66
67
|
def upload(file, prefix_options)
|
@@ -116,11 +117,11 @@ module DocomoNlu
|
|
116
117
|
case method
|
117
118
|
when :compile
|
118
119
|
JSON.parse(response.body)["status"].tap do |status|
|
119
|
-
raise ActiveResource::ServerError
|
120
|
+
raise ActiveResource::ServerError, response if %w[ErrorFinish NotCompiled].include?(status)
|
120
121
|
end
|
121
122
|
when :transfer
|
122
123
|
JSON.parse(response.body)["transferStatusResponses"][0]["status"].tap do |status|
|
123
|
-
raise ActiveResource::ServerError
|
124
|
+
raise ActiveResource::ServerError, response if %w[ErrorFinish NotTransfered].include?(status)
|
124
125
|
end
|
125
126
|
end
|
126
127
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
require "net/http"
|
4
4
|
|
5
5
|
module DocomoNlu
|
6
|
-
module Management
|
6
|
+
module Management
|
7
7
|
class Base < ActiveResource::Base
|
8
8
|
## For Dynamically generated headers via http://rmosolgo.github.io/blog/2014/02/05/dynamically-generated-headers-for-activeresource-requests/
|
9
9
|
cattr_accessor :static_headers
|
@@ -47,7 +47,7 @@ module DocomoNlu
|
|
47
47
|
class << self
|
48
48
|
def instantiate_collection(collection, original_params = {}, prefix_options = {})
|
49
49
|
if collection.is_a?(Hash)
|
50
|
-
collection = if collection.empty?
|
50
|
+
collection = if collection.compact.empty?
|
51
51
|
[]
|
52
52
|
else
|
53
53
|
[collection]
|
@@ -3,7 +3,7 @@
|
|
3
3
|
require "zip"
|
4
4
|
|
5
5
|
module DocomoNlu
|
6
|
-
module Management
|
6
|
+
module Management
|
7
7
|
class BotLog < Base
|
8
8
|
self.element_name = "botlogs"
|
9
9
|
self.prefix = "/management/v2.6/projects/:project_id/"
|
@@ -44,12 +44,13 @@ module DocomoNlu
|
|
44
44
|
response = conn.get("#{collection_path(prefix_options)}?botId=#{bot_id}&#{params.to_query}")
|
45
45
|
|
46
46
|
if check_response(response)
|
47
|
-
Tempfile.open(["docomo-nlu", ".zip"]) do |f|
|
47
|
+
return Tempfile.open(["docomo-nlu", ".zip"]) do |f|
|
48
48
|
f.binmode
|
49
49
|
f.write response.body
|
50
50
|
f
|
51
51
|
end
|
52
52
|
end
|
53
|
+
nil
|
53
54
|
end
|
54
55
|
|
55
56
|
def unzip(file)
|
@@ -0,0 +1,85 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "tempfile"
|
4
|
+
module DocomoNlu
|
5
|
+
module Management
|
6
|
+
class MultipartBase < Base
|
7
|
+
def save
|
8
|
+
self.class.create(attributes[:file], prefix_options)
|
9
|
+
end
|
10
|
+
|
11
|
+
def destroy
|
12
|
+
self.id = try(:category)
|
13
|
+
super
|
14
|
+
end
|
15
|
+
|
16
|
+
class << self
|
17
|
+
def create(file, prefix_options)
|
18
|
+
check_prefix_options(prefix_options)
|
19
|
+
raise ActiveResource::BadRequest, "" unless file.instance_of?(File)
|
20
|
+
|
21
|
+
upload(file, prefix_options)
|
22
|
+
end
|
23
|
+
|
24
|
+
def find(*arguments)
|
25
|
+
scope = arguments.slice!(0)
|
26
|
+
options = arguments.slice!(0) || {}
|
27
|
+
|
28
|
+
prefix_options, = split_options(options[:params])
|
29
|
+
check_prefix_options(prefix_options)
|
30
|
+
|
31
|
+
case scope
|
32
|
+
when :all then download(nil, prefix_options)
|
33
|
+
else download(scope, prefix_options)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def where(clauses = {})
|
38
|
+
raise ArgumentError, "expected a clauses Hash, got #{clauses.inspect}" unless clauses.is_a? Hash
|
39
|
+
|
40
|
+
category = clauses[:category]
|
41
|
+
find(category, params: clauses)
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
def download(category = nil, prefix_options = {})
|
47
|
+
extention = category.blank? ? ".zip" : ".map"
|
48
|
+
|
49
|
+
conn = Faraday.new(url: site.to_s, ssl: { verify: false }) do |builder|
|
50
|
+
builder.adapter :net_http
|
51
|
+
end
|
52
|
+
conn.headers["Authorization"] = access_token
|
53
|
+
|
54
|
+
response = conn.get(element_path(category, prefix_options))
|
55
|
+
|
56
|
+
if check_response(response)
|
57
|
+
return instantiate_record({}, prefix_options).tap do |record|
|
58
|
+
record.file = Tempfile.open(["docomo-nlu", extention]) do |f|
|
59
|
+
f.write response.body.force_encoding("UTF-8")
|
60
|
+
f
|
61
|
+
end
|
62
|
+
record.category = category
|
63
|
+
record.categories = JSON.parse(response.body)["categories"] unless category
|
64
|
+
end
|
65
|
+
end
|
66
|
+
nil
|
67
|
+
end
|
68
|
+
|
69
|
+
def upload(file, prefix_options)
|
70
|
+
conn = Faraday.new(url: site.to_s, ssl: { verify: false }) do |builder|
|
71
|
+
builder.request :multipart # マルチパートでデータを送信
|
72
|
+
builder.request :url_encoded
|
73
|
+
builder.adapter :net_http
|
74
|
+
end
|
75
|
+
conn.headers["Authorization"] = access_token
|
76
|
+
params = {
|
77
|
+
uploadFile: Faraday::UploadIO.new(file.path, "text/plain"),
|
78
|
+
}
|
79
|
+
response = conn.put collection_path(prefix_options), params
|
80
|
+
check_response(response)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module DocomoNlu
|
4
|
-
module Management
|
5
|
-
class NGWord <
|
4
|
+
module Management
|
5
|
+
class NGWord < OKNGBase
|
6
6
|
self.element_name = "ngWords"
|
7
7
|
self.prefix = "/management/v2.6/projects/:project_id/bots/:bot_id/"
|
8
|
+
self.extention = ".ng"
|
8
9
|
end
|
9
10
|
end
|
10
11
|
end
|
data/lib/{docomo-nlu/management/V23/multipart_base.rb → docomo_nlu/management/ok_ng_base.rb}
RENAMED
@@ -2,17 +2,22 @@
|
|
2
2
|
|
3
3
|
require "tempfile"
|
4
4
|
module DocomoNlu
|
5
|
-
module Management
|
6
|
-
class
|
5
|
+
module Management
|
6
|
+
class OKNGBase < Base
|
7
|
+
class_attribute :extention
|
8
|
+
|
7
9
|
def save
|
8
10
|
self.class.create(attributes[:file], prefix_options)
|
9
11
|
end
|
10
12
|
|
11
13
|
def destroy
|
12
|
-
self.id = try(:category)
|
13
14
|
super
|
14
15
|
end
|
15
16
|
|
17
|
+
def download
|
18
|
+
self.file = self.class.download(prefix_options).file
|
19
|
+
end
|
20
|
+
|
16
21
|
class << self
|
17
22
|
def create(file, prefix_options)
|
18
23
|
check_prefix_options(prefix_options)
|
@@ -21,52 +26,42 @@ module DocomoNlu
|
|
21
26
|
upload(file, prefix_options)
|
22
27
|
end
|
23
28
|
|
24
|
-
def
|
25
|
-
|
26
|
-
|
29
|
+
def all(options = {})
|
30
|
+
find(options)
|
31
|
+
end
|
27
32
|
|
33
|
+
def find(options)
|
28
34
|
prefix_options, = split_options(options[:params])
|
29
35
|
check_prefix_options(prefix_options)
|
30
|
-
|
31
|
-
case scope
|
32
|
-
when :all then download(nil, prefix_options)
|
33
|
-
else download(scope, prefix_options)
|
34
|
-
end
|
36
|
+
download(prefix_options)
|
35
37
|
end
|
36
38
|
|
37
39
|
def where(clauses = {})
|
38
|
-
|
39
|
-
|
40
|
-
category = clauses[:category]
|
41
|
-
find(category, params: clauses)
|
40
|
+
find(params: clauses)
|
42
41
|
end
|
43
42
|
|
44
|
-
|
45
|
-
|
46
|
-
def download(category = nil, prefix_options = {})
|
47
|
-
extention = category.blank? ? ".zip" : ".map"
|
48
|
-
|
43
|
+
def download(prefix_options = {})
|
49
44
|
conn = Faraday.new(url: site.to_s, ssl: { verify: false }) do |builder|
|
50
45
|
builder.adapter :net_http
|
51
46
|
end
|
52
47
|
conn.headers["Authorization"] = access_token
|
53
48
|
|
54
|
-
response = conn.get(element_path(
|
49
|
+
response = conn.get(element_path(nil, prefix_options))
|
55
50
|
|
56
51
|
if check_response(response)
|
57
|
-
instantiate_record({}, prefix_options).tap do |record|
|
52
|
+
return instantiate_record({}, prefix_options).tap do |record|
|
58
53
|
record.file = Tempfile.open(["docomo-nlu", extention]) do |f|
|
59
54
|
f.write response.body.force_encoding("UTF-8")
|
60
55
|
f
|
61
56
|
end
|
62
|
-
record.category = category
|
63
57
|
end
|
64
58
|
end
|
59
|
+
nil
|
65
60
|
end
|
66
61
|
|
67
62
|
def upload(file, prefix_options)
|
68
63
|
conn = Faraday.new(url: site.to_s, ssl: { verify: false }) do |builder|
|
69
|
-
builder.request :multipart
|
64
|
+
builder.request :multipart
|
70
65
|
builder.request :url_encoded
|
71
66
|
builder.adapter :net_http
|
72
67
|
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module DocomoNlu
|
4
|
-
module Management
|
5
|
-
class OKWord <
|
4
|
+
module Management
|
5
|
+
class OKWord < OKNGBase
|
6
6
|
self.element_name = "okWords"
|
7
7
|
self.prefix = "/management/v2.6/projects/:project_id/bots/:bot_id/"
|
8
|
+
self.extention = ".ans"
|
8
9
|
end
|
9
10
|
end
|
10
11
|
end
|