Skip to content

Commit

Permalink
0.2.11 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
nxtlo committed Feb 5, 2024
1 parent 7a2cb87 commit f7895d4
Show file tree
Hide file tree
Showing 30 changed files with 45,101 additions and 43,497 deletions.
5 changes: 2 additions & 3 deletions aiobungie/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,6 @@ async def fetch_application(self, appid: int, /) -> application.Application:

# Milestones

@helpers.unstable
async def fetch_public_milestone_content(
self, milestone_hash: int, /
) -> milestones.MilestoneContent:
Expand All @@ -1260,5 +1259,5 @@ async def fetch_public_milestone_content(
A milestone content object.
"""
...
# _resp = await self.rest.fetch_public_milestone_content(milestone_hash)
# return self.factory.deserialize_public_milestone_content(resp)
resp = await self.rest.fetch_public_milestone_content(milestone_hash)
return self.factory.deserialize_public_milestone_content(resp)
10 changes: 10 additions & 0 deletions aiobungie/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,16 @@ def __str__(self) -> str:
async def panic(response: aiohttp.ClientResponse) -> HTTPError:
"""Immediately raise an exception based on the response."""

# Bungie get funky and return HTML instead of JSON when making an authorized
# request with a dummy access token. We could technically read the page content
# but that's Bungie's fault for not returning a JSON response.
if response.content_type != "application/json":
raise HTTPError(
message=f"Expected JSON response, Got {response.content_type}, "
f"{response.real_url.human_repr()}",
http_status=http.HTTPStatus(response.status),
)

body: collections.Mapping[str, typing.Any] = helpers.loads(await response.read()) # type: ignore
message: str = body.get("Message", "UNDEFINED_MESSAGE")
error_status: str = body.get("ErrorStatus", "UNDEFINED_ERROR_STATUS")
Expand Down
3 changes: 0 additions & 3 deletions aiobungie/interfaces/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
import abc
import typing

from aiobungie.internal import helpers

if typing.TYPE_CHECKING:
import collections.abc as collections

Expand Down Expand Up @@ -872,7 +870,6 @@ def deserialize_post_activity_player(
# Milestones.

@abc.abstractmethod
@helpers.unstable
def deserialize_public_milestone_content(
self, payload: typedefs.JSONObject
) -> milestones.MilestoneContent:
Expand Down
2 changes: 1 addition & 1 deletion aiobungie/interfaces/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,6 @@ async def fetch_public_milestones(self) -> typedefs.JSONObject:
"""

@abc.abstractmethod
@helpers.unstable
async def fetch_public_milestone_content(
self, milestone_hash: int, /
) -> typedefs.JSONObject:
Expand Down Expand Up @@ -1773,6 +1772,7 @@ async def insert_socket_plug_free(
"""

@abc.abstractmethod
@helpers.unstable
async def set_item_lock_state(
self,
access_token: str,
Expand Down
2 changes: 0 additions & 2 deletions aiobungie/internal/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
from aiobungie.crates import user
from aiobungie.internal import assets
from aiobungie.internal import enums
from aiobungie.internal import helpers
from aiobungie.internal import iterators
from aiobungie.internal import time

Expand Down Expand Up @@ -1996,7 +1995,6 @@ def deserialize_clan_banners(
banner_obj = ()
return banner_obj

@helpers.unstable
def deserialize_public_milestone_content(
self, payload: typedefs.JSONObject
) -> milestones.MilestoneContent:
Expand Down
2 changes: 1 addition & 1 deletion aiobungie/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

import typing

__version__: typing.Final[str] = "0.2.10"
__version__: typing.Final[str] = "0.2.11"
__about__: typing.Final[
str
] = "A statically typed, asynchronous API wrapper for building clients for Bungie's API in Python."
Expand Down
5 changes: 4 additions & 1 deletion aiobungie/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ class RESTClient(interfaces.RESTInterface):
"_client_id",
"_metadata",
"_dumps",
"_print",
"_loads",
)

Expand All @@ -385,6 +386,7 @@ def __init__(
self._max_retries = max_retries
self._dumps = dumps
self._loads = loads
self._print = False
self._metadata: collections.MutableMapping[typing.Any, typing.Any] = {}
self.with_debug(debug)

Expand Down Expand Up @@ -1013,6 +1015,7 @@ async def insert_socket_plug_free(
assert isinstance(resp, dict)
return resp

@helpers.unstable
async def set_item_lock_state(
self,
access_token: str,
Expand All @@ -1022,6 +1025,7 @@ async def set_item_lock_state(
character_id: int,
membership_type: enums.MembershipType | int,
) -> int:
self._print = True
body = {
"state": state,
"itemId": item_id,
Expand Down Expand Up @@ -1169,7 +1173,6 @@ async def fetch_public_milestones(self) -> typedefs.JSONObject:
assert isinstance(resp, dict)
return resp

@helpers.unstable
async def fetch_public_milestone_content(
self, milestone_hash: int, /
) -> typedefs.JSONObject:
Expand Down
24,348 changes: 12,202 additions & 12,146 deletions docs/aiobungie.html

Large diffs are not rendered by default.

525 changes: 272 additions & 253 deletions docs/aiobungie/builders.html

Large diffs are not rendered by default.

6,846 changes: 3,443 additions & 3,403 deletions docs/aiobungie/client.html

Large diffs are not rendered by default.

10,415 changes: 5,586 additions & 4,829 deletions docs/aiobungie/crates.html

Large diffs are not rendered by default.

1,506 changes: 764 additions & 742 deletions docs/aiobungie/error.html

Large diffs are not rendered by default.

12,051 changes: 6,027 additions & 6,024 deletions docs/aiobungie/interfaces.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/aiobungie/internal.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="pdoc 14.1.0"/>
<meta name="generator" content="pdoc 14.4.0"/>
<title>aiobungie.internal API documentation</title>

<style>/*! * Bootstrap Reboot v5.0.0 (https://getbootstrap.com/) * Copyright 2011-2021 The Bootstrap Authors * Copyright 2011-2021 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) */*,::after,::before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;background-color:#fff;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}hr{margin:1rem 0;color:inherit;background-color:currentColor;border:0;opacity:.25}hr:not([size]){height:1px}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2}h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width:1200px){h1{font-size:2.5rem}}h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){h2{font-size:2rem}}h3{font-size:calc(1.3rem + .6vw)}@media (min-width:1200px){h3{font-size:1.75rem}}h4{font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){h4{font-size:1.5rem}}h5{font-size:1.25rem}h6{font-size:1rem}p{margin-top:0;margin-bottom:1rem}abbr[data-bs-original-title],abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-left:2rem}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:.875em}mark{padding:.2em;background-color:#fcf8e3}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#0d6efd;text-decoration:underline}a:hover{color:#0a58ca}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em;direction:ltr;unicode-bidi:bidi-override}pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:.875em}pre code{font-size:inherit;color:inherit;word-break:normal}code{font-size:.875em;color:#d63384;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:.875em;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:1em;font-weight:700}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:#6c757d;text-align:left}th{text-align:inherit;text-align:-webkit-match-parent}tbody,td,tfoot,th,thead,tr{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]::-webkit-calendar-picker-indicator{display:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:left;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + .3vw);line-height:inherit}@media (min-width:1200px){legend{font-size:1.5rem}}legend+*{clear:left}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:textfield}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none!important}</style>
Expand Down
2 changes: 1 addition & 1 deletion docs/aiobungie/internal/_backoff.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="pdoc 14.1.0"/>
<meta name="generator" content="pdoc 14.4.0"/>
<title>aiobungie.internal._backoff API documentation</title>

<style>/*! * Bootstrap Reboot v5.0.0 (https://getbootstrap.com/) * Copyright 2011-2021 The Bootstrap Authors * Copyright 2011-2021 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) */*,::after,::before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;background-color:#fff;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}hr{margin:1rem 0;color:inherit;background-color:currentColor;border:0;opacity:.25}hr:not([size]){height:1px}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2}h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width:1200px){h1{font-size:2.5rem}}h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){h2{font-size:2rem}}h3{font-size:calc(1.3rem + .6vw)}@media (min-width:1200px){h3{font-size:1.75rem}}h4{font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){h4{font-size:1.5rem}}h5{font-size:1.25rem}h6{font-size:1rem}p{margin-top:0;margin-bottom:1rem}abbr[data-bs-original-title],abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-left:2rem}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:.875em}mark{padding:.2em;background-color:#fcf8e3}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#0d6efd;text-decoration:underline}a:hover{color:#0a58ca}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em;direction:ltr;unicode-bidi:bidi-override}pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:.875em}pre code{font-size:inherit;color:inherit;word-break:normal}code{font-size:.875em;color:#d63384;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:.875em;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:1em;font-weight:700}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:#6c757d;text-align:left}th{text-align:inherit;text-align:-webkit-match-parent}tbody,td,tfoot,th,thead,tr{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]::-webkit-calendar-picker-indicator{display:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:left;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + .3vw);line-height:inherit}@media (min-width:1200px){legend{font-size:1.5rem}}legend+*{clear:left}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:textfield}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none!important}</style>
Expand Down
Loading

0 comments on commit f7895d4

Please sign in to comment.