11# This file was auto-generated by Fern from our API Definition.
22
3- import os
43import typing
54import urllib .parse
65from json .decoder import JSONDecodeError
@@ -47,7 +46,9 @@ class Fileforge:
4746
4847
4948
50- api_key : typing.Optional[str]
49+ api_key : str
50+ username : typing.Optional[typing.Union[str, typing.Callable[[], str]]]
51+ password : typing.Optional[typing.Union[str, typing.Callable[[], str]]]
5152 timeout : typing.Optional[float]
5253 The timeout to be used, in seconds, for requests by default the timeout is 60 seconds, unless a custom httpx client is used, in which case a default is not set.
5354
@@ -63,6 +64,8 @@ class Fileforge:
6364
6465 client = Fileforge(
6566 api_key="YOUR_API_KEY",
67+ username="YOUR_USERNAME",
68+ password="YOUR_PASSWORD",
6669 )
6770 """
6871
@@ -71,19 +74,19 @@ def __init__(
7174 * ,
7275 base_url : typing .Optional [str ] = None ,
7376 environment : FileforgeEnvironment = FileforgeEnvironment .DEFAULT ,
74- api_key : typing .Optional [str ] = os .getenv ("FILEFORGE_API_KEY" ),
77+ api_key : str ,
78+ username : typing .Optional [typing .Union [str , typing .Callable [[], str ]]] = None ,
79+ password : typing .Optional [typing .Union [str , typing .Callable [[], str ]]] = None ,
7580 timeout : typing .Optional [float ] = None ,
7681 follow_redirects : typing .Optional [bool ] = True ,
7782 httpx_client : typing .Optional [httpx .Client ] = None ,
7883 ):
7984 _defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
80- if api_key is None :
81- raise ApiError (
82- body = "The client must be instantiated be either passing in api_key or setting FILEFORGE_API_KEY"
83- )
8485 self ._client_wrapper = SyncClientWrapper (
8586 base_url = _get_base_url (base_url = base_url , environment = environment ),
8687 api_key = api_key ,
88+ username = username ,
89+ password = password ,
8790 httpx_client = httpx_client
8891 if httpx_client is not None
8992 else httpx .Client (timeout = _defaulted_timeout , follow_redirects = follow_redirects )
@@ -109,6 +112,8 @@ def retrieve_server_status(self, *, request_options: typing.Optional[RequestOpti
109112
110113 client = Fileforge(
111114 api_key="YOUR_API_KEY",
115+ username="YOUR_USERNAME",
116+ password="YOUR_PASSWORD",
112117 )
113118 client.retrieve_server_status()
114119 """
@@ -212,6 +217,8 @@ def convert_docx(
212217
213218 client = Fileforge(
214219 api_key="YOUR_API_KEY",
220+ username="YOUR_USERNAME",
221+ password="YOUR_PASSWORD",
215222 )
216223 client.convert_docx()
217224 """
@@ -293,6 +300,8 @@ def generate(
293300
294301 client = Fileforge(
295302 api_key="YOUR_API_KEY",
303+ username="YOUR_USERNAME",
304+ password="YOUR_PASSWORD",
296305 )
297306 client.generate()
298307 """
@@ -373,6 +382,8 @@ def merge(
373382
374383 client = Fileforge(
375384 api_key="YOUR_API_KEY",
385+ username="YOUR_USERNAME",
386+ password="YOUR_PASSWORD",
376387 )
377388 client.merge()
378389 """
@@ -441,7 +452,9 @@ class AsyncFileforge:
441452
442453
443454
444- api_key : typing.Optional[str]
455+ api_key : str
456+ username : typing.Optional[typing.Union[str, typing.Callable[[], str]]]
457+ password : typing.Optional[typing.Union[str, typing.Callable[[], str]]]
445458 timeout : typing.Optional[float]
446459 The timeout to be used, in seconds, for requests by default the timeout is 60 seconds, unless a custom httpx client is used, in which case a default is not set.
447460
@@ -457,6 +470,8 @@ class AsyncFileforge:
457470
458471 client = AsyncFileforge(
459472 api_key="YOUR_API_KEY",
473+ username="YOUR_USERNAME",
474+ password="YOUR_PASSWORD",
460475 )
461476 """
462477
@@ -465,19 +480,19 @@ def __init__(
465480 * ,
466481 base_url : typing .Optional [str ] = None ,
467482 environment : FileforgeEnvironment = FileforgeEnvironment .DEFAULT ,
468- api_key : typing .Optional [str ] = os .getenv ("FILEFORGE_API_KEY" ),
483+ api_key : str ,
484+ username : typing .Optional [typing .Union [str , typing .Callable [[], str ]]] = None ,
485+ password : typing .Optional [typing .Union [str , typing .Callable [[], str ]]] = None ,
469486 timeout : typing .Optional [float ] = None ,
470487 follow_redirects : typing .Optional [bool ] = True ,
471488 httpx_client : typing .Optional [httpx .AsyncClient ] = None ,
472489 ):
473490 _defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
474- if api_key is None :
475- raise ApiError (
476- body = "The client must be instantiated be either passing in api_key or setting FILEFORGE_API_KEY"
477- )
478491 self ._client_wrapper = AsyncClientWrapper (
479492 base_url = _get_base_url (base_url = base_url , environment = environment ),
480493 api_key = api_key ,
494+ username = username ,
495+ password = password ,
481496 httpx_client = httpx_client
482497 if httpx_client is not None
483498 else httpx .AsyncClient (timeout = _defaulted_timeout , follow_redirects = follow_redirects )
@@ -503,6 +518,8 @@ async def retrieve_server_status(self, *, request_options: typing.Optional[Reque
503518
504519 client = AsyncFileforge(
505520 api_key="YOUR_API_KEY",
521+ username="YOUR_USERNAME",
522+ password="YOUR_PASSWORD",
506523 )
507524 await client.retrieve_server_status()
508525 """
@@ -606,6 +623,8 @@ async def convert_docx(
606623
607624 client = AsyncFileforge(
608625 api_key="YOUR_API_KEY",
626+ username="YOUR_USERNAME",
627+ password="YOUR_PASSWORD",
609628 )
610629 await client.convert_docx()
611630 """
@@ -687,6 +706,8 @@ async def generate(
687706
688707 client = AsyncFileforge(
689708 api_key="YOUR_API_KEY",
709+ username="YOUR_USERNAME",
710+ password="YOUR_PASSWORD",
690711 )
691712 await client.generate()
692713 """
@@ -767,6 +788,8 @@ async def merge(
767788
768789 client = AsyncFileforge(
769790 api_key="YOUR_API_KEY",
791+ username="YOUR_USERNAME",
792+ password="YOUR_PASSWORD",
770793 )
771794 await client.merge()
772795 """
0 commit comments