Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Setra Client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
it-bott-integrasjoner
Setra Client
Merge requests
!7
OM46, del 1: Support batch_complete endpoint from setra
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
OM46, del 1: Support batch_complete endpoint from setra
om46
into
master
Overview
8
Commits
11
Pipelines
11
Changes
8
Merged
Petr.Kalashnikov
requested to merge
om46
into
master
4 years ago
Overview
8
Commits
11
Pipelines
11
Changes
8
Expand
0
0
Merge request reports
Compare
master
version 10
06c626ad
4 years ago
version 9
3cfed2fc
4 years ago
version 8
8a129e1e
4 years ago
version 7
fa3efdd0
4 years ago
version 6
30c30ffb
4 years ago
version 5
223dfedd
4 years ago
version 4
29d6402c
4 years ago
version 3
41bebbab
4 years ago
version 2
c68d9c82
4 years ago
version 1
8e7249b9
4 years ago
master (base)
and
version 2
latest version
e5c17d17
11 commits,
4 years ago
version 10
06c626ad
10 commits,
4 years ago
version 9
3cfed2fc
9 commits,
4 years ago
version 8
8a129e1e
8 commits,
4 years ago
version 7
fa3efdd0
7 commits,
4 years ago
version 6
30c30ffb
6 commits,
4 years ago
version 5
223dfedd
5 commits,
4 years ago
version 4
29d6402c
4 commits,
4 years ago
version 3
41bebbab
3 commits,
4 years ago
version 2
c68d9c82
2 commits,
4 years ago
version 1
8e7249b9
1 commit,
4 years ago
8 files
+
156
−
7
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
8
Search (e.g. *.vue) (Ctrl+P)
setra_client/client.py
+
25
−
1
Options
@@ -37,13 +37,15 @@ class SetraEndpoints:
batch_url
=
'
api/batch/
'
,
transaction_url
=
'
api/transaction/
'
,
voucher_url
=
'
api/voucher/
'
,
new_batch_url
=
'
api/addtrans/
'
new_batch_url
=
'
api/addtrans/
'
,
batch_complete_url
=
'
api/batch_complete/
'
):
self
.
baseurl
=
url
self
.
batch_url
=
batch_url
self
.
transaction_url
=
transaction_url
self
.
voucher_url
=
voucher_url
self
.
new_batch_url
=
new_batch_url
self
.
batch_complete_url
=
batch_complete_url
"""
Get endpoints relative to the SETRA API URL.
"""
@@ -86,6 +88,16 @@ class SetraEndpoints:
def
post_new_batch
(
self
):
return
urllib
.
parse
.
urljoin
(
self
.
baseurl
,
self
.
new_batch_url
)
def
batch_complete
(
self
,
batch_id
:
str
=
None
):
"""
URL for Batch endpoint
"""
if
batch_id
is
None
:
return
urllib
.
parse
.
urljoin
(
self
.
baseurl
,
self
.
batch_complete_url
)
else
:
return
urllib
.
parse
.
urljoin
(
self
.
baseurl
,
'
/
'
.
join
((
self
.
batch_complete_url
,
batch_id
)))
class
SetraClient
(
object
):
default_headers
=
{
@@ -209,6 +221,18 @@ class SetraClient(object):
return_response
=
return_response
)
return
response
def
get_batch_complete
(
self
,
batch_id
:
int
=
None
):
"""
GETs one or all batches from SETRA
"""
if
batch_id
is
not
None
:
batch_id
=
str
(
batch_id
)
url
=
self
.
urls
.
batch_complete
(
batch_id
)
response
=
self
.
get
(
url
)
return
response
.
json
()
def
get_client
(
config_dict
):
"""
Loading