Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions mpt_api_client/resources/accounts/account_user_groups.py

This file was deleted.

66 changes: 0 additions & 66 deletions mpt_api_client/resources/accounts/account_users.py

This file was deleted.

14 changes: 0 additions & 14 deletions mpt_api_client/resources/accounts/accounts.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
from mpt_api_client.http import AsyncHTTPClient, HTTPClient
from mpt_api_client.resources.accounts.account import AccountsService, AsyncAccountsService
from mpt_api_client.resources.accounts.account_users import (
AccountUsersService,
AsyncAccountUsersService,
)
from mpt_api_client.resources.accounts.api_tokens import ApiTokensService, AsyncApiTokensService
from mpt_api_client.resources.accounts.buyers import AsyncBuyersService, BuyersService
from mpt_api_client.resources.accounts.cloud_tenants import (
Expand Down Expand Up @@ -72,11 +68,6 @@ def buyers(self) -> BuyersService:
"""Buyers service."""
return BuyersService(http_client=self.http_client)

@property
def account_users(self) -> AccountUsersService:
"""Account Users service."""
return AccountUsersService(http_client=self.http_client)

@property
def erp_links(self) -> ErpLinksService:
"""ERP Links service."""
Expand Down Expand Up @@ -134,11 +125,6 @@ def buyers(self) -> AsyncBuyersService:
"""Buyers service."""
return AsyncBuyersService(http_client=self.http_client)

@property
def account_users(self) -> AsyncAccountUsersService:
"""Account Users service."""
return AsyncAccountUsersService(http_client=self.http_client)

@property
def erp_links(self) -> AsyncErpLinksService:
"""ERP Links service."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class AccountsUserGroup(Model):
class AccountsUserGroupsServiceConfig:
"""Account User Groups Service Configuration."""

_endpoint = "/public/v1/accounts/{account_id}/users/{user_id}/groups"
_endpoint = "/public/v1/accounts/accounts/{account_id}/users/{user_id}/groups"
_model_class = AccountsUserGroup
_collection_key = "data"

Expand Down
2 changes: 1 addition & 1 deletion mpt_api_client/resources/accounts/accounts_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AccountsUser(Model):
class AccountsUsersServiceConfig:
"""Account Users Service Configuration."""

_endpoint = "/public/v1/accounts/{account_id}/users"
_endpoint = "/public/v1/accounts/accounts/{account_id}/users"
_model_class = AccountsUser
_collection_key = "data"

Expand Down
58 changes: 0 additions & 58 deletions tests/unit/resources/accounts/test_account_user_groups.py

This file was deleted.

68 changes: 0 additions & 68 deletions tests/unit/resources/accounts/test_account_users.py

This file was deleted.

6 changes: 0 additions & 6 deletions tests/unit/resources/accounts/test_accounts.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import pytest

from mpt_api_client.resources.accounts.account import AccountsService, AsyncAccountsService
from mpt_api_client.resources.accounts.account_users import (
AccountUsersService,
AsyncAccountUsersService,
)
from mpt_api_client.resources.accounts.accounts import Accounts, AsyncAccounts
from mpt_api_client.resources.accounts.api_tokens import (
ApiTokensService,
Expand Down Expand Up @@ -48,7 +44,6 @@ def async_accounts(async_http_client):
("modules", ModulesService),
("cloud_tenants", CloudTenantsService),
("buyers", BuyersService),
("account_users", AccountUsersService),
("erp_links", ErpLinksService),
],
)
Expand All @@ -71,7 +66,6 @@ def test_accounts_properties(accounts, property_name, expected_service_class):
("modules", AsyncModulesService),
("cloud_tenants", AsyncCloudTenantsService),
("buyers", AsyncBuyersService),
("account_users", AsyncAccountUsersService),
("erp_links", AsyncErpLinksService),
],
)
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/resources/accounts/test_accounts_user_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def async_accounts_user_groups_service(async_http_client):
def test_endpoint(accounts_user_groups_service):
result = (
accounts_user_groups_service.path
== "/public/v1/accounts/ACC-0000-0001/users/USR-0000-0001/groups"
== "/public/v1/accounts/accounts/ACC-0000-0001/users/USR-0000-0001/groups"
)

assert result is True
Expand All @@ -38,7 +38,7 @@ def test_endpoint(accounts_user_groups_service):
def test_async_endpoint(async_accounts_user_groups_service):
result = (
async_accounts_user_groups_service.path
== "/public/v1/accounts/ACC-0000-0001/users/USR-0000-0001/groups"
== "/public/v1/accounts/accounts/ACC-0000-0001/users/USR-0000-0001/groups"
)

assert result is True
Expand Down Expand Up @@ -74,7 +74,7 @@ def test_account_user_groups_update(accounts_user_groups_service): # noqa: AAA0

with respx.mock:
mock_route = respx.put(
f"https://api.example.com/public/v1/accounts/ACC-0000-0001/users/{user_id}/groups"
f"https://api.example.com/public/v1/accounts/accounts/ACC-0000-0001/users/{user_id}/groups"
).mock(
return_value=httpx.Response(
status_code=httpx.codes.OK,
Expand All @@ -101,7 +101,7 @@ async def test_async_account_user_groups_update(async_accounts_user_groups_servi

with respx.mock:
mock_route = respx.put(
f"https://api.example.com/public/v1/accounts/ACC-0000-0001/users/{user_id}/groups"
f"https://api.example.com/public/v1/accounts/accounts/ACC-0000-0001/users/{user_id}/groups"
).mock(
return_value=httpx.Response(
status_code=httpx.codes.OK,
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/resources/accounts/test_accounts_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ def async_accounts_users_service(async_http_client):


def test_endpoint(accounts_users_service):
result = accounts_users_service.path == "/public/v1/accounts/ACC-0000-0001/users"
result = accounts_users_service.path == "/public/v1/accounts/accounts/ACC-0000-0001/users"

assert result is True


def test_async_endpoint(async_accounts_users_service):
result = async_accounts_users_service.path == "/public/v1/accounts/ACC-0000-0001/users"
result = async_accounts_users_service.path == "/public/v1/accounts/accounts/ACC-0000-0001/users"

assert result is True

Expand Down