flexops 1.0.1 → 1.0.2

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.
@@ -1,40 +1,40 @@
1
- # ***********************************************************************
2
- # Package : flexops
3
- # Author : FlexOps, LLC
4
- # Created : 2026-03-08
5
- #
6
- # Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
7
- # ***********************************************************************
8
-
9
- module FlexOps
10
- module Resources
11
- class Pickups
12
- def initialize(http, ws_id_proc)
13
- @http = http
14
- @ws_id = ws_id_proc
15
- end
16
-
17
- def schedule(request)
18
- @http.post("#{ws_path}/pickups", body: request)
19
- end
20
-
21
- def list
22
- @http.get("#{ws_path}/pickups")
23
- end
24
-
25
- def get(pickup_id)
26
- @http.get("#{ws_path}/pickups/#{pickup_id}")
27
- end
28
-
29
- def cancel(pickup_id)
30
- @http.delete("#{ws_path}/pickups/#{pickup_id}")
31
- end
32
-
33
- private
34
-
35
- def ws_path
36
- "/api/workspaces/#{@ws_id.call}"
37
- end
38
- end
39
- end
40
- end
1
+ # ***********************************************************************
2
+ # Package : flexops
3
+ # Author : FlexOps, LLC
4
+ # Created : 2026-03-08
5
+ #
6
+ # Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
7
+ # ***********************************************************************
8
+
9
+ module FlexOps
10
+ module Resources
11
+ class Pickups
12
+ def initialize(http, ws_id_proc)
13
+ @http = http
14
+ @ws_id = ws_id_proc
15
+ end
16
+
17
+ def schedule(request)
18
+ @http.post("#{ws_path}/pickups", body: request)
19
+ end
20
+
21
+ def list
22
+ @http.get("#{ws_path}/pickups")
23
+ end
24
+
25
+ def get(pickup_id)
26
+ @http.get("#{ws_path}/pickups/#{pickup_id}")
27
+ end
28
+
29
+ def cancel(pickup_id)
30
+ @http.delete("#{ws_path}/pickups/#{pickup_id}")
31
+ end
32
+
33
+ private
34
+
35
+ def ws_path
36
+ "/api/workspaces/#{@ws_id.call}"
37
+ end
38
+ end
39
+ end
40
+ end
@@ -1,61 +1,61 @@
1
- # ***********************************************************************
2
- # Package : flexops
3
- # Author : FlexOps, LLC
4
- # Created : 2026-03-08
5
- #
6
- # Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
7
- # ***********************************************************************
8
-
9
- module FlexOps
10
- module Resources
11
- class Returns
12
- def initialize(http, ws_id_proc)
13
- @http = http
14
- @ws_id = ws_id_proc
15
- end
16
-
17
- def list(page: nil, page_size: nil, status: nil)
18
- query = { page: page, pageSize: page_size, status: status }.compact
19
- @http.get("#{ws_path}/returns", query: query.empty? ? nil : query)
20
- end
21
-
22
- def get(return_id)
23
- @http.get("#{ws_path}/returns/#{return_id}")
24
- end
25
-
26
- def create(request)
27
- @http.post("#{ws_path}/returns", body: request)
28
- end
29
-
30
- def approve(return_id)
31
- @http.post("#{ws_path}/returns/#{return_id}/approve")
32
- end
33
-
34
- def reject(return_id, reason)
35
- @http.post("#{ws_path}/returns/#{return_id}/reject", body: { reason: reason })
36
- end
37
-
38
- def cancel(return_id)
39
- @http.post("#{ws_path}/returns/#{return_id}/cancel")
40
- end
41
-
42
- def generate_label(return_id)
43
- @http.post("#{ws_path}/returns/#{return_id}/label")
44
- end
45
-
46
- def mark_received(return_id, items)
47
- @http.post("#{ws_path}/returns/#{return_id}/receive", body: { items: items })
48
- end
49
-
50
- def process_refund(return_id)
51
- @http.post("#{ws_path}/returns/#{return_id}/refund")
52
- end
53
-
54
- private
55
-
56
- def ws_path
57
- "/api/workspaces/#{@ws_id.call}"
58
- end
59
- end
60
- end
61
- end
1
+ # ***********************************************************************
2
+ # Package : flexops
3
+ # Author : FlexOps, LLC
4
+ # Created : 2026-03-08
5
+ #
6
+ # Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
7
+ # ***********************************************************************
8
+
9
+ module FlexOps
10
+ module Resources
11
+ class Returns
12
+ def initialize(http, ws_id_proc)
13
+ @http = http
14
+ @ws_id = ws_id_proc
15
+ end
16
+
17
+ def list(page: nil, page_size: nil, status: nil)
18
+ query = { page: page, pageSize: page_size, status: status }.compact
19
+ @http.get("#{ws_path}/returns", query: query.empty? ? nil : query)
20
+ end
21
+
22
+ def get(return_id)
23
+ @http.get("#{ws_path}/returns/#{return_id}")
24
+ end
25
+
26
+ def create(request)
27
+ @http.post("#{ws_path}/returns", body: request)
28
+ end
29
+
30
+ def approve(return_id)
31
+ @http.post("#{ws_path}/returns/#{return_id}/approve")
32
+ end
33
+
34
+ def reject(return_id, reason)
35
+ @http.post("#{ws_path}/returns/#{return_id}/reject", body: { reason: reason })
36
+ end
37
+
38
+ def cancel(return_id)
39
+ @http.post("#{ws_path}/returns/#{return_id}/cancel")
40
+ end
41
+
42
+ def generate_label(return_id)
43
+ @http.post("#{ws_path}/returns/#{return_id}/label")
44
+ end
45
+
46
+ def mark_received(return_id, items)
47
+ @http.post("#{ws_path}/returns/#{return_id}/receive", body: { items: items })
48
+ end
49
+
50
+ def process_refund(return_id)
51
+ @http.post("#{ws_path}/returns/#{return_id}/refund")
52
+ end
53
+
54
+ private
55
+
56
+ def ws_path
57
+ "/api/workspaces/#{@ws_id.call}"
58
+ end
59
+ end
60
+ end
61
+ end
@@ -1,48 +1,48 @@
1
- # ***********************************************************************
2
- # Package : flexops
3
- # Author : FlexOps, LLC
4
- # Created : 2026-03-08
5
- #
6
- # Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
7
- # ***********************************************************************
8
-
9
- module FlexOps
10
- module Resources
11
- class Rules
12
- def initialize(http, ws_id_proc)
13
- @http = http
14
- @ws_id = ws_id_proc
15
- end
16
-
17
- def list
18
- @http.get("#{ws_path}/shipping-rules")
19
- end
20
-
21
- def get(rule_id)
22
- @http.get("#{ws_path}/shipping-rules/#{rule_id}")
23
- end
24
-
25
- def create(rule)
26
- @http.post("#{ws_path}/shipping-rules", body: rule)
27
- end
28
-
29
- def update(rule_id, rule)
30
- @http.put("#{ws_path}/shipping-rules/#{rule_id}", body: rule)
31
- end
32
-
33
- def delete(rule_id)
34
- @http.delete("#{ws_path}/shipping-rules/#{rule_id}")
35
- end
36
-
37
- def reorder(rule_ids)
38
- @http.put("#{ws_path}/shipping-rules/reorder", body: rule_ids)
39
- end
40
-
41
- private
42
-
43
- def ws_path
44
- "/api/workspaces/#{@ws_id.call}"
45
- end
46
- end
47
- end
48
- end
1
+ # ***********************************************************************
2
+ # Package : flexops
3
+ # Author : FlexOps, LLC
4
+ # Created : 2026-03-08
5
+ #
6
+ # Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
7
+ # ***********************************************************************
8
+
9
+ module FlexOps
10
+ module Resources
11
+ class Rules
12
+ def initialize(http, ws_id_proc)
13
+ @http = http
14
+ @ws_id = ws_id_proc
15
+ end
16
+
17
+ def list
18
+ @http.get("#{ws_path}/shipping-rules")
19
+ end
20
+
21
+ def get(rule_id)
22
+ @http.get("#{ws_path}/shipping-rules/#{rule_id}")
23
+ end
24
+
25
+ def create(rule)
26
+ @http.post("#{ws_path}/shipping-rules", body: rule)
27
+ end
28
+
29
+ def update(rule_id, rule)
30
+ @http.put("#{ws_path}/shipping-rules/#{rule_id}", body: rule)
31
+ end
32
+
33
+ def delete(rule_id)
34
+ @http.delete("#{ws_path}/shipping-rules/#{rule_id}")
35
+ end
36
+
37
+ def reorder(rule_ids)
38
+ @http.put("#{ws_path}/shipping-rules/reorder", body: rule_ids)
39
+ end
40
+
41
+ private
42
+
43
+ def ws_path
44
+ "/api/workspaces/#{@ws_id.call}"
45
+ end
46
+ end
47
+ end
48
+ end
@@ -1,36 +1,36 @@
1
- # ***********************************************************************
2
- # Package : flexops
3
- # Author : FlexOps, LLC
4
- # Created : 2026-03-08
5
- #
6
- # Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
7
- # ***********************************************************************
8
-
9
- module FlexOps
10
- module Resources
11
- class ScanForms
12
- def initialize(http, ws_id_proc)
13
- @http = http
14
- @ws_id = ws_id_proc
15
- end
16
-
17
- def create(request)
18
- @http.post("#{ws_path}/scan-forms", body: request)
19
- end
20
-
21
- def list
22
- @http.get("#{ws_path}/scan-forms")
23
- end
24
-
25
- def get(scan_form_id)
26
- @http.get("#{ws_path}/scan-forms/#{scan_form_id}")
27
- end
28
-
29
- private
30
-
31
- def ws_path
32
- "/api/workspaces/#{@ws_id.call}"
33
- end
34
- end
35
- end
36
- end
1
+ # ***********************************************************************
2
+ # Package : flexops
3
+ # Author : FlexOps, LLC
4
+ # Created : 2026-03-08
5
+ #
6
+ # Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
7
+ # ***********************************************************************
8
+
9
+ module FlexOps
10
+ module Resources
11
+ class ScanForms
12
+ def initialize(http, ws_id_proc)
13
+ @http = http
14
+ @ws_id = ws_id_proc
15
+ end
16
+
17
+ def create(request)
18
+ @http.post("#{ws_path}/scan-forms", body: request)
19
+ end
20
+
21
+ def list
22
+ @http.get("#{ws_path}/scan-forms")
23
+ end
24
+
25
+ def get(scan_form_id)
26
+ @http.get("#{ws_path}/scan-forms/#{scan_form_id}")
27
+ end
28
+
29
+ private
30
+
31
+ def ws_path
32
+ "/api/workspaces/#{@ws_id.call}"
33
+ end
34
+ end
35
+ end
36
+ end
@@ -1,84 +1,84 @@
1
- # ***********************************************************************
2
- # Package : flexops
3
- # Author : FlexOps, LLC
4
- # Created : 2026-03-08
5
- #
6
- # Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
7
- # ***********************************************************************
8
-
9
- module FlexOps
10
- module Resources
11
- class Shipping
12
- def initialize(http, ws_id_proc)
13
- @http = http
14
- @ws_id = ws_id_proc
15
- end
16
-
17
- def get_rates(request)
18
- @http.post("#{ws_path}/shipping/rates", body: request)
19
- end
20
-
21
- def get_cheapest_rate(request)
22
- @http.post("#{ws_path}/shipping/rates/cheapest", body: request)
23
- end
24
-
25
- def get_fastest_rate(request)
26
- @http.post("#{ws_path}/shipping/rates/fastest", body: request)
27
- end
28
-
29
- def create_label(request)
30
- @http.post("#{ws_path}/shipping/labels", body: request)
31
- end
32
-
33
- def cancel_label(label_id)
34
- @http.delete("#{ws_path}/shipping/labels/#{label_id}")
35
- end
36
-
37
- def track(tracking_number)
38
- @http.get("#{ws_path}/shipping/track/#{tracking_number}")
39
- end
40
-
41
- def validate_address(address)
42
- @http.post("#{ws_path}/shipping/addresses/validate", body: address)
43
- end
44
-
45
- def create_batch(request)
46
- @http.post("#{ws_path}/labels/batch", body: request)
47
- end
48
-
49
- def preview_batch(request)
50
- @http.post("#{ws_path}/labels/batch/preview", body: request)
51
- end
52
-
53
- def get_batch_status(job_id)
54
- @http.get("#{ws_path}/labels/batch/#{job_id}")
55
- end
56
-
57
- def download_batch_label(job_id, item_id)
58
- @http.get("#{ws_path}/labels/batch/#{job_id}/items/#{item_id}/label")
59
- end
60
-
61
- def get_carriers
62
- @http.get("#{ws_path}/shipping/carriers")
63
- end
64
-
65
- def get_recommendations(request)
66
- @http.post("#{ws_path}/shipping/recommendations", body: request)
67
- end
68
-
69
- def predict_delivery(request)
70
- @http.post("#{ws_path}/shipping/predictions/delivery", body: request)
71
- end
72
-
73
- def get_savings
74
- @http.get("#{ws_path}/shipping/savings")
75
- end
76
-
77
- private
78
-
79
- def ws_path
80
- "/api/workspaces/#{@ws_id.call}"
81
- end
82
- end
83
- end
84
- end
1
+ # ***********************************************************************
2
+ # Package : flexops
3
+ # Author : FlexOps, LLC
4
+ # Created : 2026-03-08
5
+ #
6
+ # Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
7
+ # ***********************************************************************
8
+
9
+ module FlexOps
10
+ module Resources
11
+ class Shipping
12
+ def initialize(http, ws_id_proc)
13
+ @http = http
14
+ @ws_id = ws_id_proc
15
+ end
16
+
17
+ def get_rates(request)
18
+ @http.post("/api/shipping/rates", body: request)
19
+ end
20
+
21
+ def get_cheapest_rate(request)
22
+ @http.post("/api/shipping/rates/cheapest", body: request)
23
+ end
24
+
25
+ def get_fastest_rate(request)
26
+ @http.post("/api/shipping/rates/fastest", body: request)
27
+ end
28
+
29
+ def create_label(request)
30
+ @http.post("#{ws_path}/shipping/labels", body: request)
31
+ end
32
+
33
+ def cancel_label(label_id)
34
+ @http.delete("#{ws_path}/shipping/labels/#{label_id}")
35
+ end
36
+
37
+ def track(tracking_number)
38
+ @http.get("#{ws_path}/shipping/track/#{tracking_number}")
39
+ end
40
+
41
+ def validate_address(address)
42
+ @http.post("#{ws_path}/shipping/addresses/validate", body: address)
43
+ end
44
+
45
+ def create_batch(request)
46
+ @http.post("#{ws_path}/labels/batch", body: request)
47
+ end
48
+
49
+ def preview_batch(request)
50
+ @http.post("#{ws_path}/labels/batch/preview", body: request)
51
+ end
52
+
53
+ def get_batch_status(job_id)
54
+ @http.get("#{ws_path}/labels/batch/#{job_id}")
55
+ end
56
+
57
+ def download_batch_label(job_id, item_id)
58
+ @http.get("#{ws_path}/labels/batch/#{job_id}/items/#{item_id}/label")
59
+ end
60
+
61
+ def get_carriers
62
+ @http.get("#{ws_path}/shipping/carriers")
63
+ end
64
+
65
+ def get_recommendations(request)
66
+ @http.post("#{ws_path}/shipping/recommendations", body: request)
67
+ end
68
+
69
+ def predict_delivery(request)
70
+ @http.post("#{ws_path}/shipping/predictions/delivery", body: request)
71
+ end
72
+
73
+ def get_savings
74
+ @http.get("#{ws_path}/shipping/savings")
75
+ end
76
+
77
+ private
78
+
79
+ def ws_path
80
+ "/api/workspaces/#{@ws_id.call}"
81
+ end
82
+ end
83
+ end
84
+ end
@@ -1,41 +1,41 @@
1
- # ***********************************************************************
2
- # Package : flexops
3
- # Author : FlexOps, LLC
4
- # Created : 2026-03-08
5
- #
6
- # Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
7
- # ***********************************************************************
8
-
9
- module FlexOps
10
- module Resources
11
- class Wallet
12
- def initialize(http, ws_id_proc)
13
- @http = http
14
- @ws_id = ws_id_proc
15
- end
16
-
17
- def get_balance
18
- @http.get("#{ws_path}/wallet/balance")
19
- end
20
-
21
- def add_funds(amount)
22
- @http.post("#{ws_path}/wallet/add-funds", body: { amount: amount })
23
- end
24
-
25
- def list_transactions(page: nil, page_size: nil, start_date: nil, end_date: nil)
26
- query = { page: page, pageSize: page_size, startDate: start_date, endDate: end_date }.compact
27
- @http.get("#{ws_path}/wallet/transactions", query: query.empty? ? nil : query)
28
- end
29
-
30
- def configure_auto_reload(enabled:, threshold: nil, amount: nil)
31
- @http.put("#{ws_path}/wallet/auto-reload", body: { enabled: enabled, threshold: threshold, amount: amount }.compact)
32
- end
33
-
34
- private
35
-
36
- def ws_path
37
- "/api/workspaces/#{@ws_id.call}"
38
- end
39
- end
40
- end
41
- end
1
+ # ***********************************************************************
2
+ # Package : flexops
3
+ # Author : FlexOps, LLC
4
+ # Created : 2026-03-08
5
+ #
6
+ # Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
7
+ # ***********************************************************************
8
+
9
+ module FlexOps
10
+ module Resources
11
+ class Wallet
12
+ def initialize(http, ws_id_proc)
13
+ @http = http
14
+ @ws_id = ws_id_proc
15
+ end
16
+
17
+ def get_balance
18
+ @http.get("#{ws_path}/wallet/balance")
19
+ end
20
+
21
+ def add_funds(amount)
22
+ @http.post("#{ws_path}/wallet/add-funds", body: { amount: amount })
23
+ end
24
+
25
+ def list_transactions(page: nil, page_size: nil, start_date: nil, end_date: nil)
26
+ query = { page: page, pageSize: page_size, startDate: start_date, endDate: end_date }.compact
27
+ @http.get("#{ws_path}/wallet/transactions", query: query.empty? ? nil : query)
28
+ end
29
+
30
+ def configure_auto_reload(enabled:, threshold: nil, amount: nil)
31
+ @http.put("#{ws_path}/wallet/auto-reload", body: { enabled: enabled, threshold: threshold, amount: amount }.compact)
32
+ end
33
+
34
+ private
35
+
36
+ def ws_path
37
+ "/api/workspaces/#{@ws_id.call}"
38
+ end
39
+ end
40
+ end
41
+ end