Skip to content

Commit

Permalink
chore: autogenerating code from open api spec
Browse files Browse the repository at this point in the history
  • Loading branch information
sbansla committed Oct 4, 2024
1 parent 1ef2140 commit c7e339f
Show file tree
Hide file tree
Showing 1,245 changed files with 28,323 additions and 22,949 deletions.
2 changes: 1 addition & 1 deletion sendgrid/rest/api/account_provisioning/v3/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# TODO
# TODO
36 changes: 15 additions & 21 deletions sendgrid/rest/api/account_provisioning/v3/authenticate_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,41 @@
"""

import json
import warnings
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated
from sendgrid.base import values
from sendgrid.exceptions import ApiException
from sendgrid.http.request import Request
from sendgrid.http.response import ApiResponse

from pydantic import Field, StrictStr
from typing_extensions import Annotated

class AuthenticateAccount:
def __init__(self, client) -> None:
self.client = client

def send(
self,
account_id: str,

account_id: str,
):
path='/v3/partners/accounts/{accountID}/sso'
path = "/v3/partners/accounts/{accountID}/sso"
path = path.format(
account_id=account_id,
account_id=account_id,
)

data = None
request = Request(
method='POST',
url=path,
data=data,
headers=headers
)
response=self.client.send(request)
request = Request(method="POST", url=path, data=data, headers=headers)
response = self.client.send(request)
if response is None:
raise ApiException(error="CreateAlert creation failed: Unable to connect to server")
raise ApiException(
error="CreateAlert creation failed: Unable to connect to server"
)

if response.text:
text = json.loads(response.text)
else:
text = ""
if response.is_success():
return ApiResponse(status_code=response.status_code, model=text, headers=response.headers)
return ApiResponse(
status_code=response.status_code, model=text, headers=response.headers
)
else:
raise ApiException(status_code=response.status_code, error=text, headers=response.headers)
raise ApiException(
status_code=response.status_code, error=text, headers=response.headers
)
49 changes: 24 additions & 25 deletions sendgrid/rest/api/account_provisioning/v3/create_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,55 +12,54 @@
"""

import json
import warnings
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated
from typing import Optional
from sendgrid.base import values
from sendgrid.exceptions import ApiException
from sendgrid.http.request import Request
from sendgrid.http.response import ApiResponse

from pydantic import Field, StrictStr
from typing import Optional
from typing_extensions import Annotated
from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_account_id import AccountProvisioningAccountId
from sendgrid.rest.api.account_provisioning.v3.models.create_account_params import CreateAccountParams
from sendgrid.rest.api.account_provisioning.v3.models.create_account_params import (
CreateAccountParams,
)


class CreateAccount:
def __init__(self, client) -> None:
self.client = client

def send(
self,
t_test_account: Optional[str] = None,
create_account_params: Optional[CreateAccountParams] = None,

t_test_account: Optional[str] = None,
create_account_params: Optional[CreateAccountParams] = None,
):
path='/v3/partners/accounts'
path = "/v3/partners/accounts"

headers = values.of(
{
'T-Test-Account': t_test_account,
})
{
"T-Test-Account": t_test_account,
}
)
headers["Content-Type"] = "application/json"
data = None
if create_account_params:
data = create_account_params.to_dict()
request = Request(
method='POST',
url=path,
data=data,
headers=headers
)
response=self.client.send(request)
request = Request(method="POST", url=path, data=data, headers=headers)
response = self.client.send(request)
if response is None:
raise ApiException(error="CreateAlert creation failed: Unable to connect to server")
raise ApiException(
error="CreateAlert creation failed: Unable to connect to server"
)

