Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Commits
d29d3063
Verified
Commit
d29d3063
authored
10 months ago
by
Karel van Klink
Browse files
Options
Downloads
Patches
Plain Diff
update add_list_item return type for sharepoint service
parent
06b92eb2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!211
Feature/add sharepoint service
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/services/sharepoint.py
+9
-3
9 additions, 3 deletions
gso/services/sharepoint.py
with
9 additions
and
3 deletions
gso/services/sharepoint.py
+
9
−
3
View file @
d29d3063
...
...
@@ -46,14 +46,20 @@ class SPClient:
.
items
.
get
(
request_configuration
=
request_configuration
)
)
async
def
add_list_item
(
self
,
list_name
:
str
,
fields
:
dict
[
str
,
str
]):
async
def
add_list_item
(
self
,
list_name
:
str
,
fields
:
dict
[
str
,
str
])
->
str
:
"""
Add a new entry to a SharePoint list.
:param str list_name: The name of the list.
:param dict[str, str] fields: Any pre-filled fields in the list item. Can be left empty.
:return str: The URL of the list in which a new item has been created.
"""
request_body
=
ListItem
(
fields
=
FieldValueSet
(
additional_data
=
fields
))
return
(
new_item
=
(
await
self
.
client
.
sites
.
by_site_id
(
self
.
site_id
)
.
lists
.
by_list_id
(
self
.
list_ids
[
list_name
]).
items
.
post
(
request_body
)
.
lists
.
by_list_id
(
self
.
list_ids
[
list_name
])
.
items
.
post
(
request_body
)
)
# Strip the last part of the URL, since we want the link to the list, not the list item.
return
new_item
.
web_url
.
rsplit
(
"
/
"
,
1
)[
0
]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment