-
Notifications
You must be signed in to change notification settings - Fork 0
MHPY-10 documentation #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lennertvandevelde
wants to merge
13
commits into
main
Choose a base branch
from
mhpy-10-documentation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4af8a58
MHPY-10 Add README file structure
lennertvandevelde 51db825
MHPY-10 formatting
lennertvandevelde 232b591
Add PageObject methods
lennertvandevelde 0851292
MHPY-10 Properties without brackets
lennertvandevelde 01a078a
MHPY-10 Automatic Doc generation
lennertvandevelde a413023
MHPY-10 Change linking between README and files
lennertvandevelde 699ad0f
MHPY-10 Add README file structure
lennertvandevelde 94a4bfd
MHPY-10 formatting
lennertvandevelde 8b7911c
Merge br 'mhpy-10-documentation' into mhpy-10-documentation
lennertvandevelde 54a7d72
MHPY-10 Add other resources docs
lennertvandevelde 3466b60
MHPY-10 change README and docs
lennertvandevelde 2900a21
MHPY-10 REAMDE -> README
lennertvandevelde ea6604e
Update README.md
lennertvandevelde File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # Mediahaven-python Index | ||
|
|
||
| > Auto-generated documentation index. | ||
|
|
||
| A full list of `Mediahaven-python` project modules. | ||
|
|
||
| - [MediaHaven](mediahaven/index.md#mediahaven) | ||
| - [Mediahaven](mediahaven/mediahaven.md#mediahaven) | ||
| - [Oauth2](mediahaven/oauth2.md#oauth2) | ||
| - [Resources](mediahaven/resources/index.md#resources) | ||
| - [BaseResource](mediahaven/resources/base_resource.md#baseresource) | ||
| - [FieldDefinitions](mediahaven/resources/field_definitions.md#fielddefinitions) | ||
| - [Organisations](mediahaven/resources/organisations.md#organisations) | ||
| - [Records](mediahaven/resources/records.md#records) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # MediaHaven | ||
|
|
||
| [Mediahaven-python Index](../README.md#mediahaven-python-index) / | ||
| MediaHaven | ||
|
|
||
| > Auto-generated documentation for [mediahaven](../../mediahaven/__init__.py) module. | ||
|
|
||
| - [MediaHaven](#mediahaven) | ||
| - [MediaHaven](#mediahaven-1) | ||
| - [Modules](#modules) | ||
|
|
||
| ## MediaHaven | ||
|
|
||
| [Show source in __init__.py:12](../../mediahaven/__init__.py#L12) | ||
|
|
||
| #### Signature | ||
|
|
||
| ```python | ||
| class MediaHaven(MediaHavenClient): | ||
| def __init__(self, *args, **kwargs): | ||
| ... | ||
| ``` | ||
|
|
||
| #### See also | ||
|
|
||
| - [MediaHavenClient](./mediahaven.md#mediahavenclient) | ||
|
|
||
|
|
||
|
|
||
| ## Modules | ||
|
|
||
| - [Mediahaven](./mediahaven.md) | ||
| - [Oauth2](./oauth2.md) | ||
| - [Resources](resources/index.md) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| # Mediahaven | ||
|
|
||
| [Mediahaven-python Index](../README.md#mediahaven-python-index) / | ||
| [MediaHaven](./index.md#mediahaven) / | ||
| Mediahaven | ||
|
|
||
| > Auto-generated documentation for [mediahaven.mediahaven](../../mediahaven/mediahaven.py) module. | ||
|
|
||
| - [Mediahaven](#mediahaven) | ||
| - [AcceptFormat](#acceptformat) | ||
| - [MediaHavenClient](#mediahavenclient) | ||
| - [MediaHavenException](#mediahavenexception) | ||
|
|
||
| ## AcceptFormat | ||
|
|
||
| [Show source in mediahaven.py:31](../../mediahaven/mediahaven.py#L31) | ||
|
|
||
| #### Signature | ||
|
|
||
| ```python | ||
| class AcceptFormat(Enum): | ||
| ... | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| ## MediaHavenClient | ||
|
|
||
| [Show source in mediahaven.py:42](../../mediahaven/mediahaven.py#L42) | ||
|
|
||
| The MediaHaven client class to communicate with MediaHaven. | ||
|
|
||
| #### Signature | ||
|
|
||
| ```python | ||
| class MediaHavenClient: | ||
| def __init__(self, mh_base_url: str, grant: OAuth2Grant): | ||
| ... | ||
| ``` | ||
|
|
||
| #### See also | ||
|
|
||
| - [OAuth2Grant](./oauth2.md#oauth2grant) | ||
|
|
||
|
|
||
|
|
||
| ## MediaHavenException | ||
|
|
||
| [Show source in mediahaven.py:25](../../mediahaven/mediahaven.py#L25) | ||
|
|
||
| #### Signature | ||
|
|
||
| ```python | ||
| class MediaHavenException(Exception): | ||
| def __init__(self, message: str, status_code: int = None): | ||
| ... | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,157 @@ | ||
| # Oauth2 | ||
|
|
||
| [Mediahaven-python Index](../README.md#mediahaven-python-index) / | ||
| [MediaHaven](./index.md#mediahaven) / | ||
| Oauth2 | ||
|
|
||
| > Auto-generated documentation for [mediahaven.oauth2](../../mediahaven/oauth2.py) module. | ||
|
|
||
| - [Oauth2](#oauth2) | ||
| - [NoTokenError](#notokenerror) | ||
| - [OAuth2Grant](#oauth2grant) | ||
| - [OAuth2Grant().refresh_token](#oauth2grant()refresh_token) | ||
| - [OAuth2Grant().request_token](#oauth2grant()request_token) | ||
| - [ROPCGrant](#ropcgrant) | ||
| - [ROPCGrant().request_token](#ropcgrant()request_token) | ||
| - [RefreshTokenError](#refreshtokenerror) | ||
| - [RequestTokenError](#requesttokenerror) | ||
|
|
||
| ## NoTokenError | ||
|
|
||
| [Show source in oauth2.py:38](../../mediahaven/oauth2.py#L38) | ||
|
|
||
| Raised when a token has not been requested yet. | ||
|
|
||
| #### Signature | ||
|
|
||
| ```python | ||
| class NoTokenError(Exception): | ||
| def __init__(self): | ||
| ... | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| ## OAuth2Grant | ||
|
|
||
| [Show source in oauth2.py:45](../../mediahaven/oauth2.py#L45) | ||
|
|
||
| Abstract class representing an OAuth2 grant used in MediaHaven. | ||
|
|
||
| #### Signature | ||
|
|
||
| ```python | ||
| class OAuth2Grant(ABC): | ||
| def __init__(self, mh_base_url: str, client_id: str, client_secret: str): | ||
| ... | ||
| ``` | ||
|
|
||
| ### OAuth2Grant().refresh_token | ||
|
|
||
| [Show source in oauth2.py:67](../../mediahaven/oauth2.py#L67) | ||
|
|
||
| Refresh the OAuth2 token with the saved refresh token. | ||
|
|
||
| Issues a new access token but also a new refresh token. | ||
|
|
||
| #### Signature | ||
|
|
||
| ```python | ||
| def refresh_token(self): | ||
| ... | ||
| ``` | ||
|
|
||
| ### OAuth2Grant().request_token | ||
|
|
||
| [Show source in oauth2.py:63](../../mediahaven/oauth2.py#L63) | ||
|
|
||
| #### Signature | ||
|
|
||
| ```python | ||
| @abstractmethod | ||
| def request_token(self): | ||
| ... | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| ## ROPCGrant | ||
|
|
||
| [Show source in oauth2.py:96](../../mediahaven/oauth2.py#L96) | ||
|
|
||
| Represents a "Resource Owner Password Credential" grant. | ||
|
|
||
| #### Signature | ||
|
|
||
| ```python | ||
| class ROPCGrant(OAuth2Grant): | ||
| def __init__(self, mh_base_url: str, client_id: str, client_secret: str): | ||
| ... | ||
| ``` | ||
|
|
||
| #### See also | ||
|
|
||
| - [OAuth2Grant](#oauth2grant) | ||
|
|
||
| ### ROPCGrant().request_token | ||
|
|
||
| [Show source in oauth2.py:104](../../mediahaven/oauth2.py#L104) | ||
|
|
||
| Request an OAuth2 token. | ||
|
|
||
| The resource owner grants the client the authorization to execute the | ||
| requests on its behalf. Given the credentials of the resource owner, an auth | ||
| token is issued by the authorization server. This token will be saved in memory | ||
| and used by the session in order to execute authorized requests. | ||
|
|
||
| #### Arguments | ||
|
|
||
| - `username` - The username of the resource owner. | ||
| - `password` - The password of the resource owner. | ||
|
|
||
| #### Raises | ||
|
|
||
| - `RequestTokenException` - When an error occurred when requesting the token. | ||
|
|
||
| #### Signature | ||
|
|
||
| ```python | ||
| def request_token(self, username: str, password: str): | ||
| ... | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| ## RefreshTokenError | ||
|
|
||
| [Show source in oauth2.py:28](../../mediahaven/oauth2.py#L28) | ||
|
|
||
| Raised when an error occurred during token request. | ||
|
|
||
| Abstracts the underlying OAuthlib2 errors. | ||
|
|
||
| #### Signature | ||
|
|
||
| ```python | ||
| class RefreshTokenError(Exception): | ||
| def __init__(self): | ||
| ... | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| ## RequestTokenError | ||
|
|
||
| [Show source in oauth2.py:18](../../mediahaven/oauth2.py#L18) | ||
|
|
||
| Raised when an error occurred during token request. | ||
|
|
||
| Abstracts the underlying OAuthlib2 errors. | ||
|
|
||
| #### Signature | ||
|
|
||
| ```python | ||
| class RequestTokenError(Exception): | ||
| def __init__(self): | ||
| ... | ||
| ``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.