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
06b92eb2
Verified
Commit
06b92eb2
authored
10 months ago
by
Karel van Klink
Browse files
Options
Downloads
Patches
Plain Diff
Update settings, fix attribute error in sharepoint client
parent
d730565e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!211
Feature/add sharepoint service
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gso/services/sharepoint.py
+4
-7
4 additions, 7 deletions
gso/services/sharepoint.py
gso/settings.py
+5
-7
5 additions, 7 deletions
gso/settings.py
with
9 additions
and
14 deletions
gso/services/sharepoint.py
+
4
−
7
View file @
06b92eb2
...
...
@@ -5,8 +5,8 @@ from msgraph import GraphServiceClient
from
msgraph.generated.models.field_value_set
import
FieldValueSet
from
msgraph.generated.models.list_item
import
ListItem
from
msgraph.generated.models.list_item_collection_response
import
ListItemCollectionResponse
from
msgraph.generated.models.site
import
Site
from
msgraph.generated.sites.item.lists.item.items.items_request_builder
import
ItemsRequestBuilder
from
products
import
Site
from
gso.settings
import
load_oss_params
...
...
@@ -36,15 +36,13 @@ class SPClient:
:param str list_name: The name of the list.
"""
query_params
=
ItemsRequestBuilder
.
ItemsRequestBuilderGetQueryParameters
(
expand
=
[
"
fields($select=Title,LinkTitle,CHECK_LIST_STATE,VERIFY_LIBRENMS)
"
],
)
query_params
=
ItemsRequestBuilder
.
ItemsRequestBuilderGetQueryParameters
(
expand
=
[
"
fields
"
])
request_configuration
=
ItemsRequestBuilder
.
ItemsRequestBuilderGetRequestConfiguration
(
query_parameters
=
query_params
)
return
(
await
self
.
client
.
sites
.
by_site_id
(
self
.
site_id
)
.
lists
.
by_list_id
(
getattr
(
self
.
list_ids
,
list_name
)
)
.
lists
.
by_list_id
(
self
.
list_ids
[
list_name
]
)
.
items
.
get
(
request_configuration
=
request_configuration
)
)
...
...
@@ -57,6 +55,5 @@ class SPClient:
request_body
=
ListItem
(
fields
=
FieldValueSet
(
additional_data
=
fields
))
return
(
await
self
.
client
.
sites
.
by_site_id
(
self
.
site_id
)
.
lists
.
by_list_id
(
getattr
(
self
.
list_ids
,
list_name
))
.
items
.
post
(
request_body
)
.
lists
.
by_list_id
(
self
.
list_ids
[
list_name
]).
items
.
post
(
request_body
)
)
This diff is collapsed.
Click to expand it.
gso/settings.py
+
5
−
7
View file @
06b92eb2
...
...
@@ -11,8 +11,9 @@ import os
from
pathlib
import
Path
from
typing
import
Annotated
from
pydantic
import
BaseSettings
,
Field
,
HttpUrl
from
pydantic
import
Field
,
HttpUrl
from
pydantic_forms.types
import
UUIDstr
from
pydantic_settings
import
BaseSettings
from
typing_extensions
import
Doc
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -154,8 +155,8 @@ class EmailParams(BaseSettings):
smtp_host
:
str
smtp_port
:
int
starttls_enabled
:
bool
smtp_username
:
str
|
None
smtp_password
:
str
|
None
smtp_username
:
str
|
None
=
None
smtp_password
:
str
|
None
=
None
class
SharepointParams
(
BaseSettings
):
...
...
@@ -167,10 +168,7 @@ class SharepointParams(BaseSettings):
certificate_password
:
str
site_id
:
UUIDstr
list_ids
:
dict
[
str
,
UUIDstr
]
scopes
:
list
[
HttpUrl
]
#: .. deprecated :: 1.7
#: Not used anymore, since this can be inferred from SharePoint :term:`API` responses.
checklist_site_url
:
HttpUrl
|
None
scopes
:
list
[
str
]
class
OSSParams
(
BaseSettings
):
...
...
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