docomo-nlu 0.2.5 → 0.3.2
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 +20 -11
- data/.ruby-version +1 -1
- data/Gemfile.lock +115 -131
- 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 +31 -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 +14 -8
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/base.rb +4 -4
- 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 +13 -9
- 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 -2
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/log.rb +8 -8
- 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 +1 -1
- data/lib/{docomo-nlu/management/V26 → docomo_nlu/management}/ok_word.rb +1 -1
- 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 +2 -2
- 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 +4 -4
- 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 +8 -8
- 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 +1 -1
- data/vcr/vcr_cassettes/{V26 → management}/bot_log/query.yml +1 -1
- 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 +1 -1
- data/vcr/vcr_cassettes/{V26 → management}/log/count.yml +1 -1
- data/vcr/vcr_cassettes/{V26 → management}/log/count/all.yml +1 -1
- data/vcr/vcr_cassettes/{V26 → management}/log/count/query.yml +1 -1
- data/vcr/vcr_cassettes/{V26 → management}/log/query.yml +1 -1
- 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/{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 +184 -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/multipart_base.rb +0 -83
- 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/create_400.yml +0 -48
- 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/save_400.yml +0 -48
- data/vcr/vcr_cassettes/V23/set/show_find.yml +0 -43
- data/vcr/vcr_cassettes/V23/set/show_where.yml +0 -43
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module DocomoNlu
|
4
|
-
module Management::V23
|
5
|
-
class DefaultPredicate < Base
|
6
|
-
self.element_name = "defaultPredicates"
|
7
|
-
self.prefix = "/management/v2.2/projects/:project_id/bots/:bot_id/"
|
8
|
-
|
9
|
-
def destroy(keys)
|
10
|
-
self.id = keys.join(",")
|
11
|
-
super()
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,83 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "tempfile"
|
4
|
-
module DocomoNlu
|
5
|
-
module Management::V23
|
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
|
-
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
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
def upload(file, prefix_options)
|
68
|
-
conn = Faraday.new(url: site.to_s, ssl: { verify: false }) do |builder|
|
69
|
-
builder.request :multipart # マルチパートでデータを送信
|
70
|
-
builder.request :url_encoded
|
71
|
-
builder.adapter :net_http
|
72
|
-
end
|
73
|
-
conn.headers["Authorization"] = access_token
|
74
|
-
params = {
|
75
|
-
uploadFile: Faraday::UploadIO.new(file.path, "text/plain"),
|
76
|
-
}
|
77
|
-
response = conn.put collection_path(prefix_options), params
|
78
|
-
check_response(response)
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module DocomoNlu
|
4
|
-
module Management::V23
|
5
|
-
class Organization < Base
|
6
|
-
self.element_name = "organizations"
|
7
|
-
self.prefix = "/management/v2.2/"
|
8
|
-
|
9
|
-
# Parameter create
|
10
|
-
# {
|
11
|
-
# "organizationName": "your organization name",
|
12
|
-
# "address": "address",
|
13
|
-
# "tel": "tel"
|
14
|
-
# }
|
15
|
-
|
16
|
-
def to_json(options = {})
|
17
|
-
attributes.delete("organizationId")
|
18
|
-
attributes.delete("id")
|
19
|
-
super
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module DocomoNlu
|
4
|
-
module Management::V23
|
5
|
-
class OrganizationMember < Base
|
6
|
-
self.element_name = "members"
|
7
|
-
self.prefix = "/management/v2.2/organizations/:organization_id/"
|
8
|
-
|
9
|
-
def destroy
|
10
|
-
self.id = accountId
|
11
|
-
super
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module DocomoNlu
|
4
|
-
module Management::V23
|
5
|
-
class PredicateName < Base
|
6
|
-
self.element_name = "predicateNames"
|
7
|
-
self.prefix = "/management/v2.2/projects/:project_id/bots/:bot_id/"
|
8
|
-
|
9
|
-
def destroy(keys)
|
10
|
-
self.id = keys.join(",")
|
11
|
-
super()
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module DocomoNlu
|
4
|
-
module Management::V23
|
5
|
-
class Project < Base
|
6
|
-
self.element_name = "projects"
|
7
|
-
self.prefix = "/management/v2.2/"
|
8
|
-
|
9
|
-
# Parameter for create
|
10
|
-
# {
|
11
|
-
# "projectName": "your project name"
|
12
|
-
# "organizationId": "your organization id"
|
13
|
-
# }
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module DocomoNlu
|
4
|
-
module Management::V23
|
5
|
-
class ProjectMember < Base
|
6
|
-
self.element_name = "members"
|
7
|
-
self.prefix = "/management/v2.2/projects/:project_id/"
|
8
|
-
|
9
|
-
def destroy
|
10
|
-
self.id = accountId
|
11
|
-
super
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module DocomoNlu
|
4
|
-
module Management::V23
|
5
|
-
class Provider < Base
|
6
|
-
self.element_name = "providers"
|
7
|
-
self.prefix = "/management/v2.2/"
|
8
|
-
|
9
|
-
# Parameter for create
|
10
|
-
# {
|
11
|
-
# "organizationId": "id",
|
12
|
-
# "serverKind":"SS",
|
13
|
-
# "serverId": "DSU"
|
14
|
-
# }
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module DocomoNlu
|
4
|
-
module Management::V23
|
5
|
-
class Scenario < AIMLBase
|
6
|
-
self.element_name = "scenarios"
|
7
|
-
self.prefix = "/management/v2.2/projects/:project_id/bots/:bot_id/"
|
8
|
-
|
9
|
-
@permitted_root_param = [:userScenarios, :templateScenarios]
|
10
|
-
@permitted_userScenarios_param = [:scenarioId, :description, :compileFlag]
|
11
|
-
|
12
|
-
def save
|
13
|
-
@attributes.select! {|a| a =~ /(userScenarios|templateScenarios)/ }
|
14
|
-
userScenarios.each do |us|
|
15
|
-
us.attributes.select! {|a| a =~ /(scenarioId|description|compileFlag)/ }
|
16
|
-
end
|
17
|
-
super
|
18
|
-
end
|
19
|
-
|
20
|
-
def destroy(scenario_id)
|
21
|
-
self.id = scenario_id
|
22
|
-
super()
|
23
|
-
end
|
24
|
-
|
25
|
-
class UserScenarios < Base; end
|
26
|
-
class TemplateScenarios < Base; end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module DocomoNlu
|
4
|
-
module Management::V23
|
5
|
-
class ScenarioUtil < Base
|
6
|
-
self.element_name = "scenarioUtils"
|
7
|
-
self.prefix = "/management/v2.2/"
|
8
|
-
|
9
|
-
def normalize
|
10
|
-
# TODO
|
11
|
-
end
|
12
|
-
|
13
|
-
def matches
|
14
|
-
# TODO
|
15
|
-
end
|
16
|
-
|
17
|
-
def save
|
18
|
-
print "Method not used"
|
19
|
-
end
|
20
|
-
|
21
|
-
def destroy
|
22
|
-
print "Method not used"
|
23
|
-
end
|
24
|
-
|
25
|
-
def delete
|
26
|
-
print "Method not used"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module DocomoNlu
|
4
|
-
module Management::V23
|
5
|
-
class TaskProject < Base
|
6
|
-
self.element_name = "taskProjects"
|
7
|
-
self.prefix = "/management/v2.2/"
|
8
|
-
|
9
|
-
# Parameter for create
|
10
|
-
# {
|
11
|
-
# "scenarioProjectId": "",
|
12
|
-
# "description": "",
|
13
|
-
# "publicHost": "",
|
14
|
-
# "internalHosts": [
|
15
|
-
# "nnn.nnn.nnn.nnn", "nnn.nnn.nnn.nnn", "nnn.nnn.nnn.nnn"
|
16
|
-
# ]
|
17
|
-
# }
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,83 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "tempfile"
|
4
|
-
module DocomoNlu
|
5
|
-
module Management::V26
|
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
|
-
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
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
def upload(file, prefix_options)
|
68
|
-
conn = Faraday.new(url: site.to_s, ssl: { verify: false }) do |builder|
|
69
|
-
builder.request :multipart # マルチパートでデータを送信
|
70
|
-
builder.request :url_encoded
|
71
|
-
builder.adapter :net_http
|
72
|
-
end
|
73
|
-
conn.headers["Authorization"] = access_token
|
74
|
-
params = {
|
75
|
-
uploadFile: Faraday::UploadIO.new(file.path, "text/plain"),
|
76
|
-
}
|
77
|
-
response = conn.put collection_path(prefix_options), params
|
78
|
-
check_response(response)
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|