Skip to content

Commit 54a7d72

Browse files
MHPY-10 Add other resources docs
1 parent 8b7911c commit 54a7d72

7 files changed

Lines changed: 225 additions & 13 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ A full list of `Mediahaven-python` project modules.
99
- [Oauth2](docs/mediahaven/oauth2.md#oauth2)
1010
- [Resources](docs/mediahaven/resources/index.md#resources)
1111
- [BaseResource](docs/mediahaven/resources/base_resource.md#baseresource)
12+
- [FieldDefinitions](docs/mediahaven/resources/field_definitions.md#fielddefinitions)
13+
- [Organisations](docs/mediahaven/resources/organisations.md#organisations)
1214
- [Records](docs/mediahaven/resources/records.md#records)

docs/mediahaven/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ MediaHaven
1111

1212
## MediaHaven
1313

14-
[Show source in __init__.py:10](../../mediahaven/__init__.py#L10)
14+
[Show source in __init__.py:12](../../mediahaven/__init__.py#L12)
1515

1616
#### Signature
1717

docs/mediahaven/mediahaven.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Mediahaven
1313

1414
## AcceptFormat
1515

16-
[Show source in mediahaven.py:32](../../mediahaven/mediahaven.py#L32)
16+
[Show source in mediahaven.py:31](../../mediahaven/mediahaven.py#L31)
1717

1818
#### Signature
1919

@@ -26,7 +26,7 @@ class AcceptFormat(Enum):
2626

2727
## MediaHavenClient
2828

29-
[Show source in mediahaven.py:43](../../mediahaven/mediahaven.py#L43)
29+
[Show source in mediahaven.py:42](../../mediahaven/mediahaven.py#L42)
3030

3131
The MediaHaven client class to communicate with MediaHaven.
3232

@@ -46,7 +46,7 @@ class MediaHavenClient:
4646

4747
## MediaHavenException
4848

49-
[Show source in mediahaven.py:26](../../mediahaven/mediahaven.py#L26)
49+
[Show source in mediahaven.py:25](../../mediahaven/mediahaven.py#L25)
5050

5151
#### Signature
5252

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# FieldDefinitions
2+
3+
[Mediahaven-python Index](../../../README.md#mediahaven-python-index) /
4+
[MediaHaven](../index.md#mediahaven) /
5+
[Resources](./index.md#resources) /
6+
FieldDefinitions
7+
8+
> Auto-generated documentation for [mediahaven.resources.field_definitions](../../../mediahaven/resources/field_definitions.py) module.
9+
10+
- [FieldDefinitions](#fielddefinitions)
11+
- [FieldDefinitions](#fielddefinitions-1)
12+
- [FieldDefinitions().get](#fielddefinitions()get)
13+
- [FieldDefinitions().search](#fielddefinitions()search)
14+
15+
## FieldDefinitions
16+
17+
[Show source in field_definitions.py:15](../../../mediahaven/resources/field_definitions.py#L15)
18+
19+
Public API endpoint of MediaHaven field definitions.
20+
21+
#### Signature
22+
23+
```python
24+
class FieldDefinitions(BaseResource):
25+
def __init__(self, *args, **kwargs):
26+
...
27+
```
28+
29+
#### See also
30+
31+
- [BaseResource](./base_resource.md#baseresource)
32+
33+
### FieldDefinitions().get
34+
35+
[Show source in field_definitions.py:22](../../../mediahaven/resources/field_definitions.py#L22)
36+
37+
Get a single field definition.
38+
39+
#### Arguments
40+
41+
- `field` - The id or FlatKey of a metadata field definition.
42+
- `accept_format` - The "Accept" request header.
43+
44+
#### Returns
45+
46+
A single metadata field definition.
47+
48+
#### Signature
49+
50+
```python
51+
def get(
52+
self, field: str = None, accept_format=DEFAULT_ACCEPT_FORMAT
53+
) -> MediaHavenSingleObject:
54+
...
55+
```
56+
57+
#### See also
58+
59+
- [DEFAULT_ACCEPT_FORMAT](../mediahaven.md#default_accept_format)
60+
- [MediaHavenSingleObject](./base_resource.md#mediahavensingleobject)
61+
62+
### FieldDefinitions().search
63+
64+
[Show source in field_definitions.py:41](../../../mediahaven/resources/field_definitions.py#L41)
65+
66+
Search all field definitions.
67+
68+
#### Arguments
69+
70+
- `accept_format` - The "Accept" request header.
71+
- `**query_params` - The optional query paramaters:
72+
- `query_params["startIndex"]` - Used for pagination of search results,
73+
search results will be returned starting from this index.
74+
- `query_params["nrOfResults"]` - the number of results that will be returned.
75+
- `query_params["nested"]` - If true include children and parents in the response,
76+
default is false.
77+
- `query_params["sort"]` - Determine how to sort the field definitions. (FieldDefinitionId or LongTranslation).
78+
79+
#### Returns
80+
81+
A paged result with the metadata field definitions.
82+
83+
#### Signature
84+
85+
```python
86+
def search(
87+
self, accept_format: str = DEFAULT_ACCEPT_FORMAT, **query_params
88+
) -> MediaHavenPageObject:
89+
...
90+
```
91+
92+
#### See also
93+
94+
- [DEFAULT_ACCEPT_FORMAT](../mediahaven.md#default_accept_format)
95+
- [MediaHavenPageObject](./base_resource.md#mediahavenpageobject)

docs/mediahaven/resources/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ Resources
1212
## Modules
1313

1414
- [BaseResource](./base_resource.md)
15+
- [FieldDefinitions](./field_definitions.md)
16+
- [Organisations](./organisations.md)
1517
- [Records](./records.md)
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Organisations
2+
3+
[Mediahaven-python Index](../../../README.md#mediahaven-python-index) /
4+
[MediaHaven](../index.md#mediahaven) /
5+
[Resources](./index.md#resources) /
6+
Organisations
7+
8+
> Auto-generated documentation for [mediahaven.resources.organisations](../../../mediahaven/resources/organisations.py) module.
9+
10+
- [Organisations](#organisations)
11+
- [Organisations](#organisations-1)
12+
- [Organisations().get](#organisations()get)
13+
- [Organisations().search](#organisations()search)
14+
15+
## Organisations
16+
17+
[Show source in organisations.py:15](../../../mediahaven/resources/organisations.py#L15)
18+
19+
Public API endpoint of MediaHaven tenants.
20+
21+
#### Signature
22+
23+
```python
24+
class Organisations(BaseResource):
25+
def __init__(self, *args, **kwargs):
26+
...
27+
```
28+
29+
#### See also
30+
31+
- [BaseResource](./base_resource.md#baseresource)
32+
33+
### Organisations().get
34+
35+
[Show source in organisations.py:22](../../../mediahaven/resources/organisations.py#L22)
36+
37+
Get a single organisation.
38+
39+
#### Arguments
40+
41+
- `organisation_id` - The id of an organisation.
42+
- `accept_format` - The "Accept" request header.
43+
44+
#### Returns
45+
46+
A single organisation.
47+
48+
#### Signature
49+
50+
```python
51+
def get(
52+
self, organisation_id: str, accept_format=DEFAULT_ACCEPT_FORMAT
53+
) -> MediaHavenSingleObject:
54+
...
55+
```
56+
57+
#### See also
58+
59+
- [DEFAULT_ACCEPT_FORMAT](../mediahaven.md#default_accept_format)
60+
- [MediaHavenSingleObject](./base_resource.md#mediahavensingleobject)
61+
62+
### Organisations().search
63+
64+
[Show source in organisations.py:40](../../../mediahaven/resources/organisations.py#L40)
65+
66+
Search all organisations.
67+
68+
#### Arguments
69+
70+
- `query` - The search query.
71+
- `accept_format` - The "Accept" request header.
72+
- `**query_params` - The optional query parameters:
73+
- `query_params["startIndex"]` - Used for pagination of search results,
74+
search results will be returned starting from this index.
75+
- `query_params["nrOfResults"]` - The number of results that will be returned.
76+
77+
#### Returns
78+
79+
A paged result with the organisations.
80+
81+
#### Signature
82+
83+
```python
84+
def search(
85+
self, accept_format: str = DEFAULT_ACCEPT_FORMAT, **query_params
86+
) -> MediaHavenPageObject:
87+
...
88+
```
89+
90+
#### See also
91+
92+
- [DEFAULT_ACCEPT_FORMAT](../mediahaven.md#default_accept_format)
93+
- [MediaHavenPageObject](./base_resource.md#mediahavenpageobject)

docs/mediahaven/resources/records.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ Records
1212
- [Records().count](#records()count)
1313
- [Records().delete](#records()delete)
1414
- [Records().get](#records()get)
15+
- [Records().publish](#records()publish)
1516
- [Records().search](#records()search)
1617
- [Records().update](#records()update)
1718

1819
## Records
1920

20-
[Show source in records.py:14](../../../mediahaven/resources/records.py#L14)
21+
[Show source in records.py:15](../../../mediahaven/resources/records.py#L15)
2122

2223
Public API endpoint of a MediaHaven record.
2324

@@ -35,7 +36,7 @@ class Records(BaseResource):
3536

3637
### Records().count
3738

38-
[Show source in records.py:21](../../../mediahaven/resources/records.py#L21)
39+
[Show source in records.py:22](../../../mediahaven/resources/records.py#L22)
3940

4041
Counts the amount the records given a query string.
4142

@@ -56,7 +57,7 @@ def count(self, query: str) -> int:
5657

5758
### Records().delete
5859

59-
[Show source in records.py:80](../../../mediahaven/resources/records.py#L80)
60+
[Show source in records.py:81](../../../mediahaven/resources/records.py#L81)
6061

6162
Delete a record.
6263

@@ -76,14 +77,14 @@ def delete(self, record_id: str, reason: str = None, event_type: str = None):
7677

7778
### Records().get
7879

79-
[Show source in records.py:35](../../../mediahaven/resources/records.py#L35)
80+
[Show source in records.py:36](../../../mediahaven/resources/records.py#L36)
8081

8182
Get a single record.
8283

8384
#### Arguments
8485

8586
- `record_id` - It can either be a MediaObjectId, FragmentId or RecordId.
86-
- `accept_format` - The "Accept" request header
87+
- `accept_format` - The "Accept" request header.
8788

8889
#### Returns
8990

@@ -103,9 +104,28 @@ def get(
103104
- [DEFAULT_ACCEPT_FORMAT](../mediahaven.md#default_accept_format)
104105
- [MediaHavenSingleObject](./base_resource.md#mediahavensingleobject)
105106

107+
### Records().publish
108+
109+
[Show source in records.py:121](../../../mediahaven/resources/records.py#L121)
110+
111+
Publishes a record.
112+
113+
#### Arguments
114+
115+
- `record_id` - The ID of the record to publish.
116+
It can be either a MediaObjectId, FragmentId or RecordId.
117+
- `reason` - The reason to publish the record.
118+
119+
#### Signature
120+
121+
```python
122+
def publish(self, record_id: str, reason: str = None):
123+
...
124+
```
125+
106126
### Records().search
107127

108-
[Show source in records.py:53](../../../mediahaven/resources/records.py#L53)
128+
[Show source in records.py:54](../../../mediahaven/resources/records.py#L54)
109129

110130
Search for multiple records.
111131

@@ -116,8 +136,8 @@ Search for multiple records.
116136
- `query_params["q"]` - Free text search string.
117137
- `query_params["startIndex"]` - Used for pagination of search results,
118138
search results will be returned starting from this index.
119-
- `query_params["nrOfResults"]` - the number of results that will be returned
120-
- `query_params["publicOnly"]` - if true exclude from the output dynamic
139+
- `query_params["nrOfResults"]` - The number of results that will be returned.
140+
- `query_params["publicOnly"]` - If true exclude from the output dynamic
121141
metadata fields which were marked as non public in the Profiles
122142
linked with the record.
123143

@@ -141,7 +161,7 @@ def search(
141161

142162
### Records().update
143163

144-
[Show source in records.py:102](../../../mediahaven/resources/records.py#L102)
164+
[Show source in records.py:103](../../../mediahaven/resources/records.py#L103)
145165

146166
Update a record.
147167

0 commit comments

Comments
 (0)