if response.text:
text = json.loads(response.text)
else:
text = ""
if response.is_success():
return ApiResponse(status_code=response.status_code, model=text, headers=response.headers)
return ApiResponse(
status_code=response.status_code, model=text, headers=response.headers
)
else:
raise ApiException(status_code=response.status_code, error=text, headers=response.headers)
raise ApiException(
status_code=response.status_code, error=text, headers=response.headers
)
36 changes: 15 additions & 21 deletions sendgrid/rest/api/account_provisioning/v3/delete_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,41 @@
"""

import json
import warnings
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated
from sendgrid.base import values
from sendgrid.exceptions import ApiException
from sendgrid.http.request import Request
from sendgrid.http.response import ApiResponse

from pydantic import Field, StrictStr
from typing_extensions import Annotated

class DeleteAccount:
def __init__(self, client) -> None:
self.client = client

def send(
self,
account_id: str,

account_id: str,
):
path='/v3/partners/accounts/{accountID}'
path = "/v3/partners/accounts/{accountID}"
path = path.format(
account_id=account_id,
account_id=account_id,
)

data = None
request = Request(
method='DELETE',
url=path,
data=data,
headers=headers
)
response=self.client.send(request)
request = Request(method="DELETE", url=path, data=data, headers=headers)
response = self.client.send(request)
if response is None:
raise ApiException(error="CreateAlert creation failed: Unable to connect to server")
raise ApiException(
error="CreateAlert creation failed: Unable to connect to server"
)

if response.text:
text = json.loads(response.text)
else:
text = ""
if response.is_success():
return ApiResponse(status_code=response.status_code, model=text, headers=response.headers)
return ApiResponse(
status_code=response.status_code, model=text, headers=response.headers
)
else:
raise ApiException(status_code=response.status_code, error=text, headers=response.headers)
raise ApiException(
status_code=response.status_code, error=text, headers=response.headers
)
37 changes: 15 additions & 22 deletions sendgrid/rest/api/account_provisioning/v3/get_account_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,48 +12,41 @@
"""

import json
import warnings
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated
from sendgrid.base import values
from sendgrid.exceptions import ApiException
from sendgrid.http.request import Request
from sendgrid.http.response import ApiResponse

from pydantic import Field, StrictStr
from typing_extensions import Annotated
from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_state_read import AccountProvisioningStateRead

class GetAccountState:
def __init__(self, client) -> None:
self.client = client

def send(
self,
account_id: str,

account_id: str,
):
path='/v3/partners/accounts/{accountID}/state'
path = "/v3/partners/accounts/{accountID}/state"
path = path.format(
account_id=account_id,
account_id=account_id,
)

data = None
request = Request(
method='GET',
url=path,
data=data,
headers=headers
)
response=self.client.send(request)
request = Request(method="GET", url=path, data=data, headers=headers)
response = self.client.send(request)
if response is None:
raise ApiException(error="CreateAlert creation failed: Unable to connect to server")
raise ApiException(
error="CreateAlert creation failed: Unable to connect to server"
)

if response.text:
text = json.loads(response.text)
else:
text = ""
if response.is_success():
return ApiResponse(status_code=response.status_code, model=text, headers=response.headers)
return ApiResponse(
status_code=response.status_code, model=text, headers=response.headers
)
else:
raise ApiException(status_code=response.status_code, error=text, headers=response.headers)
raise ApiException(
status_code=response.status_code, error=text, headers=response.headers
)
39 changes: 17 additions & 22 deletions sendgrid/rest/api/account_provisioning/v3/list_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,42 @@
"""

import json
import warnings
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated
from sendgrid.base import values
from typing import Optional
from sendgrid.exceptions import ApiException
from sendgrid.http.request import Request
from sendgrid.http.response import ApiResponse

from pydantic import Field, StrictStr
from typing import Optional
from typing_extensions import Annotated
from sendgrid.rest.api.account_provisioning.v3.models.account_list import AccountList


class ListAccount:
def __init__(self, client) -> None:
self.client = client

def send(
self,
offset: Optional[str] = None,
limit: Optional[int] = None,

offset: Optional[str] = None,
limit: Optional[int] = None,
):
path='/v3/partners/accounts'
path = "/v3/partners/accounts"

data = None
request = Request(
method='GET',
url=path,
data=data,
headers=headers
)
response=self.client.send(request)
request = Request(method="GET", url=path, data=data, headers=headers)
response = self.client.send(request)
if response is None:
raise ApiException(error="CreateAlert creation failed: Unable to connect to server")
raise ApiException(
error="CreateAlert creation failed: Unable to connect to server"
)

if response.text:
text = json.loads(response.text)
else:
text = ""
if response.is_success():
return ApiResponse(status_code=response.status_code, model=text, headers=response.headers)
return ApiResponse(
status_code=response.status_code, model=text, headers=response.headers
)
else:
raise ApiException(status_code=response.status_code, error=text, headers=response.headers)
raise ApiException(
status_code=response.status_code, error=text, headers=response.headers
)
Loading

0 comments on commit c7e339f

Please sign in to comment.