Skip to content

Commit fc53e8d

Browse files
committed
Docs updates
1 parent 7e0ad35 commit fc53e8d

File tree

18 files changed

+162
-56
lines changed

18 files changed

+162
-56
lines changed

README.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -158,20 +158,10 @@ json = json.loads(response.content)
158158
web_title = json['d']['Title']
159159
print("Web title: {0}".format(web_title))
160160
```
161-
162-
The list of examples:
163-
164-
- Working with files
165-
- [download a file](examples/sharepoint/files/download.py)
166-
- [upload a file](examples/sharepoint/files/upload.py)
167-
168-
- Working with lists and list items
169-
- [create a list item](examples/sharepoint/lists/data_generator.py)
170-
- [read a list item](examples/sharepoint/lists/read_paged.py)
171-
- [update a list item](examples/sharepoint/listitems/update_batch.py)
172-
- [delete a list item](examples/sharepoint/listitems/delete.py)
173161

174-
Refer [examples section](examples/sharepoint) for another scenarios
162+
For SharePoint-specific examples, see:
163+
📌 **[SharePoint examples guide](examples/sharepoint/README.md)**
164+
175165

176166
### Support for Azure environments
177167

examples/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Examples
2+
3+
This directory contains practical examples demonstrating how to use the library.

examples/auth/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Authentication
2+
For the following examples, relevant credentials can be found in the Azure Portal.
3+
4+
Steps to access:
5+
1. Login to the home page of the Azure Portal
6+
2. Navigate to "Azure Active Directory" using the three bars in the top right corner of the portal
7+
3. Select "App registrations" in the navigation panel on the left
8+
4. Search for and select your relevant application
9+
5. In the application's "Overview" page, the client id can be found under "Application (client) id"
10+
6. In the application's "Certificates & Secrets" page, the client secret can be found under the "Value" of the "Client Secrets." If there is no client secret yet, create one here.

examples/communications/create_call.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

examples/informationprotection/create_mail_assessment.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

examples/sharepoint/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# SharePoint Examples
2+
3+
This directory contains examples for SharePoint REST API v1
4+
5+
6+
### [Working with folders and files](./files/)
7+
- **Download** a file: [`download.py`](./files/download.py)
8+
- **Upload** a file: [`upload.py`](./files/upload.py)
9+
- **Create** a folder: [`create.py`](./folders/create.py)
10+
11+
### [Working with lists](./lists/)
12+
- **Create** a list item: [`create_item.py`](./lists/create_item.py)
13+
- **Read** list items (paged): [`read_items.py`](./lists/read_items.py)
14+
15+
### [Working with list items](./listitems/)
16+
- **Update** items in batch: [`update_batch.py`](./listitems/update_batch.py)
17+
- **Delete** an item: [`delete.py`](./listitems/delete.py)
18+
19+
20+
21+
---
22+

office365/sharepoint/customactions/element.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,27 @@
44
class CustomActionElement(ClientValue):
55
"""A class specifies a custom action element."""
66

7-
def __init__(self, clientside_component_id=None):
7+
def __init__(
8+
self,
9+
clientside_component_id=None,
10+
client_side_component_properties=None,
11+
command_ui_extension=None,
12+
enabled_script=None,
13+
host_properties=None,
14+
image_url=None,
15+
):
816
"""
917
:param str clientside_component_id: The unique identifier of the client-side component associated
1018
with the custom action.
19+
:param str client_side_component_properties: This property is only used when a ClientSideComponentId is
20+
specified. It is optional. If non-empty, the string MUST contain a JSON object with custom
21+
initialization properties whose format and meaning are defined by the client-side component.
22+
:param str command_ui_extension: This property is only used when a ClientSideComponentId is specified.
23+
:param str enabled_script: The client side script to enabled or disable the custom action.
1124
"""
1225
self.ClientSideComponentId = clientside_component_id
26+
self.ClientSideComponentProperties = client_side_component_properties
27+
self.CommandUIExtension = command_ui_extension
28+
self.EnabledScript = enabled_script
29+
self.HostProperties = host_properties
30+
self.ImageUrl = image_url
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class CheckinType:
2+
"""Specifies the type of check in for a file."""
3+
4+
MinorCheckIn = 0
5+
"""Incremented as a minor version. Value=0."""
6+
7+
MajorCheckIn = 1
8+
"""Incremented as a major version. Value=1."""
9+
10+
OverwriteCheckIn = 2
11+
"""Overwrite the existing file. Value=2."""
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
from office365.runtime.client_value import ClientValue
2+
from office365.runtime.client_value_collection import ClientValueCollection
3+
from office365.sharepoint.lists.data_validation_failure import ListDataValidationFailure
24

35

46
class ListDataValidationExceptionValue(ClientValue):
57
"""Specifies failure information for a failed field or list item data validation."""
68

7-
pass
9+
def __init__(self, field_failures=None):
10+
self.FieldFailures = ClientValueCollection(
11+
ListDataValidationFailure, field_failures
12+
)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from office365.runtime.client_value import ClientValue
2+
3+
4+
class ListDataValidationFailure(ClientValue):
5+
""" """

0 commit comments

Comments
 (0)