karaden-prg-ruby 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.devcontainer/devcontainer.json +33 -40
- data/.devcontainer/docker/ruby/Dockerfile +21 -12
- data/.devcontainer/docker-compose.yml +3 -2
- data/.devcontainer/lifecycle/initialize-command.sh +6 -0
- data/.rubocop.yml +5 -0
- data/LICENSE +1 -1
- data/lib/karaden/config.rb +1 -1
- data/lib/karaden/net/requestor.rb +2 -2
- data/lib/karaden/net/requestor_interface.rb +1 -1
- data/lib/karaden/param/message/bulk/bulk_message_create_params.rb +0 -1
- data/lib/karaden/param/message/bulk/bulk_message_download_params.rb +5 -18
- data/lib/karaden/request_options.rb +5 -18
- data/lib/karaden/service/bulk_message_service.rb +5 -5
- metadata +7 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7b6eadc4a71ffb028555269758d495cbbd55d64acbf1dd56c866b6d526bad89d
|
|
4
|
+
data.tar.gz: c792f6b657fd7df4debafc7d100f55078c10f93a5886f56f03e843611e244343
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ffa33a4af4af490f9a9f29d5020f1fe22dcd4cff19a469b07303e18ec7fa6d879f7e0ce17a4b8bfb4510adf2823c704962460506c08d2bee63ec609f3bb481ee
|
|
7
|
+
data.tar.gz: 248a813af69630da1243dc2b11989ecce62eff9cdbf5c1ead7552f23cce911fbd5f4eb4d26282f226298643c503e6d5f30d99e91c1e97a3027cd93db8afd5bdd
|
|
@@ -1,45 +1,38 @@
|
|
|
1
1
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
|
2
2
|
// README at: https://github.com/devcontainers/templates/tree/main/src/ruby
|
|
3
3
|
{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
"name": "ruby-sdk",
|
|
5
|
+
// Sets the run context to one level up instead of the .devcontainer folder.
|
|
6
|
+
"dockerComposeFile": [
|
|
7
|
+
"docker-compose.yml"
|
|
8
|
+
],
|
|
9
|
+
"service": "ruby",
|
|
10
10
|
"workspaceFolder": "/var/task",
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
// "forwardPorts": [],
|
|
39
|
-
// Use 'postCreateCommand' to run commands after the container is created.
|
|
40
|
-
// "postCreateCommand": "ruby --version",
|
|
41
|
-
// Configure tool-specific properties.
|
|
42
|
-
// "customizations": {},
|
|
43
|
-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
|
44
|
-
// "remoteUser": "root"
|
|
11
|
+
"customizations": {
|
|
12
|
+
"vscode": {
|
|
13
|
+
"settings": {
|
|
14
|
+
"[ruby]": {
|
|
15
|
+
"editor.defaultFormatter": "Shopify.ruby-lsp",
|
|
16
|
+
"editor.formatOnSave": true,
|
|
17
|
+
"editor.tabSize": 2,
|
|
18
|
+
"editor.insertSpaces": true,
|
|
19
|
+
"editor.semanticHighlighting.enabled": true,
|
|
20
|
+
"editor.formatOnType": true
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"extensions": [
|
|
24
|
+
"Shopify.ruby-extensions-pack",
|
|
25
|
+
"humao.rest-client"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
|
30
|
+
//"forwardPorts": [8080]
|
|
31
|
+
|
|
32
|
+
// Use 'postCreateCommand' to run commands after the container is created.
|
|
33
|
+
// "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html"
|
|
34
|
+
"initializeCommand": "cd .devcontainer && sh lifecycle/initialize-command.sh",
|
|
35
|
+
|
|
36
|
+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
|
37
|
+
"remoteUser": "nttcoms"
|
|
45
38
|
}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
FROM
|
|
1
|
+
FROM ruby:3.0.6
|
|
2
2
|
|
|
3
|
-
ARG USERNAME
|
|
4
|
-
ARG USER_UID
|
|
5
|
-
ARG USER_GID
|
|
6
|
-
ARG TIME_ZONE
|
|
7
|
-
ARG LOCALE
|
|
3
|
+
ARG USERNAME
|
|
4
|
+
ARG USER_UID
|
|
5
|
+
ARG USER_GID
|
|
6
|
+
ARG TIME_ZONE
|
|
7
|
+
ARG LOCALE
|
|
8
|
+
ARG WORKING_DIR
|
|
8
9
|
|
|
9
10
|
ENV LANG=${LOCALE}
|
|
10
|
-
ENV LANGUAGE=${LANGUAGE}
|
|
11
11
|
ENV TZ=${TIME_ZONE}
|
|
12
12
|
|
|
13
13
|
RUN apt-get update \
|
|
14
|
-
&& apt-get install -y
|
|
14
|
+
&& apt-get install -y sudo git
|
|
15
|
+
|
|
16
|
+
RUN apt-get install -y locales \
|
|
15
17
|
&& locale-gen ja_JP.UTF-8 \
|
|
16
18
|
&& localedef -f UTF-8 -i ja_JP ja_JP.UTF-8 \
|
|
17
19
|
&& update-locale LANG=ja_JP.UTF-8
|
|
@@ -19,12 +21,19 @@ RUN apt-get update \
|
|
|
19
21
|
RUN ln -snf /usr/share/zoneinfo/${TIME_ZONE} /etc/localtime \
|
|
20
22
|
&& echo ${TIME_ZONE} > /etc/timezone
|
|
21
23
|
|
|
24
|
+
RUN /usr/sbin/groupadd --gid ${USER_GID} ${USERNAME} \
|
|
25
|
+
&& /usr/sbin/useradd -s /bin/bash --uid ${USER_UID} --gid ${USER_GID} -m ${USERNAME} \
|
|
26
|
+
&& echo ${USERNAME} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USERNAME} \
|
|
27
|
+
&& chmod 0440 /etc/sudoers.d/${USERNAME}
|
|
28
|
+
|
|
22
29
|
USER ${USER_UID}
|
|
23
30
|
|
|
24
31
|
RUN curl https://get.volta.sh | bash
|
|
25
32
|
|
|
26
|
-
RUN echo -
|
|
27
|
-
LANG
|
|
28
|
-
|
|
29
|
-
LC_ALL="${LOCALE}"\n\
|
|
33
|
+
RUN /bin/echo -e "\n\
|
|
34
|
+
LANG=\"${LANG}\"\n\
|
|
35
|
+
LC_ALL=\"${LOCALE}\"\n\
|
|
30
36
|
" >> ~/.bashrc
|
|
37
|
+
|
|
38
|
+
RUN sudo rm -rf /var/task \
|
|
39
|
+
&& sudo ln -s ${WORKING_DIR} /var/task
|
data/.rubocop.yml
CHANGED
data/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) NTT DOCOMO BUSINESS X, Inc.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/lib/karaden/config.rb
CHANGED
|
@@ -3,7 +3,7 @@ module Karaden
|
|
|
3
3
|
class Requestor < RequestorInterface
|
|
4
4
|
DEFAULT_USER_AGENT = 'Karaden/Ruby/'.freeze
|
|
5
5
|
|
|
6
|
-
def send(method, path, content_type = nil, params = nil, data = nil, request_options = nil, is_no_contents
|
|
6
|
+
def send(method, path, content_type = nil, params = nil, data = nil, request_options = nil, is_no_contents: false)
|
|
7
7
|
request_options = Karaden::RequestOptions.new if request_options.nil?
|
|
8
8
|
options = Karaden::Config.as_request_options.merge(request_options).validate
|
|
9
9
|
headers = {
|
|
@@ -11,7 +11,7 @@ module Karaden
|
|
|
11
11
|
'Karaden-Client-User-Agent': build_client_user_agent,
|
|
12
12
|
'Karaden-Version' => options.api_version,
|
|
13
13
|
'Content-Type': content_type,
|
|
14
|
-
'Authorization': build_authorization(options)
|
|
14
|
+
'Authorization': build_authorization(options)
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
uri = URI.parse(build_http_url(path, params, options))
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Karaden
|
|
2
2
|
module Net
|
|
3
3
|
class RequestorInterface
|
|
4
|
-
def send(method, path, content_type = nil, params = nil, data = nil, request_options = nil, is_no_contents
|
|
4
|
+
def send(method, path, content_type = nil, params = nil, data = nil, request_options = nil, is_no_contents: false)
|
|
5
5
|
raise NotImplementedError
|
|
6
6
|
end
|
|
7
7
|
end
|
|
@@ -22,33 +22,20 @@ module Karaden
|
|
|
22
22
|
|
|
23
23
|
def validate
|
|
24
24
|
errors = Karaden::Model::KaradenObject.new
|
|
25
|
-
has_error = false
|
|
26
25
|
|
|
27
26
|
messages = validate_id
|
|
28
|
-
unless messages.empty?
|
|
29
|
-
errors.set_property('id', messages)
|
|
30
|
-
has_error = true
|
|
31
|
-
end
|
|
27
|
+
errors.set_property('id', messages) unless messages.empty?
|
|
32
28
|
|
|
33
29
|
messages = validate_directory_path
|
|
34
|
-
unless messages.empty?
|
|
35
|
-
errors.set_property('directory_path', messages)
|
|
36
|
-
has_error = true
|
|
37
|
-
end
|
|
30
|
+
errors.set_property('directory_path', messages) unless messages.empty?
|
|
38
31
|
|
|
39
32
|
messages = validate_max_retries
|
|
40
|
-
unless messages.empty?
|
|
41
|
-
errors.set_property('max_retries', messages)
|
|
42
|
-
has_error = true
|
|
43
|
-
end
|
|
33
|
+
errors.set_property('max_retries', messages) unless messages.empty?
|
|
44
34
|
|
|
45
35
|
messages = validate_retry_interval
|
|
46
|
-
unless messages.empty?
|
|
47
|
-
errors.set_property('retry_interval', messages)
|
|
48
|
-
has_error = true
|
|
49
|
-
end
|
|
36
|
+
errors.set_property('retry_interval', messages) unless messages.empty?
|
|
50
37
|
|
|
51
|
-
|
|
38
|
+
unless errors.property_keys.filter { |key| !errors.property(key).nil? }.empty?
|
|
52
39
|
e = Karaden::Exception::InvalidParamsException.new
|
|
53
40
|
error = Karaden::Model::Error.new
|
|
54
41
|
error.set_property('object', Karaden::Model::Error::OBJECT_NAME)
|
|
@@ -27,33 +27,20 @@ module Karaden
|
|
|
27
27
|
|
|
28
28
|
def validate
|
|
29
29
|
errors = Karaden::Model::KaradenObject.new
|
|
30
|
-
has_error = false
|
|
31
30
|
|
|
32
31
|
messages = validate_api_base
|
|
33
|
-
unless messages.empty?
|
|
34
|
-
errors.set_property('api_base', messages)
|
|
35
|
-
has_error = true
|
|
36
|
-
end
|
|
32
|
+
errors.set_property('api_base', messages) unless messages.empty?
|
|
37
33
|
|
|
38
34
|
messages = validate_api_key
|
|
39
|
-
unless messages.empty?
|
|
40
|
-
errors.set_property('api_key', messages)
|
|
41
|
-
has_error = true
|
|
42
|
-
end
|
|
35
|
+
errors.set_property('api_key', messages) unless messages.empty?
|
|
43
36
|
|
|
44
37
|
messages = validate_api_version
|
|
45
|
-
unless messages.empty?
|
|
46
|
-
errors.set_property('api_version', messages)
|
|
47
|
-
has_error = true
|
|
48
|
-
end
|
|
38
|
+
errors.set_property('api_version', messages) unless messages.empty?
|
|
49
39
|
|
|
50
40
|
messages = validate_tenant_id
|
|
51
|
-
unless messages.empty?
|
|
52
|
-
errors.set_property('tenant_id', messages)
|
|
53
|
-
has_error = true
|
|
54
|
-
end
|
|
41
|
+
errors.set_property('tenant_id', messages) unless messages.empty?
|
|
55
42
|
|
|
56
|
-
|
|
43
|
+
unless errors.property_keys.filter { |key| !errors.property(key).nil? }.empty?
|
|
57
44
|
e = Karaden::Exception::InvalidRequestOptionsException.new
|
|
58
45
|
error = Karaden::Model::Error.new
|
|
59
46
|
error.set_property('object', Karaden::Model::Error::OBJECT_NAME)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Karaden
|
|
2
2
|
module Service
|
|
3
3
|
class BulkMessageService
|
|
4
|
-
REGEX_PATTERN = /filename="([^"]+)"
|
|
4
|
+
REGEX_PATTERN = /filename="([^"]+)"/
|
|
5
5
|
|
|
6
6
|
def self.create(filename, request_options = nil)
|
|
7
7
|
raise Karaden::Exception::FileNotFoundException unless File.file?(filename)
|
|
@@ -58,9 +58,9 @@ module Karaden
|
|
|
58
58
|
true
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
-
def self.check_bulk_message_status(retry_count,
|
|
61
|
+
def self.check_bulk_message_status(retry_count, _retry_interval, params, request_options)
|
|
62
62
|
result = false
|
|
63
|
-
(0..retry_count).each do |
|
|
63
|
+
(0..retry_count).each do |_count|
|
|
64
64
|
# sleep retry_interval if count.positive?
|
|
65
65
|
bulk_message = Karaden::Model::BulkMessage.show(params, request_options)
|
|
66
66
|
raise Exception::BulkMessageCreateFailedException if bulk_message.status == Karaden::Model::BulkMessage::STATUS_ERROR
|
|
@@ -73,9 +73,9 @@ module Karaden
|
|
|
73
73
|
result
|
|
74
74
|
end
|
|
75
75
|
|
|
76
|
-
def self.get_download_url(retry_count,
|
|
76
|
+
def self.get_download_url(retry_count, _retry_interval, params, request_options)
|
|
77
77
|
result = nil
|
|
78
|
-
(0..retry_count).each do |
|
|
78
|
+
(0..retry_count).each do |_count|
|
|
79
79
|
# sleep retry_interval if count.positive?
|
|
80
80
|
output = Karaden::Model::BulkMessage.list_message(params, request_options)
|
|
81
81
|
unless output.nil?
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: karaden-prg-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- cpaas-dev-admin-om
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-01-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -100,7 +100,7 @@ dependencies:
|
|
|
100
100
|
- - ">="
|
|
101
101
|
- !ruby/object:Gem::Version
|
|
102
102
|
version: '0'
|
|
103
|
-
description:
|
|
103
|
+
description:
|
|
104
104
|
email:
|
|
105
105
|
- cpaas-dev-admin-om@nttcoms.com
|
|
106
106
|
executables: []
|
|
@@ -110,6 +110,7 @@ files:
|
|
|
110
110
|
- ".devcontainer/devcontainer.json"
|
|
111
111
|
- ".devcontainer/docker-compose.yml"
|
|
112
112
|
- ".devcontainer/docker/ruby/Dockerfile"
|
|
113
|
+
- ".devcontainer/lifecycle/initialize-command.sh"
|
|
113
114
|
- ".rspec"
|
|
114
115
|
- ".rubocop.yml"
|
|
115
116
|
- ".vscode/launch.json"
|
|
@@ -174,7 +175,7 @@ licenses:
|
|
|
174
175
|
metadata:
|
|
175
176
|
homepage_uri: https://github.com/karaden-prg/karaden-prg-ruby
|
|
176
177
|
source_code_uri: https://github.com/karaden-prg/karaden-prg-ruby
|
|
177
|
-
post_install_message:
|
|
178
|
+
post_install_message:
|
|
178
179
|
rdoc_options: []
|
|
179
180
|
require_paths:
|
|
180
181
|
- lib
|
|
@@ -190,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
190
191
|
version: '0'
|
|
191
192
|
requirements: []
|
|
192
193
|
rubygems_version: 3.2.33
|
|
193
|
-
signing_key:
|
|
194
|
+
signing_key:
|
|
194
195
|
specification_version: 4
|
|
195
196
|
summary: Ruby library for the Karaden API.
|
|
196
197
|
test_files: []
|