{"id":29572661,"url":"https://github.com/accelbyte/accelbyte-python-sdk","last_synced_at":"2025-07-19T05:10:46.959Z","repository":{"id":41425154,"uuid":"410735805","full_name":"AccelByte/accelbyte-python-sdk","owner":"AccelByte","description":"Python Extend SDK generated from AccelByte Gaming Services OpenAPI specification","archived":false,"fork":false,"pushed_at":"2025-07-04T23:55:19.000Z","size":108476,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-05T00:34:53.440Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AccelByte.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-27T04:00:10.000Z","updated_at":"2025-07-04T23:55:24.000Z","dependencies_parsed_at":"2024-04-16T03:39:48.737Z","dependency_job_id":"6deb94e9-0d4a-4112-9523-bae616dfacaf","html_url":"https://github.com/AccelByte/accelbyte-python-sdk","commit_stats":null,"previous_names":[],"tags_count":84,"template":false,"template_full_name":null,"purl":"pkg:github/AccelByte/accelbyte-python-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccelByte%2Faccelbyte-python-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccelByte%2Faccelbyte-python-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccelByte%2Faccelbyte-python-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccelByte%2Faccelbyte-python-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AccelByte","download_url":"https://codeload.github.com/AccelByte/accelbyte-python-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccelByte%2Faccelbyte-python-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265892500,"owners_count":23845031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-19T05:10:46.457Z","updated_at":"2025-07-19T05:10:46.946Z","avatar_url":"https://github.com/AccelByte.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AccelByte Python SDK\n\nA software development kit (SDK) for interacting with AccelByte services written in Python.\n\nThis SDK was generated from OpenAPI specification documents included in the [spec](spec) directory.\n\n## Setup\n\nThis SDK requires Python 3.9 to be installed.\n\n### Install with Pip\n\nInstall dependencies.\n\n```sh\npip install requests httpx websockets PyYAML PyJWT[crypto] mmh3 bitarray\n```\n\nInstall from PyPI\n\n```sh\npip install accelbyte-py-sdk\n```\n\nor install from source.\n\n```sh\npip install git+https://github.com/AccelByte/accelbyte-python-sdk.git@{VERSION}#egg=accelbyte_py_sdk\n```\n\nReplace `{VERSION}` with a specific release version tag. When starting a new project, \nusing the latest release version is recommended. For the list of available versions, see [releases](https://github.com/AccelByte/accelbyte-python-sdk/releases). \n\n**Special note only for Windows environment**\n\nIf you encounter error `path too long` when attempting to install the SDK. The steps to solve this are:\n\n1. [Enable long paths in registry.](https://docs.python.org/3/using/windows.html#removing-the-max-path-limitation)\n\n2. Enable long paths in git.\n\n   ```\n   git config --global core.longpaths true\n   ```\n\n3. Restart the powershell window you used to take effect.\n\n4. Try installing SDK again.\n\n   ```\n   pip install git+https://github.com/AccelByte/accelbyte-python-sdk.git@{VERSION}#egg=accelbyte_py_sdk\n   ```\n\n### Environment Variables\n\nThe following environment variables need to be set when using `EnvironmentConfigRepository` (default).\n\n| Name             | Required                                                                               | Example                          |\n|------------------|----------------------------------------------------------------------------------------|----------------------------------|\n| AB_BASE_URL      | Yes                                                                                    | https://test.accelbyte.io        |\n| AB_CLIENT_ID     | Yes                                                                                    | abcdef0123456789abcdef0123456789 |\n| AB_CLIENT_SECRET | Yes, only if you use a private `AB_CLIENT_ID`                                          | ab#c,d)ef(ab#c,d)ef(ab#c,d)ef(ab |\n| AB_NAMESPACE     | Yes, the SDK will automatically fill up the `{namespace}` path parameter (overridable) | accelbyte                        |\n| AB_APP_NAME      | No, the SDK will automatically fill up the `User-Agent` header (overridable)           | MyApp                            |\n| AB_APP_VERSION   | No, the SDK will automatically fill up the `User-Agent` header (overridable)           | 1.0.0                            |\n\n\n## Usage\n\n### Initializing\n\nYou'll have to initialize the SDK using the `initialize()` function.\n\n```python\nimport accelbyte_py_sdk\n\n\nif __name__ == \"__main__\":\n    accelbyte_py_sdk.initialize()\n    # uses EnvironmentConfigRepository by default\n    #   which in turn uses '$AB_BASE_URL', '$AB_CLIENT_ID', '$AB_CLIENT_SECRET', '$AB_NAMESPACE'\n```\n\nYou could also pass in options like so:\n\n```python\nfrom os import environ\nimport accelbyte_py_sdk\nfrom accelbyte_py_sdk.core import MyConfigRepository\n\n\nif __name__ == \"__main__\":\n    base_url = environ[\"MY_BASE_URL\"]\n    client_id = environ[\"MY_CLIENT_ID\"]\n    client_secret = environ[\"MY_CLIENT_SECRET\"]\n    namespace = environ[\"MY_NAMESPACE\"]\n    app_name = environ[\"MY_APP_NAME\"]\n    app_version = environ[\"MY_APP_VERSION\"]\n\n    my_config_repository = MyConfigRepository(\n        base_url=base_url,\n        client_id=client_id,\n        client_secret=client_secret,\n        namespace=namespace,\n        app_name=app_name,\n        app_version=app_version\n    )\n    options = {\n        \"config\": my_config_repository\n    }\n\n    accelbyte_py_sdk.initialize(options)\n    # you could still set some of these options after initializing.\n    # ex. accelbyte_py_sdk.core.set_config_repository(my_config_repository)\n\n```\n\n### Logging In and Logging Out\n\n#### Login using Username and Password\n\n```python\nfrom os import environ\n\nimport accelbyte_py_sdk\nfrom accelbyte_py_sdk.services.auth import login_user, logout\n\n\nif __name__ == \"__main__\":\n    accelbyte_py_sdk.initialize()\n\n    username = environ[\"AB_USERNAME\"]\n    password = environ[\"AB_PASSWORD\"]\n\n    token, error = login_user(username, password)\n    assert error is None\n\n    _, error = logout()\n    assert error is None\n\n```\n\nHere `login_user(username, password)` and `logout()` are wrapper functions.\n\nYou can also specify the scope you want for `login_user(...)`. With the `scope` parameter typed as `Optional[Union[str, List[str]]]`. By default the scope used is `commerce account social publishing analytics` (a space seprated value string).\n\n```python\nlogin_user(username, password, scope=\"scopeA\")\n# login_user(username, password, scope=\"scopeA scopeB\")  # space separated values\n# login_user(username, password, scope=[\"scopeA\", \"scopeB\"])\n```\n\n#### Login using OAuth Client (Public or Confidential)\n\n```python\nfrom os import environ\nimport accelbyte_py_sdk\nfrom accelbyte_py_sdk.services.auth import login_client\n\n\nif __name__ == \"__main__\":\n    accelbyte_py_sdk.initialize()\n\n    client_id = environ[\"AB_CLIENT_ID\"]\n    client_secret = environ[\"AB_CLIENT_SECRET\"]\n\n    token, error = login_client(client_id, client_secret)\n    # passing '$AB_CLIENT_ID' and '$AB_CLIENT_SECRET' is same as:\n    # token, error = login_client()\n    assert error is not None\n\n```\n\n:bulb: The use of a Public OAuth Client is highly discouraged for this use case. Please ensure that you both set the Client ID and Client Secret.\n\n#### Refreshing Tokens\n\n:bulb: Using `login_x(..., auto_refresh=True)` automatically refreshes the token once the expiration draws near.\n\n```python\n# set the refresh rate for 'login_client'\n# 0.8 means refresh when we 80% of the expiration duration has passed\nres, err = login_client(client_id, client_secret, auto_refresh=True, refresh_rate=0.8)\n```\n```python\n# set the refresh rate for 'login_user'\n# 0.8 means refresh when we 80% of the expiration duration has passed\nres, err = login_user(username, password, auto_refresh=True, refresh_rate=0.8)\n```\n\nThe auto refresh is only triggered when another request is fired. If you want to the refresh run automatically in the background. Use any of the `LoginXTimer` classes.\n\n```python\nfrom accelbyte_py_sdk.services.auth import LoginClientTimer, LoginPlatformTimer, LoginUserTimer, RefreshLoginTimer\n\nres, err = login_user(username, password)\nif err is not None:\n    exit(1)\n\n# creates a threading.Timer-like object that calls login_user every 1800 seconds repeatedly 'inf' times\ninterval = 1800\ntimer = LoginUserTimer(\n    interval,\n    username=username,\n    password=password,\n    repeats=-1,  # \u003c0: repeat 'inf' times | 0 or None: repeat 0 times | \u003e0: repeat n times \n    autostart=True,\n)\n```\n\nTo manually refresh the token:\n\n```python\nfrom accelbyte_py_sdk.core import get_token_repository\nfrom accelbyte_py_sdk.services.auth import refresh_login\n\ntoken_repo = get_token_repository()\nrefresh_token = token_repo.get_refresh_token()\n\ntoken, error = refresh_login(refresh_token)\nassert error is None\n```\n\nTo use on-demand token refresh, enable the `refresh_if_possible` option by setting it to True.\nThis configuration involves checking for the presence of an existing token, verifying its expiration status.\nIf the token has expired, the SDK will then examine whether a refresh token exists.\nIf a refresh token is available, it will be utilized to obtain a new token.\n\n```python\nres, error = login_user(username, password, refresh_if_possible=True)\n```\n\n## Using multiple SDK instances\n\nThe examples above demonstrates using just one instance of the Python SDK (the default which is also global), but you could also instantiate multiple instances of the SDK and use them at the same time.\n\n```python\nimport accelbyte_py_sdk.services.auth as auth_service\nimport accelbyte_py_sdk.api.iam as iam_service\nimport accelbyte_py_sdk.api.iam.models as iam_models\n\nfrom accelbyte_py_sdk import AccelByteSDK\nfrom accelbyte_py_sdk.core import EnvironmentConfigRepository\nfrom accelbyte_py_sdk.core import InMemoryTokenRepository\n\n\n# Create 3 instances of the SDK\nclient_sdk = AccelByteSDK()\nuser_sdk1 = AccelByteSDK()\nuser_sdk2 = AccelByteSDK()\n\n\n# Initialize the SDKs\nclient_sdk.initialize(\n    options={\n        \"config\": EnvironmentConfigRepository(),\n        \"token\": InMemoryTokenRepository(),\n    }\n)\n\nuser_sdk1.initialize(\n    options={\n        \"config\": EnvironmentConfigRepository(),\n        \"token\": InMemoryTokenRepository(),\n    }\n)\n\nuser_sdk2.initialize(\n    options={\n        \"config\": user_sdk1.get_config_repository(),  # you could also share the config repo with User 1 SDK's\n        \"token\": InMemoryTokenRepository(),  # you could also do the same thing with token repos but that is not advisable. \n    }\n)\n\n\n# Login the SDKs\n_, error = auth_service.login_client(sdk=client_sdk)\n\nusername1, password1 = ...\n_, error = auth_service.login_user(username1, password1, sdk=user_sdk1)\n\nusername2, password2 = ...\n_, error = auth_service.login_user(username2, password2, sdk=user_sdk2)\n\n\n# Call an endpoint as User 1\nresult1, error = iam_service.public_create_user_v4(\n    body=iam_models.AccountCreateUserRequestV4.create_from_dict({...}),\n    sdk=user_sdk1,\n)\n\n# Call an endpoint as User 2\nresult2, error = iam_service.public_create_user_v4(\n    body=iam_models.AccountCreateUserRequestV4.create_from_dict({...}),\n    sdk=user_sdk2,\n)\n\n# Call an endpoint as the Admin IAM Client\nresult, error = admin_update_user_v4(\n    body=iam_models.ModelUserUpdateRequestV3.create_from_dict({...}),\n    user_id=result1.user_id,\n    sdk=client_sdk,\n)\n\n\n# Reset/Deintialize the SDKs after using\nclient_sdk1.deintialize()\nclient_sdk1.deintialize()\nclient_sdk1.deintialize()\n```\n\n### CLI\n\nYou can also use the Python Extend SDK to get tokens.\n\n```shell\npython -m accelbyte_py_sdk login -h\n```\n\n```text\nusage: python -m accelbyte_py_sdk login [-h] [-b BASE_URL] [-n NAMESPACE] [-c CLIENT_ID] [-s CLIENT_SECRET] [-u USERNAME] [-p PASSWORD] {client,user}\n\npositional arguments:\n  {client,user}\n\noptions:\n  -h, --help            show this help message and exit\n  -b BASE_URL, --base-url BASE_URL\n  -n NAMESPACE, --namespace NAMESPACE\n  -c CLIENT_ID, --client-id CLIENT_ID\n  -s CLIENT_SECRET, --client-secret CLIENT_SECRET\n  -u USERNAME, --username USERNAME\n  -p PASSWORD, --password PASSWORD\n```\n\n---\n\n```shell\npython -m accelbyte_py_sdk login client -b 'https://\u003cenvironment\u003e.accelbyte.io' -c **** -s ****  | jq -r .access_token\n```\n\n```text\neyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiQWNjZWwgSm9lIn0.VOnZ863KSLHhgJfupKzuKZq4ACcefUlcQwi1YvxdBlw\n```\n\n---\n\n```shell\nAB_BASE_URL='https://\u003cenvironment\u003e.accelbyte.io' AB_CLIENT_ID=**** AB_CLIENT_SECRET=**** python -m accelbyte_py_sdk login user -u **** -p ****  | jq -r .access_token\n```\n\n```text\neyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiQWNjZWwgSm9lIn0.VOnZ863KSLHhgJfupKzuKZq4ACcefUlcQwi1YvxdBlw\n```\n\n## Interacting with a Service Endpoint\n\n### Example A\n\nIn this example we will create a new user using the `POST` endpoint `/iam/v3/public/namespaces/{namespace}/users`\n\n```python\nimport json\n\nimport accelbyte_py_sdk\nfrom accelbyte_py_sdk.services.auth import login_client\n\n# Import the wrapper 'public_create_user_v3'\n# to know which wrapper to use open the docs/\u003cservice-name\u003e-index.md and\n# use the search function to find the wrapper name\nfrom accelbyte_py_sdk.api.iam import public_create_user_v3\n\n# This POST endpoint also requires a body of 'ModelUserCreateRequestV3'\n# so you will need to import that too, import it using this scheme:\n#  from accelbyte_py_sdk.api.\u003cservice-name\u003e.models import \u003cmodel-name\u003e\nfrom accelbyte_py_sdk.api.iam.models import ModelUserCreateRequestV3\nfrom accelbyte_py_sdk.api.iam.models import ModelUserCreateResponseV3\n\n\ndef main():\n    # 1 Initialize the SDK\n    accelbyte_py_sdk.initialize()\n\n    # 2 Login as a client (uses $AB_CLIENT_ID and $AB_CLIENT_SECRET)\n    _, error = login_client()\n\n    # 3 Create a user using the POST endpoint: /iam/v3/public/namespaces/{namespace}/users\n    #   * this endpoint requires:\n    #     - a 'body' (ModelUserCreateRequestV3)\n    #     - a 'namespace' (string)\n    #       'namespace' here is unique because it can be omitted, omitting it will result in\n    #       the SDK to automatically fill it out with the value of '$AB_NAMESPACE'\n    #   * more details on this endpoint can be found in:\n    #     accelbyte_py_sdk/api/iam/operations/users/public_create_user_v3.py\n    result, error = public_create_user_v3(\n        body=ModelUserCreateRequestV3.create(\n            auth_type=\"EMAILPASSWD\",\n            country=\"US\",\n            date_of_birth=\"2001-01-01\",\n            display_name=\"************\",\n            email_address=\"******@fakemail.com\",\n            password=\"******************\",\n        )\n    )\n\n    # 4 Check for errors\n    if error:\n      exit(1)\n\n    # 5 Do something with the result\n    print(json.dumps(result.to_dict(), indent=2))\n    # {\n    #   \"authType\": \"EMAILPASSWD\",\n    #   \"country\": \"US\",\n    #   \"dateOfBirth\": \"2001-01-01T00:00:00Z\",\n    #   \"displayName\": \"************\",\n    #   \"emailAddress\": \"******@fakemail.com\",\n    #   \"namespace\": \"******\",\n    #   \"userId\": \"********************************\"\n    # }\n\n\nif __name__ == \"__main__\":\n    main()\n\n```\n\n:bulb: All wrapper functions follow the return value format of `result, error`.\n\n:bulb: You could also write your own wrapper functions by using the models and operations in `accelbyte_py_sdk.api.\u003cservice-name\u003e` and `accelbyte_py_sdk.api.\u003cservice-name\u003e.models` respectively.\n\n:bulb: All wrapper functions have an asynchronous counterpart that ends with `_async`.\n\n### Example A (`async`)\n\nTo convert `Example A` asynchronously the following steps are needed.\n\n1. Import the asyncio package.\n\n    ```python\n    import asyncio\n    ```\n\n2. Convert the main method into `async`.\n\n    ```python\n    # def main():\n    async def main():\n    ```\n\n3. Change how the `main` function is invoked.\n\n    ```python\n    if __name__ == \"__main__\":\n        # main()\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(main())\n    ```\n\n4. Use `HttpxHttpClient`.\n\n    ```python\n    # accelbyte_py_sdk.initialize()\n    accelbyte_py_sdk.initialize(options={\"http\": \"HttpxHttpClient\"})\n    ```\n\n5. Use the `async` version of the wrapper by appending `_async`.\n\n    ```python\n    # from accelbyte_py_sdk.api.iam import public_create_user_v3\n    from accelbyte_py_sdk.api.iam import public_create_user_v3_async\n    ```\n\n6. Use the `async` wrapper with the `await` keyword.\n\n    ```python\n    # result, error = public_create_user_v3(\n    result, error = await public_create_user_v3_async(\n    ```\n\nHere is the full code:\n\n```python\nimport asyncio\nimport json\n\nimport accelbyte_py_sdk\nfrom accelbyte_py_sdk.services.auth import login_client\n\n# Import the wrapper 'public_create_user_v3_async'\n# to know which wrapper to use open the docs/\u003cservice-name\u003e-index.md and\n# use the search function to find the wrapper name\nfrom accelbyte_py_sdk.api.iam import public_create_user_v3_async\n\n# This POST endpoint also requires a body of 'ModelUserCreateRequestV3'\n# so you will need to import that too, import it using this scheme:\n#  from accelbyte_py_sdk.api.\u003cservice-name\u003e.models import \u003cmodel-name\u003e\nfrom accelbyte_py_sdk.api.iam.models import ModelUserCreateRequestV3\nfrom accelbyte_py_sdk.api.iam.models import ModelUserCreateResponseV3\n\n\nasync def main():\n    # 1 Initialize the SDK\n    accelbyte_py_sdk.initialize(options={\"http\": \"HttpxHttpClient\"})\n\n    # 2 Login as a client (uses $AB_CLIENT_ID and $AB_CLIENT_SECRET)\n    _, error = login_client()\n\n    # 3 Create a user using the POST endpoint: /iam/v3/public/namespaces/{namespace}/users\n    #   * this endpoint requires:\n    #     - a 'body' (ModelUserCreateRequestV3)\n    #     - a 'namespace' (string)\n    #       'namespace' here is unique because it can be omitted, omitting it will result in\n    #       the SDK to automatically fill it out with the value of '$AB_NAMESPACE'\n    #   * more details on this endpoint can be found in:\n    #     accelbyte_py_sdk/api/iam/operations/users/public_create_user_v3.py\n    result, error = await public_create_user_v3_async(\n        body=ModelUserCreateRequestV3.create(\n            auth_type=\"EMAILPASSWD\",\n            country=\"US\",\n            date_of_birth=\"2001-01-01\",\n            display_name=\"************\",\n            email_address=\"******@fakemail.com\",\n            password=\"******************\",\n        )\n    )\n\n    # 4 Check for errors\n    if error:\n      exit(1)\n\n    # 5 Do something with the result\n    print(json.dumps(result.to_dict(), indent=2))\n    # {\n    #   \"authType\": \"EMAILPASSWD\",\n    #   \"country\": \"US\",\n    #   \"dateOfBirth\": \"2001-01-01T00:00:00Z\",\n    #   \"displayName\": \"************\",\n    #   \"emailAddress\": \"******@fakemail.com\",\n    #   \"namespace\": \"******\",\n    #   \"userId\": \"********************************\"\n    # }\n\n\nif __name__ == \"__main__\":\n    loop = asyncio.get_event_loop()\n    loop.run_until_complete(main())\n\n```\n\n---\n\n## Configuring HTTP Retry\n\nTo use the `HTTP Retry` feature, set the `HttpClient`'s `retry_policy` and `backoff_policy`.\n\n```python\nimport accelbyte_py_sdk\nfrom accelbyte_py_sdk.core import get_http_client\n\n# 1 Initialize the SDK\naccelbyte_py_sdk.initialize()\n\n# 2 Get the HTTP Client\nhttp_client = get_http_client()\n\n# 3 Configure the `retry_policy` and `backoff_policy`\n\n# 3a. Retry 3 times with 0.5 seconds delay in between\nfrom accelbyte_py_sdk.core import ConstantHttpBackoffPolicy\nfrom accelbyte_py_sdk.core import MaxRetriesHttpRetryPolicy\n\nhttp_client.retry_policy = MaxRetriesHttpRetryPolicy(3)\n\n# 3b. Retry when total elapsed time is less than 15 seconds, with an exponential backoff duration.\nfrom accelbyte_py_sdk.core import ExponentialHttpBackoffPolicy\nfrom accelbyte_py_sdk.core import MaxElapsedHttpRetryPolicy\n\nhttp_client.backoff_policy = ExponentialHttpBackoffPolicy(initial=1.0, multiplier=2.0)\nhttp_client.retry_policy = MaxElapsedHttpRetryPolicy(15)\n\n# 3c. Use custom retry and backoff policies.\nfrom datetime import timedelta\nfrom typing import Optional\n\ndef my_custom_retry_policy(request, response, /, *, retries: int = 0, elapsed: Optional[timedelta] = None, **kwargs) -\u003e float:\n    return \"Retry-After\" in response.headers and retries == 1  # Retry if the 'Retry-After' header exists and we are on the 1st retry (2nd attempt).\n\ndef my_custom_backoff_policy(request, response, /, *, retries: int = 0, elapsed: Optional[timedelta] = None, **kwargs) -\u003e float:\n    return response.headers.get(\"Retry-After\", 1)  # Use the value of the 'Retry-After' response header, default to 1.0s.\n\nhttp_client.backoff_policy = my_custom_backoff_policy\nhttp_client.retry_policy = my_custom_retry_policy\n\n# 3d. Combining multiple retry policies.\nfrom accelbyte_py_sdk.core import CompositeHttpRetryPolicy\nfrom accelbyte_py_sdk.core import MaxRetriesHttpRetryPolicy\nfrom accelbyte_py_sdk.core import StatusCodesHttpRetryPolicy\n\nhttp_client.retry_policy = CompositeHttpRetryPolicy(\n    StatusCodesHttpRetryPolicy(401, (501, 503)),  # Retry when response status code is 401, 501 to 503 (501, 502, or 503) -- AND\n    MaxRetriesHttpRetryPolicy(3)                  #       when number of retries is less than or equal to 3.\n)\n```\n\n---\n\n## Validating Tokens\n\nYou can use `accelbyte_py_sdk.token_validation.caching.CachingTokenValidator` or `accelbyte_py_sdk.token_validation.iam.IAMTokenValidator`.\n\n```python\ntoken_validator = CachingTokenValidator(sdk)  # or IAMTokenValidator(sdk)\n\n# access_token = ...\nerror = token_validator.validate_token(access_token)\nif error:\n    raise error\n```\n\n---\n\n## Parsing Tokens\n\nYou can use `parse_access_token` from `accelbyte_py_sdk.services.auth`.\n\n```python\nfrom accelbyte_py_sdk.services.auth import parse_access_token\n\n# access_token = ...\nclaims, error = parse_access_token(access_token)\nif error:\n    exit(1)\n```\n\nYou can also do validation in the same call. By default, it uses `CachingTokenValidator`.\n\n```python\nfrom accelbyte_py_sdk.services.auth import parse_access_token\n\n# access_token = ...\nclaims, error = parse_access_token(access_token, validate=True)\nif error:\n    exit(1)\n```\n\nYou can specify what kind (or which) of validator you want to use.\n\n```python\nfrom accelbyte_py_sdk.services.auth import parse_access_token\n\n# access_token = ...\nclaims, error = parse_access_token(access_token, validator=\"iam\")  # or validator=\"caching\"\nif error:\n    exit(1)\n```\n\n```python\nfrom accelbyte_py_sdk.services.auth import parse_access_token\n\ntoken_validator = CachingTokenValidator(sdk)  # or IAMTokenValidator(sdk)\n\n# access_token = ...\nclaims, error = parse_access_token(access_token, validator=token_validator)\nif error:\n    exit(1)\n```\n\n---\n\nSee [tests](tests/sdk/core/_request.py) for more usage.\n\n## Samples\n\nSample apps are available in the [samples](samples) directory\n\n## Documentation\n\nFor documentation about AccelByte services and SDK, see [docs.accelbyte.io](https://docs.accelbyte.io/)\n\n:bulb: Check out the index files in the [docs](docs) directory if you are looking for a specific endpoint.\n\n---\n\n## Misc\n\n### Utility Functions\n\nCheck if the SDK is initialized.\n\n```python\nimport accelbyte_py_sdk\n\n\nis_initialized = accelbyte_py_sdk.is_initialized()\n\nprint(is_initialized)\n# False\n```\n\nCreate a Basic Auth from a string tuple.\n\n```python\nimport accelbyte_py_sdk\n\n\nbasic_auth = accelbyte_py_sdk.core.create_basic_authentication(\"foo\", \"bar\")\n\nprint(basic_auth)\n# Basic Zm9vOmJhcg==\n```\n\nGets the stored access token.\n\n```python\nimport accelbyte_py_sdk\n\n\naccess_token, error = accelbyte_py_sdk.core.get_access_token()\n\nprint(access_token)\n# ************************************\n```\n\nGet `AB_*` environment configuration values.\n\n```python\nimport accelbyte_py_sdk\n\n\nbase_url, client_id, client_secret, namespace = accelbyte_py_sdk.core.get_env_config()\n\nprint(f\"{base_url}, {client_id}, {client_secret}, {namespace}\")\n# \u003c$AB_BASE_URL\u003e, \u003c$AB_CLIENT_ID\u003e, \u003c$AB_CLIENT_SECRET\u003e, \u003c$AB_NAMESPACE\u003e\n```\n\nGet `AB_*` environment user credential values.\n\n```python\nimport accelbyte_py_sdk\n\n\nusername, password = accelbyte_py_sdk.core.get_env_user_credentials()\n\nprint(f\"{base_url}: {client_id}\")\n# \u003c$AB_USERNAME\u003e: \u003c$AB_PASSWORD\u003e\n```\n\nSet logger level and add logger handlers.\n\n```python\nimport logging\n\n# 1. The SDK has helper functions for logging.\n\naccelbyte_py_sdk.core.set_logger_level(logging.INFO)          # 'accelbyte_py_sdk'\naccelbyte_py_sdk.core.set_logger_level(logging.INFO, \"http\")  # 'accelbyte_py_sdk.http'\naccelbyte_py_sdk.core.set_logger_level(logging.INFO, \"ws\")    # 'accelbyte_py_sdk.ws'\n\n\n# 2. You could also use this helper function for debugging.\n\naccelbyte_py_sdk.core.add_stream_handler_to_logger()          # sends content of the 'accelbyte_py_sdk' logger to 'sys.stderr'.\n\n\n# 3. There is a helper function that helps you get started with log files.\n\naccelbyte_py_sdk.core.add_buffered_file_handler_to_logger(    # flushes content of the 'accelbyte_py_sdk' logger to a file named 'sdk.log' every 10 logs.\n    filename=\"/path/to/sdk.log\",\n    capacity=10,\n    level=logging.INFO\n)\naccelbyte_py_sdk.core.add_buffered_file_handler_to_logger(    # flushes content of the 'accelbyte_py_sdk.http' logger to a file named 'http.log' every 3 logs.\n    filename=\"/path/to/http.log\",\n    capacity=3,\n    level=logging.INFO,\n    additional_scope=\"http\"\n)\n\n# 3.a. Or you could the same thing when initializing the SDK.\n\naccelbyte_py_sdk.initialize(\n    options={\n        \"log_files\": {\n            \"\": \"/path/to/sdk.log\",                           # flushes content of the 'accelbyte_py_sdk' logger to a file named 'sdk.log' every 10 logs.\n            \"http\": {                                         # flushes content of the 'accelbyte_py_sdk.http' logger to a file named 'http.log' every 3 logs.\n                \"filename\": \"/path/to/http.log\",\n                \"capacity\": 3,\n                \"level\": logging.INFO\n            }\n        }\n    }\n)\n\n# 4. By default logs from 'accelbyte_py_sdk.http' are stringified dictionaries, you can set your own formatter like so.\n\ndef format_request_response_as_yaml(data: dict) -\u003e str:\n    return f\"---\\n{yaml.safe_dump(data, sort_keys=False).rstrip()}\\n...\"\n\nhttp_client = accelbyte_py_sdk.core.get_http_client()\nhttp_client.request_log_formatter = format_request_response_as_yaml\nhttp_client.response_log_formatter = format_request_response_as_yaml\n```\n\n---\n\n## In-depth Topics\n\n### Generated code\n\n#### Models\n\nEach definition in `#/definitions/` is turned into a Model.\n\nExample:\n\n```yaml\n# UserProfileInfo\nproperties:\n  avatarLargeUrl:\n    type: string\n  avatarSmallUrl:\n    type: string\n  avatarUrl:\n    type: string\n  customAttributes:\n    additionalProperties:\n      type: object\n    type: object\n  dateOfBirth:\n    format: date\n    type: string\n    x-nullable: true\n  firstName:\n    type: string\n  language:\n    type: string\n  lastName:\n    type: string\n  namespace:\n    type: string\n  status:\n    enum:\n    - ACTIVE\n    - INACTIVE\n    type: string\n  timeZone:\n    type: string\n  userId:\n    type: string\n  zipCode:\n    type: string\ntype: object\n\n```\n\n```python\n# accelbyte_py_sdk/api/basic/models/user_profile_info.py\n\nclass UserProfileInfo(Model):\n    \"\"\"User profile info (UserProfileInfo)\n\n    Properties:\n        avatar_large_url: (avatarLargeUrl) OPTIONAL str\n\n        avatar_small_url: (avatarSmallUrl) OPTIONAL str\n\n        avatar_url: (avatarUrl) OPTIONAL str\n\n        custom_attributes: (customAttributes) OPTIONAL Dict[str, Any]\n\n        date_of_birth: (dateOfBirth) OPTIONAL str\n\n        first_name: (firstName) OPTIONAL str\n\n        language: (language) OPTIONAL str\n\n        last_name: (lastName) OPTIONAL str\n\n        namespace: (namespace) OPTIONAL str\n\n        status: (status) OPTIONAL Union[str, StatusEnum]\n\n        time_zone: (timeZone) OPTIONAL str\n\n        user_id: (userId) OPTIONAL str\n\n        zip_code: (zipCode) OPTIONAL str\n    \"\"\"\n\n    # region fields\n\n    avatar_large_url: str                                                                          # OPTIONAL\n    avatar_small_url: str                                                                          # OPTIONAL\n    avatar_url: str                                                                                # OPTIONAL\n    custom_attributes: Dict[str, Any]                                                              # OPTIONAL\n    date_of_birth: str                                                                             # OPTIONAL\n    first_name: str                                                                                # OPTIONAL\n    language: str                                                                                  # OPTIONAL\n    last_name: str                                                                                 # OPTIONAL\n    namespace: str                                                                                 # OPTIONAL\n    status: Union[str, StatusEnum]                                                                 # OPTIONAL\n    time_zone: str                                                                                 # OPTIONAL\n    user_id: str                                                                                   # OPTIONAL\n    zip_code: str                                                                                  # OPTIONAL\n\n    # endregion fields\n```\n\nthere are also a number of utility functions generated with each model that should help in the ease of use.\n\n```python\n# accelbyte_py_sdk/api/basic/models/user_profile_info.py\n\n    ...\n\n    def with_user_id(self, value: str) -\u003e UserProfileInfo:\n        self.user_id = value\n        return self\n\n    # other with_x() methods too\n\n    def to_dict(self, include_empty: bool = False) -\u003e dict:\n        result: dict = {}\n        ...\n        return result\n\n    @classmethod\n    def create(\n        cls,\n        avatar_large_url: Optional[str] = None,\n        avatar_small_url: Optional[str] = None,\n        avatar_url: Optional[str] = None,\n        custom_attributes: Optional[Dict[str, Any]] = None,\n        date_of_birth: Optional[str] = None,\n        first_name: Optional[str] = None,\n        language: Optional[str] = None,\n        last_name: Optional[str] = None,\n        namespace: Optional[str] = None,\n        status: Optional[Union[str, StatusEnum]] = None,\n        time_zone: Optional[str] = None,\n        user_id: Optional[str] = None,\n        zip_code: Optional[str] = None,\n    ) -\u003e UserProfileInfo:\n        instance = cls()\n        ...\n        return instance\n\n    @classmethod\n    def create_from_dict(cls, dict_: dict, include_empty: bool = False) -\u003e UserProfileInfo:\n        instance = cls()\n        ...\n        return instance\n\n    @staticmethod\n    def get_field_info() -\u003e Dict[str, str]:\n        return {\n            \"avatarLargeUrl\": \"avatar_large_url\",\n            \"avatarSmallUrl\": \"avatar_small_url\",\n            \"avatarUrl\": \"avatar_url\",\n            \"customAttributes\": \"custom_attributes\",\n            \"dateOfBirth\": \"date_of_birth\",\n            \"firstName\": \"first_name\",\n            \"language\": \"language\",\n            \"lastName\": \"last_name\",\n            \"namespace\": \"namespace\",\n            \"status\": \"status\",\n            \"timeZone\": \"time_zone\",\n            \"userId\": \"user_id\",\n            \"zipCode\": \"zip_code\",\n        }\n\n    ...\n```\n\n#### Operations\n\nEach path item in `#/paths` is turned into an Operation.\n\nExample:\n\n```yaml\n# GET /basic/v1/public/namespaces/{namespace}/users/{userId}/profiles\ndescription: 'Get user profile.\u0026lt;br\u0026gt;Other detail info: \u0026lt;ul\u0026gt;\u0026lt;li\u0026gt;\u0026lt;i\u0026gt;Required\n  permission\u0026lt;/i\u0026gt;: resource=\u0026lt;b\u0026gt;\u0026#34;NAMESPACE:{namespace}:USER:{userId}:PROFILE\u0026#34;\u0026lt;/b\u0026gt;,\n  action=2 \u0026lt;b\u0026gt;(READ)\u0026lt;/b\u0026gt;\u0026lt;/li\u0026gt;\u0026lt;li\u0026gt;\u0026lt;i\u0026gt;Action code\u0026lt;/i\u0026gt;:\n  11403\u0026lt;/li\u0026gt;\u0026lt;li\u0026gt;\u0026lt;i\u0026gt;Returns\u0026lt;/i\u0026gt;: user profile\u0026lt;/li\u0026gt;\u0026lt;/ul\u0026gt;'\noperationId: publicGetUserProfileInfo\nparameters:\n- description: namespace, only accept alphabet and numeric\n  in: path\n  name: namespace\n  required: true\n  type: string\n- description: user's id, should follow UUID version 4 without hyphen\n  in: path\n  name: userId\n  required: true\n  type: string\nproduces:\n- application/json\nresponses:\n  '200':\n    description: Successful operation\n    schema:\n      $ref: '#/definitions/UserProfileInfo'\n  '400':\n    description: \u003ctable\u003e\u003ctr\u003e\u003ctd\u003eerrorCode\u003c/td\u003e\u003ctd\u003eerrorMessage\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e20002\u003c/td\u003e\u003ctd\u003evalidation\n      error\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n    schema:\n      $ref: '#/definitions/ValidationErrorEntity'\n  '401':\n    description: \u003ctable\u003e\u003ctr\u003e\u003ctd\u003eerrorCode\u003c/td\u003e\u003ctd\u003eerrorMessage\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e20001\u003c/td\u003e\u003ctd\u003eunauthorized\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n    schema:\n      $ref: '#/definitions/ErrorEntity'\n  '403':\n    description: \u003ctable\u003e\u003ctr\u003e\u003ctd\u003eerrorCode\u003c/td\u003e\u003ctd\u003eerrorMessage\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e20013\u003c/td\u003e\u003ctd\u003einsufficient\n      permission\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n    schema:\n      $ref: '#/definitions/ErrorEntity'\n  '404':\n    description: '\u003ctable\u003e\u003ctr\u003e\u003ctd\u003eerrorCode\u003c/td\u003e\u003ctd\u003eerrorMessage\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e11440\u003c/td\u003e\u003ctd\u003eUnable\n      to {action}: User profile not found in namespace [{namespace}]\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e'\n    schema:\n      $ref: '#/definitions/ErrorEntity'\nsecurity:\n- authorization: []\n- HasPermission:\n  - NAMESPACE:{namespace}:USER:{userId}:PROFILE [READ]\n  authorization: []\nsummary: Get user profile\ntags:\n- UserProfile\nx-authorization:\n  action: '2'\n  resource: NAMESPACE:{namespace}:USER:{userId}:PROFILE\n\n```\n\nsame with the models there are also a number of utility functions generated with each operation that should help in the ease of use.\n\n```python\n# accelbyte_py_sdk/api/basic/operations/user_profile/get_user_profile_info.py\n\n# Copyright (c) 2021 AccelByte Inc. All Rights Reserved.\n# This is licensed software from AccelByte Inc, for limitations\n# and restrictions contact your company contract manager.\n# \n# Code generated. DO NOT EDIT!\n\n# template file: accelbyte_gaming services_py_codegen\n\n# pylint: disable=duplicate-code\n# pylint: disable=line-too-long\n# pylint: disable=missing-function-docstring\n# pylint: disable=missing-module-docstring\n# pylint: disable=too-many-arguments\n# pylint: disable=too-many-branches\n# pylint: disable=too-many-instance-attributes\n# pylint: disable=too-many-lines\n# pylint: disable=too-many-locals\n# pylint: disable=too-many-public-methods\n# pylint: disable=too-many-return-statements\n# pylint: disable=too-many-statements\n# pylint: disable=unused-import\n\n# AccelByte Gaming Services Basic Service (1.36.1)\n\nfrom __future__ import annotations\nfrom typing import Any, Dict, List, Optional, Tuple, Union\n\nfrom .....core import Operation\nfrom .....core import HeaderStr\nfrom .....core import HttpResponse\n\nfrom ...models import ErrorEntity\nfrom ...models import UserProfilePrivateInfo\nfrom ...models import ValidationErrorEntity\n\n\nclass GetUserProfileInfo(Operation):\n    \"\"\"Get user profile (getUserProfileInfo)\n\n    Get user profile.\n    Other detail info:\n\n      * Required permission : resource= \"ADMIN:NAMESPACE:{namespace}:USER:{userId}:PROFILE\" , action=2 (READ)\n      *  Returns : user profile\n      *  Action code : 11403\n\n    Required Permission(s):\n        - ADMIN:NAMESPACE:{namespace}:USER:{userId}:PROFILE [READ]\n\n    Properties:\n        url: /basic/v1/admin/namespaces/{namespace}/users/{userId}/profiles\n\n        method: GET\n\n        tags: [\"UserProfile\"]\n\n        consumes: []\n\n        produces: [\"application/json\"]\n\n        securities: [BEARER_AUTH] or [BEARER_AUTH]\n\n        namespace: (namespace) REQUIRED str in path\n\n        user_id: (userId) REQUIRED str in path\n\n    Responses:\n        200: OK - UserProfilePrivateInfo (successful operation)\n\n        400: Bad Request - ValidationErrorEntity (20002: validation error)\n\n        401: Unauthorized - ErrorEntity (20001: unauthorized)\n\n        403: Forbidden - ErrorEntity (20013: insufficient permission)\n\n        404: Not Found - ErrorEntity (11440: Unable to {action}: User profile not found in namespace [{namespace}])\n    \"\"\"\n\n    # region fields\n\n    _url: str = \"/basic/v1/admin/namespaces/{namespace}/users/{userId}/profiles\"\n    _method: str = \"GET\"\n    _consumes: List[str] = []\n    _produces: List[str] = [\"application/json\"]\n    _securities: List[List[str]] = [[\"BEARER_AUTH\"], [\"BEARER_AUTH\"]]\n    _location_query: str = None\n\n    namespace: str                                                                                 # REQUIRED in [path]\n    user_id: str                                                                                   # REQUIRED in [path]\n\n    # endregion fields\n\n    # region properties\n\n    @property\n    def url(self) -\u003e str:\n        return self._url\n\n    @property\n    def method(self) -\u003e str:\n        return self._method\n\n    @property\n    def consumes(self) -\u003e List[str]:\n        return self._consumes\n\n    @property\n    def produces(self) -\u003e List[str]:\n        return self._produces\n\n    @property\n    def securities(self) -\u003e List[List[str]]:\n        return self._securities\n\n    @property\n    def location_query(self) -\u003e str:\n        return self._location_query\n\n    # endregion properties\n\n    # region get methods\n\n    # endregion get methods\n\n    # region get_x_params methods\n\n    def get_all_params(self) -\u003e dict:\n        return {\n            \"path\": self.get_path_params(),\n        }\n\n    def get_path_params(self) -\u003e dict:\n        result = {}\n        if hasattr(self, \"namespace\"):\n            result[\"namespace\"] = self.namespace\n        if hasattr(self, \"user_id\"):\n            result[\"userId\"] = self.user_id\n        return result\n\n    # endregion get_x_params methods\n\n    # region is/has methods\n\n    # endregion is/has methods\n\n    # region with_x methods\n\n    def with_namespace(self, value: str) -\u003e GetUserProfileInfo:\n        self.namespace = value\n        return self\n\n    def with_user_id(self, value: str) -\u003e GetUserProfileInfo:\n        self.user_id = value\n        return self\n\n    # endregion with_x methods\n\n    # region to methods\n\n    def to_dict(self, include_empty: bool = False) -\u003e dict:\n        result: dict = {}\n        if hasattr(self, \"namespace\") and self.namespace:\n            result[\"namespace\"] = str(self.namespace)\n        elif include_empty:\n            result[\"namespace\"] = \"\"\n        if hasattr(self, \"user_id\") and self.user_id:\n            result[\"userId\"] = str(self.user_id)\n        elif include_empty:\n            result[\"userId\"] = \"\"\n        return result\n\n    # endregion to methods\n\n    # region response methods\n\n    # noinspection PyMethodMayBeStatic\n    def parse_response(self, code: int, content_type: str, content: Any) -\u003e Tuple[Union[None, UserProfilePrivateInfo], Union[None, ErrorEntity, HttpResponse, ValidationErrorEntity]]:\n        \"\"\"Parse the given response.\n\n        200: OK - UserProfilePrivateInfo (successful operation)\n\n        400: Bad Request - ValidationErrorEntity (20002: validation error)\n\n        401: Unauthorized - ErrorEntity (20001: unauthorized)\n\n        403: Forbidden - ErrorEntity (20013: insufficient permission)\n\n        404: Not Found - ErrorEntity (11440: Unable to {action}: User profile not found in namespace [{namespace}])\n\n        ---: HttpResponse (Undocumented Response)\n\n        ---: HttpResponse (Unexpected Content-Type Error)\n\n        ---: HttpResponse (Unhandled Error)\n        \"\"\"\n        pre_processed_response, error = self.pre_process_response(code=code, content_type=content_type, content=content)\n        if error is not None:\n            return None, None if error.is_no_content() else error\n        code, content_type, content = pre_processed_response\n\n        if code == 200:\n            return UserProfilePrivateInfo.create_from_dict(content), None\n        if code == 400:\n            return None, ValidationErrorEntity.create_from_dict(content)\n        if code == 401:\n            return None, ErrorEntity.create_from_dict(content)\n        if code == 403:\n            return None, ErrorEntity.create_from_dict(content)\n        if code == 404:\n            return None, ErrorEntity.create_from_dict(content)\n\n        return self.handle_undocumented_response(code=code, content_type=content_type, content=content)\n\n    # endregion response methods\n\n    # region static methods\n\n    @classmethod\n    def create(\n        cls,\n        namespace: str,\n        user_id: str,\n    ) -\u003e GetUserProfileInfo:\n        instance = cls()\n        instance.namespace = namespace\n        instance.user_id = user_id\n        return instance\n\n    @classmethod\n    def create_from_dict(cls, dict_: dict, include_empty: bool = False) -\u003e GetUserProfileInfo:\n        instance = cls()\n        if \"namespace\" in dict_ and dict_[\"namespace\"] is not None:\n            instance.namespace = str(dict_[\"namespace\"])\n        elif include_empty:\n            instance.namespace = \"\"\n        if \"userId\" in dict_ and dict_[\"userId\"] is not None:\n            instance.user_id = str(dict_[\"userId\"])\n        elif include_empty:\n            instance.user_id = \"\"\n        return instance\n\n    @staticmethod\n    def get_field_info() -\u003e Dict[str, str]:\n        return {\n            \"namespace\": \"namespace\",\n            \"userId\": \"user_id\",\n        }\n\n    @staticmethod\n    def get_required_map() -\u003e Dict[str, bool]:\n        return {\n            \"namespace\": True,\n            \"userId\": True,\n        }\n\n    # endregion static methods\n\n```\n\n#### Creating\n\n:bulb: there are 4 ways to create an instance of these models and operations.\n\n```python\n# 1. using the python __init__() function then setting the parameters manually:\nmodel = ModelName()\nmodel.param_a = \"foo\"\nmodel.param_b = \"bar\"\n\n# 2. using the python __init__() function together with the 'with_x' methods:\n# # the 'with_x' functions are type annotated and will show warnings if a wrong type is passed.\nmodel = ModelName() \\\n    .with_param_a(\"foo\") \\\n    .with_param_b(\"bar\")\n\n# 3. using the ModelName.create(..) class method:\n# # parameters here are also type annotated and will throw a TypeError if a required field was not filled out.\nmodel = ModelName.create(\n    param_a=\"foo\",\n    param_b=\"bar\",\n)\n\n# 4. using the ModelName.create_from_dict(..) class method:\n# # this method also has a 'include_empty' option that would get ignore values that evaluate to False, None, or len() == 0.\nmodel_params = {\n    \"param_a\": \"foo\",\n    \"param_b\": \"bar\",\n    \"param_c\": False,\n    \"param_d\": None,\n    \"param_e\": [],\n    \"param_f\": {},\n}\nmodel = ModelName.create_from_dict(model_params)\n\n# all of these apply to all operations too.\n```\n\n#### Wrappers\n\nTo improve ergonomics the code generator also generates wrappers around the operations.\nThe purpose of these wrappers is to automatically fill up parameters that the SDK already knows.\n(e.g. namespace, client_id, access_token, etc.)\n\nThey are located at `accelbyte_py_sdk.api.\u003cservice-name\u003e.wrappers` but can be accessed like so: `from accelbyte_py_sdk.api.\u003cservice-name\u003e import \u003cwrapper-name\u003e`\n\n```python\nimport accelbyte_py_sdk\nfrom accelbyte_py_sdk.api.iam import token_grant_v3\n\nif __name__ == \"__main__\":\n    accelbyte_py_sdk.initialize()\n\n    token, error = token_grant_v3(\n        grant_type=\"client_credentials\"\n    )\n    assert error is not None\n```\n\nThe wrapper function `token_grant_v3` is a wrapper for the `TokenGrantV3` operation.\nIt automatically passes in the information needed like the Basic Auth Headers.\nThe values are gotten from the current `ConfigRepository`.\n\ncontinuing from the previous examples (GetUserProfileInfo), its wrapper would be:\n\n```python\n# accelbyte_py_sdk/api/basic/wrappers/_user_profile.py\n\nfrom typing import Any, Dict, List, Optional, Tuple, Union\n\nfrom ....core import get_namespace as get_services_namespace\nfrom ....core import run_request\nfrom ....core import same_doc_as\n\nfrom ..operations.user_profile import GetUserProfileInfo\n\n\n@same_doc_as(GetUserProfileInfo)\ndef get_user_profile_info(user_id: str, namespace: Optional[str] = None):\n    if namespace is None:\n        namespace, error = get_services_namespace()\n        if error:\n            return None, error\n    request = GetUserProfileInfo.create(\n        user_id=user_id,\n        namespace=namespace,\n    )\n    return run_request(request)\n```\n\nthis wrapper function automatically fills up the required path parameter `namespace`.\n\nnow to use it only the `user_id` is now required.\n\n```python\nimport accelbyte_py_sdk\nfrom accelbyte_py_sdk.api.basic import get_user_profile_info\n\nif __name__ == \"__main__\":\n    accelbyte_py_sdk.initialize()\n\n    user_profile_info, error = get_user_profile_info(user_id=\"lorem\")\n    assert error is not None\n\n    print(f\"Hello there {user_profile_info.first_name}!\")\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faccelbyte%2Faccelbyte-python-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faccelbyte%2Faccelbyte-python-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faccelbyte%2Faccelbyte-python-sdk/lists"}