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,39 @@
1
+ module SmartHR::Client::CrewInputFormMethods
2
+ # Get the crew input form
3
+ #
4
+ # @see https://developer.smarthr.jp/api/index.html#!/%E5%BE%93%E6%A5%AD%E5%93%A1%E6%83%85%E5%A0%B1%E5%8F%8E%E9%9B%86%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A0/getV1CrewInputFormsId
5
+ #
6
+ # @param id [String]
7
+ # @param embed_mail_format [Boolean] Whether or not to embed mail format
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_crew_input_form(id:, embed_mail_format: false, &block)
15
+ get("/crew_input_forms/#{id}", embed: embed_mail_format ? 'mail_format' : nil, &block)
16
+ end
17
+
18
+ # Get the list of crew input forms
19
+ #
20
+ # @see https://developer.smarthr.jp/api/index.html#!/%E5%BE%93%E6%A5%AD%E5%93%A1%E6%83%85%E5%A0%B1%E5%8F%8E%E9%9B%86%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A0/getV1CrewInputForms
21
+ #
22
+ # @param page [Integer]
23
+ # @param per_page [Integer]
24
+ # @param embed_mail_format [Boolean] Whether or not to embed mail format
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_crew_input_forms(page: 1, per_page: 10, embed_mail_format: false, &block)
32
+ get("/crew_input_forms",
33
+ page: page,
34
+ per_page: per_page,
35
+ embed: embed_mail_format ? 'mail_format' : nil,
36
+ &block
37
+ )
38
+ end
39
+ end
@@ -0,0 +1,132 @@
1
+ module SmartHR::Client::CrewMethods
2
+ # Invite a crew
3
+ #
4
+ # @see https://developer.smarthr.jp/api/index.html#!/%E5%BE%93%E6%A5%AD%E5%93%A1/putV1CrewsIdInvite
5
+ #
6
+ # @param id [String]
7
+ # @param invite_user_id [String] User ID of invitee
8
+ # @param crew_input_form_id [String]
9
+ #
10
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
11
+ # @yieldparam response_body [Hashie::Mash] response body
12
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
13
+ #
14
+ # @return [Hashie::Mash]
15
+ def invite_crew(id:, invite_user_id:, crew_input_form_id: nil, &block)
16
+ put("/crews/#{id}/invite",
17
+ invite_user_id: invite_user_id,
18
+ crew_input_form_id: crew_input_form_id,
19
+ &block
20
+ )
21
+ end
22
+
23
+ # Delete the crew
24
+ #
25
+ # @see https://developer.smarthr.jp/api/index.html#!/%E5%BE%93%E6%A5%AD%E5%93%A1/deleteV1CrewsId
26
+ #
27
+ # @param id [String]
28
+ #
29
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
30
+ # @yieldparam response_body [Hashie::Mash] response body
31
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
32
+ def destroy_crew(id:, &block)
33
+ delete("/crews/#{id}", &block)
34
+ end
35
+
36
+ # Get the crew
37
+ #
38
+ # @see https://developer.smarthr.jp/api/index.html#!/%E5%BE%93%E6%A5%AD%E5%93%A1/getV1CrewsId
39
+ #
40
+ # @param id [String]
41
+ #
42
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
43
+ # @yieldparam response_body [Hashie::Mash] response body
44
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
45
+ #
46
+ # @return [Hashie::Mash]
47
+ def find_crew(id:, &block)
48
+ get("/crews/#{id}", &block)
49
+ end
50
+
51
+ # Change the data of the specified crew
52
+ #
53
+ # @see https://developer.smarthr.jp/api/index.html#!/%E5%BE%93%E6%A5%AD%E5%93%A1/patchV1CrewsId
54
+ #
55
+ # @param id [String]
56
+ # @param body [Hash]
57
+ #
58
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
59
+ # @yieldparam response_body [Hashie::Mash] response body
60
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
61
+ #
62
+ # @return [Hashie::Mash]
63
+ def update_crew(id:, body:, &block)
64
+ patch("/crews/#{id}", body, &block)
65
+ end
66
+
67
+ # Get the list of crew custom field template groups
68
+ #
69
+ # @see https://developer.smarthr.jp/api/index.html#!/%E5%BE%93%E6%A5%AD%E5%93%A1/getV1Crews
70
+ #
71
+ # @param page [Integer]
72
+ # @param per_page [Integer]
73
+ # @param emp_code [String] Employee code
74
+ # @param emp_type [String] Employee type
75
+ # @param emp_status [String] Employee status
76
+ # @param gender [String] Gender
77
+ # @param sort [String] Sort
78
+ # @param entered_at_from [String] Filter to employees who joined the company after the specified date.
79
+ # @param entered_at_to [String] Filter to employees who joined the company before the specified date.
80
+ # @param q [String] Free word search by name, business name, department name, or job title.
81
+ # @param fields [Array] Name list of the item to get.
82
+ #
83
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
84
+ # @yieldparam response_body [Array<Hashie::Mash>] response body
85
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
86
+ #
87
+ # @return [Array<Hashie::Mash>]
88
+ def get_crews(page: 1, per_page: 10, emp_code: nil, emp_type: nil, emp_status: nil, gender: nil, sort: nil, entered_at_from: nil, entered_at_to: nil, q: nil, fields: [], &block)
89
+ get("/crews",
90
+ page: page,
91
+ per_page: per_page,
92
+ emp_code: emp_code,
93
+ emp_type: emp_type,
94
+ emp_status: emp_status,
95
+ gender: gender,
96
+ sort: sort,
97
+ entered_at_from: entered_at_from,
98
+ entered_at_to: entered_at_to,
99
+ q: q,
100
+ fields: fields.join(','),
101
+ &block
102
+ )
103
+ end
104
+
105
+ # Create a new crew
106
+ #
107
+ # @see https://developer.smarthr.jp/api/index.html#!/%E5%BE%93%E6%A5%AD%E5%93%A1/postV1Crews
108
+ #
109
+ # @param body [Hash]
110
+ #
111
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
112
+ # @yieldparam response_body [Hashie::Mash] response body
113
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
114
+ #
115
+ # @return [Hashie::Mash]
116
+ def create_crew(body:, &block)
117
+ post("/crews", body, &block)
118
+ end
119
+
120
+ # Delete the crew departments
121
+ #
122
+ # @see https://developer.smarthr.jp/api/index.html#!/%E5%BE%93%E6%A5%AD%E5%93%A1/deleteV1CrewsCrewIdDepartments
123
+ #
124
+ # @param crew_id [String]
125
+ #
126
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
127
+ # @yieldparam response_body [Hashie::Mash] response body
128
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
129
+ def destroy_crew_departments(crew_id:, &block)
130
+ delete("/crews/#{crew_id}/departments", &block)
131
+ end
132
+ end
@@ -0,0 +1,84 @@
1
+ module SmartHR::Client::DepartmentMethods
2
+ # Delete the department
3
+ #
4
+ # @see https://developer.smarthr.jp/api/index.html#!/%E9%83%A8%E7%BD%B2/deleteV1DepartmentsId
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_department(id:, &block)
12
+ delete("/departments/#{id}", &block)
13
+ end
14
+
15
+ # Get the department
16
+ #
17
+ # @see https://developer.smarthr.jp/api/index.html#!/%E9%83%A8%E7%BD%B2/getV1DepartmentsId
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_department(id:, &block)
27
+ get("/departments/#{id}", &block)
28
+ end
29
+
30
+ # Change the data of the specified department
31
+ #
32
+ # @see https://developer.smarthr.jp/api/index.html#!/%E9%83%A8%E7%BD%B2/patchV1DepartmentsId
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_department(id:, body:, &block)
43
+ patch("/departments/#{id}", body, &block)
44
+ end
45
+
46
+ # Get the list of departments
47
+ #
48
+ # @see https://developer.smarthr.jp/api/index.html#!/%E9%83%A8%E7%BD%B2/getV1Departments
49
+ #
50
+ # @param page [Integer]
51
+ # @param per_page [Integer]
52
+ # @param code [String]
53
+ # @param sort [String]
54
+ #
55
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
56
+ # @yieldparam response_body [Array<Hashie::Mash>] response body
57
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
58
+ #
59
+ # @return [Array<Hashie::Mash>]
60
+ def get_departments(page: 1, per_page: 10, code: nil, sort: nil, &block)
61
+ get("/departments",
62
+ page: page,
63
+ per_page: per_page,
64
+ code: code,
65
+ sort: sort,
66
+ &block
67
+ )
68
+ end
69
+
70
+ # Create a new department
71
+ #
72
+ # @see https://developer.smarthr.jp/api/index.html#!/%E9%83%A8%E7%BD%B2/postV1Departments
73
+ #
74
+ # @param body [Hash]
75
+ #
76
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
77
+ # @yieldparam response_body [Hashie::Mash] response body
78
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
79
+ #
80
+ # @return [Hashie::Mash]
81
+ def create_department(body:, &block)
82
+ post("/departments", body, &block)
83
+ end
84
+ end
@@ -0,0 +1,85 @@
1
+ module SmartHR::Client::DependentMethods
2
+ # Delete the crew dependent
3
+ #
4
+ # @see https://developer.smarthr.jp/api/index.html#!/%E5%AE%B6%E6%97%8F%E6%83%85%E5%A0%B1/deleteV1CrewsCrewIdDependentsId
5
+ #
6
+ # @param crew_id [String]
7
+ # @param id [String]
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
+ def destroy_crew_dependent(crew_id:, id:, &block)
13
+ delete("/crews/#{crew_id}/dependents/#{id}", &block)
14
+ end
15
+
16
+ # Get the crew dependent
17
+ #
18
+ # @see https://developer.smarthr.jp/api/index.html#!/%E5%AE%B6%E6%97%8F%E6%83%85%E5%A0%B1/getV1CrewsCrewIdDependentsId
19
+ #
20
+ # @param crew_id [String]
21
+ # @param id [String]
22
+ #
23
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
24
+ # @yieldparam response_body [Hashie::Mash] response body
25
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
26
+ #
27
+ # @return [Hashie::Mash]
28
+ def find_crew_dependent(crew_id:, id:, &block)
29
+ get("/crews/#{crew_id}/dependents/#{id}", &block)
30
+ end
31
+
32
+ # Change the data of the specified crew dependent
33
+ #
34
+ # @see https://developer.smarthr.jp/api/index.html#!/%E5%AE%B6%E6%97%8F%E6%83%85%E5%A0%B1/patchV1CrewsCrewIdDependentsId
35
+ #
36
+ # @param crew_id [String]
37
+ # @param id [String]
38
+ # @param body [Hash]
39
+ #
40
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
41
+ # @yieldparam response_body [Hashie::Mash] response body
42
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
43
+ #
44
+ # @return [Hashie::Mash]
45
+ def update_crew_dependent(crew_id:, id:, body:, &block)
46
+ patch("/crews/#{crew_id}/dependents/#{id}", body, &block)
47
+ end
48
+
49
+ # Get the list of crew dependents
50
+ #
51
+ # @see https://developer.smarthr.jp/api/index.html#!/%E5%AE%B6%E6%97%8F%E6%83%85%E5%A0%B1/getV1CrewsCrewIdDependents
52
+ #
53
+ # @param crew_id [String]
54
+ # @param page [Integer]
55
+ # @param per_page [Integer]
56
+ #
57
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
58
+ # @yieldparam response_body [Array<Hashie::Mash>] response body
59
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
60
+ #
61
+ # @return [Array<Hashie::Mash>]
62
+ def get_crew_dependents(crew_id:, page: 1, per_page: 10, &block)
63
+ get("/crews/#{crew_id}/dependents",
64
+ page: page,
65
+ per_page: per_page,
66
+ &block
67
+ )
68
+ end
69
+
70
+ # Create a new crew dependent
71
+ #
72
+ # @see https://developer.smarthr.jp/api/index.html#!/%E5%AE%B6%E6%97%8F%E6%83%85%E5%A0%B1/postV1CrewsCrewIdDependents
73
+ #
74
+ # @param crew_id [String]
75
+ # @param body [Hash]
76
+ #
77
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
78
+ # @yieldparam response_body [Hashie::Mash] response body
79
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
80
+ #
81
+ # @return [Hashie::Mash]
82
+ def create_crew_dependent(crew_id:, body:, &block)
83
+ post("/crews/#{crew_id}/dependents", body, &block)
84
+ end
85
+ end
@@ -0,0 +1,23 @@
1
+ module SmartHR::Client::DependentRelationMethods
2
+ # Get the list of dependent relations
3
+ #
4
+ # @see https://developer.smarthr.jp/api/index.html#!/%E7%B6%9A%E6%9F%84/getV1DependentRelations
5
+ #
6
+ # @param page [Integer]
7
+ # @param per_page [Integer]
8
+ # @param filter_spouse [Boolean] Whether or not to filter spouse
9
+ #
10
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
11
+ # @yieldparam response_body [Array<Hashie::Mash>] response body
12
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)
13
+ #
14
+ # @return [Array<Hashie::Mash>]
15
+ def get_dependent_relations(page: 1, per_page: 10, filter_spouse: false, &block)
16
+ get("/dependent_relations",
17
+ page: page,
18
+ per_page: per_page,
19
+ filter: filter_spouse ? 'spouse' : nil,
20
+ &block
21
+ )
22
+ end
23
+ end
@@ -0,0 +1,80 @@
1
+ module SmartHR::Client::EmploymentTypeMethods
2
+ # Delete the crew custom field template group
3
+ #
4
+ # @see https://developer.smarthr.jp/api/index.html#!/%E9%9B%87%E7%94%A8%E5%BD%A2%E6%85%8B/deleteV1EmploymentTypesId
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_employment_type(id:, &block)
12
+ delete("/employment_types/#{id}", &block)
13
+ end
14
+
15
+ # Get the employment type
16
+ #
17
+ # @see https://developer.smarthr.jp/api/index.html#!/%E9%9B%87%E7%94%A8%E5%BD%A2%E6%85%8B/getV1EmploymentTypesId
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_employment_type(id:, &block)
27
+ get("/employment_types/#{id}", &block)
28
+ end
29
+
30
+ # Change the data of the specified group
31
+ #
32
+ # @see https://developer.smarthr.jp/api/index.html#!/%E9%9B%87%E7%94%A8%E5%BD%A2%E6%85%8B/patchV1EmploymentTypesId
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_employment_type(id:, body:, &block)
43
+ patch("/employment_types/#{id}", body, &block)
44
+ end
45
+
46
+ # Get the list of employment types
47
+ #
48
+ # @see https://developer.smarthr.jp/api/index.html#!/%E9%9B%87%E7%94%A8%E5%BD%A2%E6%85%8B/getV1EmploymentTypes
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_employment_types(page: 1, per_page: 10, &block)
59
+ get("/employment_types",
60
+ page: page,
61
+ per_page: per_page,
62
+ &block
63
+ )
64
+ end
65
+
66
+ # Create a new employment type
67
+ #
68
+ # @see https://developer.smarthr.jp/api/index.html#!/%E9%9B%87%E7%94%A8%E5%BD%A2%E6%85%8B/postV1EmploymentTypes
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_employment_type(body:, &block)
78
+ post("/employment_types", body, &block)
79
+ end
80
+ end