Skip to content

Commit

Permalink
push docs
Browse files Browse the repository at this point in the history
  • Loading branch information
justanotherbyte committed Jul 10, 2021
1 parent 22c5f36 commit b23292a
Show file tree
Hide file tree
Showing 141 changed files with 33,063 additions and 1 deletion.
2 changes: 2 additions & 0 deletions discord/ext/oauth/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@


class OAuth2Client:
"""A class representing a client interacting with the discord OAuth2 API.
"""
def __init__(
self,
*,
Expand Down
19 changes: 19 additions & 0 deletions discord/ext/oauth/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,32 @@


class Guild:
"""
A class representing a PartialGuild object sent by the OAuth2 API. This is not meant to be manually created.
Attributes
---------
user: User
The user attached to this guild
name: str
The name of the guild
id: int
The id of the guild
icon_url: str
The asset url for the icon of the guild
is_user_owner: bool
Whether or not the user attached to this guild is the owner of the guild
features: List[str]
A list of enabled guild features
"""
def __init__(self, *, data: dict, user: User):
"""A class representing a PartialGuild object sent by the OAuth2 API. This is not meant to be manually created.
:param data: The raw payload returned by the api
:type data: dict
:param user: The user assigned to this guild object
:type user: User
"""
self._data = data

Expand Down
19 changes: 18 additions & 1 deletion discord/ext/oauth/token.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
from datetime import datetime, timedelta

class AccessTokenResponse:
"""
A class representing an Access Token Response sent by the OAuth2 API.
Attributes
---------
token: str
The access token for the authenticated user
token_type: str
The type of access token
expires_in: int
The seconds representation for when the token will expire
refresh_token: str
The refresh token authenticating you to refresh this access token
scope: str
The scope/s this access token gives data for
expires_at: datetime
The datetime representation for when the token will expire
"""
def __init__(self, *, data: dict):
"""A class representing an Access Token Response sent by the OAuth2 API.
Expand All @@ -10,7 +28,6 @@ def __init__(self, *, data: dict):
self._data = data
self.token = self._data.get("access_token")
self.token_type: str = self._data.get("token_type")
self.expires_in = self._data.get("expires_in")
self.refresh_token: str = self._data.get("refresh_token")
self.scope: str = self._data.get("scope")
self.expires_in: int = self._data.get("expires_in")
Expand Down
2 changes: 2 additions & 0 deletions discord/ext/oauth/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@


class User:
"""A class representing a user object, containing information from the OAuth2 API.
"""
def __init__(self, *, http: HTTPClient, data: dict, acr: AccessTokenResponse):
"""A class representing a user object, containing information from the OAuth2 API.
Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Binary file added docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file added docs/_build/doctrees/index.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/modules.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/modules/client.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/modules/guild.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/modules/token.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/modules/user.doctree
Binary file not shown.
Binary file added docs/_build/doctrees/oauth.doctree
Binary file not shown.
4 changes: 4 additions & 0 deletions docs/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 97e49b9436f3bd61cabb616454ad12ed
tags: 645f666f9bcd5a90fca523b33c5a78b7
24 changes: 24 additions & 0 deletions docs/_build/html/_sources/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.. discord-ext-oauth documentation master file, created by
sphinx-quickstart on Sat Jul 10 19:15:14 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to discord-ext-oauth's documentation!
=============================================

.. toctree::
:maxdepth: 2
:caption: Contents:

modules/client.rst
modules/guild.rst
modules/token.rst
modules/user.rst


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
7 changes: 7 additions & 0 deletions docs/_build/html/_sources/modules.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
oauth
=====

.. toctree::
:maxdepth: 4

oauth
7 changes: 7 additions & 0 deletions docs/_build/html/_sources/modules/client.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Client Side Requests
====================

.. currentmodule:: discord.ext.oauth.client

.. autoclass:: OAuth2Client
:members:
7 changes: 7 additions & 0 deletions docs/_build/html/_sources/modules/guild.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Guild Objects
=============

.. currentmodule:: discord.ext.oauth.guild

.. autoclass:: Guild
:members:
7 changes: 7 additions & 0 deletions docs/_build/html/_sources/modules/token.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Token Objects
=============

.. currentmodule:: discord.ext.oauth.token

.. autoclass:: AccessTokenResponse
:members:
7 changes: 7 additions & 0 deletions docs/_build/html/_sources/modules/user.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
User Objects
============

.. currentmodule:: discord.ext.oauth.user

.. autoclass:: User
:members:
61 changes: 61 additions & 0 deletions docs/_build/html/_sources/oauth.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
oauth package
=============

Submodules
----------

oauth.client module
-------------------

.. automodule:: oauth.client
:members:
:undoc-members:
:show-inheritance:

oauth.errors module
-------------------

.. automodule:: oauth.errors
:members:
:undoc-members:
:show-inheritance:

oauth.guild module
------------------

.. automodule:: oauth.guild
:members:
:undoc-members:
:show-inheritance:

oauth.http module
-----------------

.. automodule:: oauth.http
:members:
:undoc-members:
:show-inheritance:

oauth.token module
------------------

.. automodule:: oauth.token
:members:
:undoc-members:
:show-inheritance:

oauth.user module
-----------------

.. automodule:: oauth.user
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: oauth
:members:
:undoc-members:
:show-inheritance:
Empty file.
Loading

0 comments on commit b23292a

Please sign in to comment.