Browse Source

Remove affiliate_amount

master
SporeStack 3 months ago
parent
commit
972f0b0a61
  1. 4
      CHANGELOG.md
  2. 2
      src/sporestack/api.py
  3. 4
      src/sporestack/api_client.py
  4. 2
      tests/test_api_client.py

4
CHANGELOG.md

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Removed
- affiliate_amount
### Fixed
- Protect files in ~/.sporestack with aggressive `umask`.

2
src/sporestack/api.py

@ -62,7 +62,6 @@ class ServerLaunch:
region: Optional[str]
organization: Optional[str]
settlement_token: Optional[str]
affiliate_amount: Optional[int]
affiliate_token: Optional[str]
class Response(BaseModel):
@ -90,7 +89,6 @@ class ServerTopup:
days: int
currency: str
settlement_token: Optional[str]
affiliate_amount: Optional[int]
affiliate_token: Optional[str]
class Response(BaseModel):

4
src/sporestack/api_client.py

@ -139,7 +139,6 @@ def launch(
region: Optional[str] = None,
token: Optional[str] = None,
retry: bool = False,
affiliate_amount: Optional[int] = None,
affiliate_token: Optional[str] = None,
) -> api.ServerLaunch.Response:
request = api.ServerLaunch.Request(
@ -147,7 +146,6 @@ def launch(
days=days,
currency=currency,
settlement_token=token,
affiliate_amount=affiliate_amount,
affiliate_token=affiliate_token,
flavor=flavor,
region=region,
@ -168,7 +166,6 @@ def topup(
api_endpoint: str = API_ENDPOINT,
token: Optional[str] = None,
retry: bool = False,
affiliate_amount: Optional[int] = None,
affiliate_token: Optional[str] = None,
) -> api.ServerTopup.Response:
"""
@ -179,7 +176,6 @@ def topup(
days=days,
currency=currency,
settlement_token=token,
affiliate_amount=affiliate_amount,
affiliate_token=affiliate_token,
)
url = api_endpoint + api.ServerTopup.url.format(machine_id=machine_id)

2
tests/test_api_client.py

@ -41,7 +41,6 @@ def test_launch(mock_api_request: MagicMock) -> None:
"region": None,
"organization": None,
"settlement_token": None,
"affiliate_amount": None,
"affiliate_token": None,
}
mock_api_request.assert_called_once_with(
@ -60,7 +59,6 @@ def test_topup(mock_api_request: MagicMock) -> None:
"days": 1,
"currency": "xmr",
"settlement_token": None,
"affiliate_amount": None,
"affiliate_token": None,
}
mock_api_request.assert_called_once_with(

Loading…
Cancel
Save