smarthr 0.0.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.
@@ -0,0 +1,80 @@
1
+ module SmartHR::Client::JobTitleMethods
2
+ # Delete the job title
3
+ #
4
+ # @see https://developer.smarthr.jp/api/index.html#!/%E5%BD%B9%E8%81%B7/deleteV1JobTitlesId
5
+ #
6
+ # @param id [String]
7
+ #
8
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
9
+ # @yieldparam response_body [Hashie::Mash] response body
10
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
11
+ def destroy_job_title(id:, &block)
12
+ delete("/job_titles/#{id}", &block)
13
+ end
14
+
15
+ # Get the job title
16
+ #
17
+ # @see https://developer.smarthr.jp/api/index.html#!/%E5%BD%B9%E8%81%B7/getV1JobTitlesId
18
+ #
19
+ # @param id [String]
20
+ #
21
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
22
+ # @yieldparam response_body [Hashie::Mash] response body
23
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
24
+ #
25
+ # @return [Hashie::Mash]
26
+ def find_job_title(id:, &block)
27
+ get("/job_titles/#{id}", &block)
28
+ end
29
+
30
+ # Change the data of the specified job title
31
+ #
32
+ # @see https://developer.smarthr.jp/api/index.html#!/%E5%BD%B9%E8%81%B7/patchV1JobTitlesId
33
+ #
34
+ # @param id [String]
35
+ # @param body [Hash]
36
+ #
37
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
38
+ # @yieldparam response_body [Hashie::Mash] response body
39
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
40
+ #
41
+ # @return [Hashie::Mash]
42
+ def update_job_title(id:, body:, &block)
43
+ patch("/job_titles/#{id}", body, &block)
44
+ end
45
+
46
+ # Get the list of job titles
47
+ #
48
+ # @see https://developer.smarthr.jp/api/index.html#!/%E5%BD%B9%E8%81%B7/getV1JobTitles
49
+ #
50
+ # @param page [Integer]
51
+ # @param per_page [Integer]
52
+ #
53
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
54
+ # @yieldparam response_body [Array<Hashie::Mash>] response body
55
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
56
+ #
57
+ # @return [Array<Hashie::Mash>]
58
+ def get_job_titles(page: 1, per_page: 10, &block)
59
+ get("/job_titles",
60
+ page: page,
61
+ per_page: per_page,
62
+ &block
63
+ )
64
+ end
65
+
66
+ # Create a new job title
67
+ #
68
+ # @see https://developer.smarthr.jp/api/index.html#!/%E5%BD%B9%E8%81%B7/postV1JobTitles
69
+ #
70
+ # @param body [Hash]
71
+ #
72
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
73
+ # @yieldparam response_body [Hashie::Mash] response body
74
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
75
+ #
76
+ # @return [Hashie::Mash]
77
+ def create_job_title(body:, &block)
78
+ post("/job_titles", body, &block)
79
+ end
80
+ end
@@ -0,0 +1,39 @@
1
+ module SmartHR::Client::MailFormatMethods
2
+ # Get the mail format
3
+ #
4
+ # @see https://developer.smarthr.jp/api/index.html#!/%E3%83%A1%E3%83%BC%E3%83%AB%E3%83%95%E3%82%A9%E3%83%BC%E3%83%9E%E3%83%83%E3%83%88/getV1MailFormatsId
5
+ #
6
+ # @param id [String]
7
+ # @param embed_crew_input_forms [Boolean] Whether or not to embed crew input forms
8
+ #
9
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
10
+ # @yieldparam response_body [Hashie::Mash] response body
11
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
12
+ #
13
+ # @return [Hashie::Mash]
14
+ def find_mail_format(id:, embed_crew_input_forms: false, &block)
15
+ get("/mail_formats/#{id}", embed: embed_crew_input_forms ? 'crew_input_forms' : nil, &block)
16
+ end
17
+
18
+ # Get the list of mail formats
19
+ #
20
+ # @see https://developer.smarthr.jp/api/index.html#!/%E3%83%A1%E3%83%BC%E3%83%AB%E3%83%95%E3%82%A9%E3%83%BC%E3%83%9E%E3%83%83%E3%83%88/getV1MailFormats
21
+ #
22
+ # @param page [Integer]
23
+ # @param per_page [Integer]
24
+ # @param embed_crew_input_forms [Boolean] Whether or not to embed crew input forms
25
+ #
26
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
27
+ # @yieldparam response_body [Array<Hashie::Mash>] response body
28
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
29
+ #
30
+ # @return [Array<Hashie::Mash>]
31
+ def get_mail_formats(page: 1, per_page: 10, embed_crew_input_forms: false, &block)
32
+ get("/mail_formats",
33
+ page: page,
34
+ per_page: per_page,
35
+ embed: embed_crew_input_forms ? 'crew_input_forms' : nil,
36
+ &block
37
+ )
38
+ end
39
+ end
@@ -0,0 +1,36 @@
1
+ module SmartHR::Client::PaymentPeriodMethods
2
+ # Get the payment period
3
+ #
4
+ # @see https://developer.smarthr.jp/api/index.html#!/%E7%B5%A6%E4%B8%8E%E6%94%AF%E7%B5%A6%E5%BD%A2%E6%85%8B/getV1PaymentPeriodsId
5
+ #
6
+ # @param id [String]
7
+ #
8
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
9
+ # @yieldparam response_body [Hashie::Mash] response body
10
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
11
+ #
12
+ # @return [Hashie::Mash]
13
+ def find_payment_period(id:, &block)
14
+ get("/payment_periods/#{id}", &block)
15
+ end
16
+
17
+ # Get the list of payment periods
18
+ #
19
+ # @see https://developer.smarthr.jp/api/index.html#!/%E7%B5%A6%E4%B8%8E%E6%94%AF%E7%B5%A6%E5%BD%A2%E6%85%8B/getV1PaymentPeriods
20
+ #
21
+ # @param page [Integer]
22
+ # @param per_page [Integer]
23
+ #
24
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
25
+ # @yieldparam response_body [Array<Hashie::Mash>] response body
26
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
27
+ #
28
+ # @return [Array<Hashie::Mash>]
29
+ def get_payment_periods(page: 1, per_page: 10, &block)
30
+ get("/payment_periods",
31
+ page: page,
32
+ per_page: per_page,
33
+ &block
34
+ )
35
+ end
36
+ end
@@ -0,0 +1,39 @@
1
+ module SmartHR::Client::UserMethods
2
+ # Get the user
3
+ #
4
+ # @see https://developer.smarthr.jp/api/index.html#!/%E3%83%A6%E3%83%BC%E3%82%B6/getV1UsersId
5
+ #
6
+ # @param id [String]
7
+ # @param embed_crew [Boolean] Whether or not to embed crews
8
+ #
9
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
10
+ # @yieldparam response_body [Hashie::Mash] response body
11
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
12
+ #
13
+ # @return [Hashie::Mash]
14
+ def find_user(id:, embed_crew: false, &block)
15
+ get("/users/#{id}", embed: embed_crew ? 'crew' : nil, &block)
16
+ end
17
+
18
+ # Get the list of users
19
+ #
20
+ # @see https://developer.smarthr.jp/api/index.html#!/%E3%83%A6%E3%83%BC%E3%82%B6/getV1Users
21
+ #
22
+ # @param page [Integer]
23
+ # @param per_page [Integer]
24
+ # @param embed_crew [Boolean] Whether or not to embed crews
25
+ #
26
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
27
+ # @yieldparam response_body [Array<Hashie::Mash>] response body
28
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
29
+ #
30
+ # @return [Array<Hashie::Mash>]
31
+ def get_users(page: 1, per_page: 10, embed_crew: false, &block)
32
+ get("/users",
33
+ page: page,
34
+ per_page: per_page,
35
+ embed: embed_crew ? 'crew' : nil,
36
+ &block
37
+ )
38
+ end
39
+ end
@@ -0,0 +1,80 @@
1
+ module SmartHR::Client::WebhookMethods
2
+ # Delete the webhook
3
+ #
4
+ # @see https://developer.smarthr.jp/api/index.html#!/Webhook/deleteV1WebhooksId
5
+ #
6
+ # @param id [String]
7
+ #
8
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
9
+ # @yieldparam response_body [Hashie::Mash] response body
10
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
11
+ def destroy_webhook(id:, &block)
12
+ delete("/webhooks/#{id}", &block)
13
+ end
14
+
15
+ # Get the webhook
16
+ #
17
+ # @see https://developer.smarthr.jp/api/index.html#!/Webhook/getV1WebhooksId
18
+ #
19
+ # @param id [String]
20
+ #
21
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
22
+ # @yieldparam response_body [Hashie::Mash] response body
23
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
24
+ #
25
+ # @return [Hashie::Mash]
26
+ def find_webhook(id:, &block)
27
+ get("/webhooks/#{id}", &block)
28
+ end
29
+
30
+ # Change the data of the specified webhook
31
+ #
32
+ # @see https://developer.smarthr.jp/api/index.html#!/Webhook/patchV1WebhooksId
33
+ #
34
+ # @param id [String]
35
+ # @param body [Hash]
36
+ #
37
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
38
+ # @yieldparam response_body [Hashie::Mash] response body
39
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
40
+ #
41
+ # @return [Hashie::Mash]
42
+ def update_webhook(id:, body:, &block)
43
+ patch("/webhooks/#{id}", body, &block)
44
+ end
45
+
46
+ # Get the list of webhooks
47
+ #
48
+ # @see https://developer.smarthr.jp/api/index.html#!/Webhook/getV1Webhooks
49
+ #
50
+ # @param page [Integer]
51
+ # @param per_page [Integer]
52
+ #
53
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
54
+ # @yieldparam response_body [Array<Hashie::Mash>] response body
55
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
56
+ #
57
+ # @return [Array<Hashie::Mash>]
58
+ def get_webhooks(page: 1, per_page: 10, &block)
59
+ get("/webhooks",
60
+ page: page,
61
+ per_page: per_page,
62
+ &block
63
+ )
64
+ end
65
+
66
+ # Create a new webhook
67
+ #
68
+ # @see https://developer.smarthr.jp/api/index.html#!/Webhook/postV1Webhooks
69
+ #
70
+ # @param body [Hash]
71
+ #
72
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
73
+ # @yieldparam response_body [Hashie::Mash] response body
74
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
75
+ #
76
+ # @return [Hashie::Mash]
77
+ def create_webhook(body:, &block)
78
+ post("/webhooks", body, &block)
79
+ end
80
+ end
@@ -0,0 +1,7 @@
1
+ module SmartHR
2
+ module Converter
3
+ def hash_compact(hash)
4
+ hash.reject { |_k, v| v.nil? }
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,3 @@
1
+ module SmartHR
2
+ VERSION = "0.0.1".freeze
3
+ end
data/smarthr.gemspec ADDED
@@ -0,0 +1,31 @@
1
+ require_relative 'lib/smarthr/version'
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "smarthr"
5
+ spec.version = SmartHR::VERSION
6
+ spec.authors = ["Proxyworks, Inc."]
7
+ spec.email = ["tsuji@proxyworks.co.jp"]
8
+
9
+ spec.summary = "SmartHR SDK for Ruby"
10
+ spec.description = "Ruby bindings of SmartHR API"
11
+ spec.homepage = "https://github.com/proxyworks-inc/smarthr-ruby"
12
+ spec.license = "MIT"
13
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
14
+
15
+ spec.metadata["homepage_uri"] = spec.homepage
16
+ spec.metadata["source_code_uri"] = "https://github.com/proxyworks-inc/smarthr-ruby"
17
+ spec.metadata["changelog_uri"] = "https://github.com/proxyworks-inc/smarthr-ruby/blob/main/CHANGELOG.md"
18
+
19
+ # Specify which files should be added to the gem when it is released.
20
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
21
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
22
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
23
+ end
24
+ spec.bindir = "exe"
25
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
+ spec.require_paths = ["lib"]
27
+
28
+ spec.add_dependency "faraday", ">= 0.9"
29
+ spec.add_dependency "faraday_middleware"
30
+ spec.add_dependency "hashie"
31
+ end
metadata ADDED
@@ -0,0 +1,113 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: smarthr
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Proxyworks, Inc.
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2021-06-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0.9'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0.9'
27
+ - !ruby/object:Gem::Dependency
28
+ name: faraday_middleware
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: hashie
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Ruby bindings of SmartHR API
56
+ email:
57
+ - tsuji@proxyworks.co.jp
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - CHANGELOG.md
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - lib/smarthr.rb
68
+ - lib/smarthr/client.rb
69
+ - lib/smarthr/client/bank_account_setting_methods.rb
70
+ - lib/smarthr/client/biz_establishment_methods.rb
71
+ - lib/smarthr/client/crew_custom_field_template_group_methods.rb
72
+ - lib/smarthr/client/crew_custom_field_template_methods.rb
73
+ - lib/smarthr/client/crew_input_form_method.rb
74
+ - lib/smarthr/client/crew_methods.rb
75
+ - lib/smarthr/client/department_methods.rb
76
+ - lib/smarthr/client/dependent_methods.rb
77
+ - lib/smarthr/client/dependent_relation_methods.rb
78
+ - lib/smarthr/client/employment_type_methods.rb
79
+ - lib/smarthr/client/job_title_methods.rb
80
+ - lib/smarthr/client/mail_format_methods.rb
81
+ - lib/smarthr/client/payment_period_methods.rb
82
+ - lib/smarthr/client/user_methods.rb
83
+ - lib/smarthr/client/webhook_methods.rb
84
+ - lib/smarthr/converter.rb
85
+ - lib/smarthr/version.rb
86
+ - smarthr.gemspec
87
+ homepage: https://github.com/proxyworks-inc/smarthr-ruby
88
+ licenses:
89
+ - MIT
90
+ metadata:
91
+ homepage_uri: https://github.com/proxyworks-inc/smarthr-ruby
92
+ source_code_uri: https://github.com/proxyworks-inc/smarthr-ruby
93
+ changelog_uri: https://github.com/proxyworks-inc/smarthr-ruby/blob/main/CHANGELOG.md
94
+ post_install_message:
95
+ rdoc_options: []
96
+ require_paths:
97
+ - lib
98
+ required_ruby_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: 2.3.0
103
+ required_rubygems_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ requirements: []
109
+ rubygems_version: 3.1.6
110
+ signing_key:
111
+ specification_version: 4
112
+ summary: SmartHR SDK for Ruby
113
+ test_files: []