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
166 changes: 79 additions & 87 deletions codegen/Marketing/Transactional/Api/PublicSMTPTokensApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
*/

/**
* Marketing Transactional Single Send
* Transactional Single Send
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: v3
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 7.3.0
* Generator version: 7.12.0
*/

/**
Expand Down Expand Up @@ -95,13 +95,13 @@ class PublicSMTPTokensApi
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
*/
public function __construct(
ClientInterface $client = null,
Configuration $config = null,
HeaderSelector $selector = null,
$hostIndex = 0
?ClientInterface $client = null,
?Configuration $config = null,
?HeaderSelector $selector = null,
int $hostIndex = 0
) {
$this->client = $client ?: new Client();
$this->config = $config ?: new Configuration();
$this->config = $config ?: Configuration::getDefaultConfiguration();
$this->headerSelector = $selector ?: new HeaderSelector();
$this->hostIndex = $hostIndex;
}
Expand Down Expand Up @@ -189,18 +189,6 @@ public function archiveTokenWithHttpInfo($token_id, string $contentType = self::

$statusCode = $response->getStatusCode();

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

return [null, $statusCode, $response->getHeaders()];

Expand Down Expand Up @@ -431,18 +419,6 @@ public function createTokenWithHttpInfo($smtp_api_token_request_egg, string $con

$statusCode = $response->getStatusCode();

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

switch($statusCode) {
case 201:
Expand Down Expand Up @@ -501,6 +477,19 @@ public function createTokenWithHttpInfo($smtp_api_token_request_egg, string $con
];
}

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

$returnType = '\HubSpot\Client\Marketing\Transactional\Model\SmtpApiTokenView';
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
Expand Down Expand Up @@ -776,18 +765,6 @@ public function getTokenByIdWithHttpInfo($token_id, string $contentType = self::

$statusCode = $response->getStatusCode();

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

switch($statusCode) {
case 200:
Expand Down Expand Up @@ -846,6 +823,19 @@ public function getTokenByIdWithHttpInfo($token_id, string $contentType = self::
];
}

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

$returnType = '\HubSpot\Client\Marketing\Transactional\Model\SmtpApiTokenView';
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
Expand Down Expand Up @@ -1071,10 +1061,10 @@ public function getTokenByIdRequest($token_id, string $contentType = self::conte
*
* Query SMTP API tokens by campaign name or an emailCampaignId.
*
* @param string $campaign_name A name for the campaign tied to the SMTP API token. (optional)
* @param string $email_campaign_id Identifier assigned to the campaign provided during the token creation. (optional)
* @param string $after Starting point to get the next set of results. (optional)
* @param int $limit Maximum number of tokens to return. (optional)
* @param string|null $campaign_name A name for the campaign tied to the SMTP API token. (optional)
* @param string|null $email_campaign_id Identifier assigned to the campaign provided during the token creation. (optional)
* @param string|null $after Starting point to get the next set of results. (optional)
* @param int|null $limit Maximum number of tokens to return. (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTokensPage'] to see the possible values for this operation
*
* @throws \HubSpot\Client\Marketing\Transactional\ApiException on non-2xx response or if the response body is not in the expected format
Expand All @@ -1092,10 +1082,10 @@ public function getTokensPage($campaign_name = null, $email_campaign_id = null,
*
* Query SMTP API tokens by campaign name or an emailCampaignId.
*
* @param string $campaign_name A name for the campaign tied to the SMTP API token. (optional)
* @param string $email_campaign_id Identifier assigned to the campaign provided during the token creation. (optional)
* @param string $after Starting point to get the next set of results. (optional)
* @param int $limit Maximum number of tokens to return. (optional)
* @param string|null $campaign_name A name for the campaign tied to the SMTP API token. (optional)
* @param string|null $email_campaign_id Identifier assigned to the campaign provided during the token creation. (optional)
* @param string|null $after Starting point to get the next set of results. (optional)
* @param int|null $limit Maximum number of tokens to return. (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTokensPage'] to see the possible values for this operation
*
* @throws \HubSpot\Client\Marketing\Transactional\ApiException on non-2xx response or if the response body is not in the expected format
Expand Down Expand Up @@ -1128,18 +1118,6 @@ public function getTokensPageWithHttpInfo($campaign_name = null, $email_campaign

$statusCode = $response->getStatusCode();

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

switch($statusCode) {
case 200:
Expand Down Expand Up @@ -1198,6 +1176,19 @@ public function getTokensPageWithHttpInfo($campaign_name = null, $email_campaign
];
}

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

$returnType = '\HubSpot\Client\Marketing\Transactional\Model\CollectionResponseSmtpApiTokenViewForwardPaging';
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
Expand Down Expand Up @@ -1254,10 +1245,10 @@ public function getTokensPageWithHttpInfo($campaign_name = null, $email_campaign
*
* Query SMTP API tokens by campaign name or an emailCampaignId.
*
* @param string $campaign_name A name for the campaign tied to the SMTP API token. (optional)
* @param string $email_campaign_id Identifier assigned to the campaign provided during the token creation. (optional)
* @param string $after Starting point to get the next set of results. (optional)
* @param int $limit Maximum number of tokens to return. (optional)
* @param string|null $campaign_name A name for the campaign tied to the SMTP API token. (optional)
* @param string|null $email_campaign_id Identifier assigned to the campaign provided during the token creation. (optional)
* @param string|null $after Starting point to get the next set of results. (optional)
* @param int|null $limit Maximum number of tokens to return. (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTokensPage'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
Expand All @@ -1278,10 +1269,10 @@ function ($response) {
*
* Query SMTP API tokens by campaign name or an emailCampaignId.
*
* @param string $campaign_name A name for the campaign tied to the SMTP API token. (optional)
* @param string $email_campaign_id Identifier assigned to the campaign provided during the token creation. (optional)
* @param string $after Starting point to get the next set of results. (optional)
* @param int $limit Maximum number of tokens to return. (optional)
* @param string|null $campaign_name A name for the campaign tied to the SMTP API token. (optional)
* @param string|null $email_campaign_id Identifier assigned to the campaign provided during the token creation. (optional)
* @param string|null $after Starting point to get the next set of results. (optional)
* @param int|null $limit Maximum number of tokens to return. (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTokensPage'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
Expand Down Expand Up @@ -1331,10 +1322,10 @@ function ($exception) {
/**
* Create request for operation 'getTokensPage'
*
* @param string $campaign_name A name for the campaign tied to the SMTP API token. (optional)
* @param string $email_campaign_id Identifier assigned to the campaign provided during the token creation. (optional)
* @param string $after Starting point to get the next set of results. (optional)
* @param int $limit Maximum number of tokens to return. (optional)
* @param string|null $campaign_name A name for the campaign tied to the SMTP API token. (optional)
* @param string|null $email_campaign_id Identifier assigned to the campaign provided during the token creation. (optional)
* @param string|null $after Starting point to get the next set of results. (optional)
* @param int|null $limit Maximum number of tokens to return. (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTokensPage'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
Expand Down Expand Up @@ -1508,18 +1499,6 @@ public function resetPasswordWithHttpInfo($token_id, string $contentType = self:

$statusCode = $response->getStatusCode();

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

switch($statusCode) {
case 200:
Expand Down Expand Up @@ -1578,6 +1557,19 @@ public function resetPasswordWithHttpInfo($token_id, string $contentType = self:
];
}

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

$returnType = '\HubSpot\Client\Marketing\Transactional\Model\SmtpApiTokenView';
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
Expand Down
39 changes: 20 additions & 19 deletions codegen/Marketing/Transactional/Api/SingleSendApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
*/

/**
* Marketing Transactional Single Send
* Transactional Single Send
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: v3
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 7.3.0
* Generator version: 7.12.0
*/

/**
Expand Down Expand Up @@ -83,13 +83,13 @@ class SingleSendApi
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
*/
public function __construct(
ClientInterface $client = null,
Configuration $config = null,
HeaderSelector $selector = null,
$hostIndex = 0
?ClientInterface $client = null,
?Configuration $config = null,
?HeaderSelector $selector = null,
int $hostIndex = 0
) {
$this->client = $client ?: new Client();
$this->config = $config ?: new Configuration();
$this->config = $config ?: Configuration::getDefaultConfiguration();
$this->headerSelector = $selector ?: new HeaderSelector();
$this->hostIndex = $hostIndex;
}
Expand Down Expand Up @@ -178,18 +178,6 @@ public function sendEmailWithHttpInfo($public_single_send_request_egg, string $c

$statusCode = $response->getStatusCode();

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

switch($statusCode) {
case 200:
Expand Down Expand Up @@ -248,6 +236,19 @@ public function sendEmailWithHttpInfo($public_single_send_request_egg, string $c
];
}

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

$returnType = '\HubSpot\Client\Marketing\Transactional\Model\EmailSendStatusView';
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
Expand Down
Loading