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
36 changes: 25 additions & 11 deletions codegen/Oauth/Api/TokensApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,17 @@ public function getConfig()
* @param string|null $client_id client_id (optional)
* @param string|null $client_secret client_secret (optional)
* @param string|null $refresh_token refresh_token (optional)
* @param string|null $code_verifier code_verifier (optional)
* @param string|null $scope scope (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation
*
* @throws \HubSpot\Client\Oauth\ApiException on non-2xx response or if the response body is not in the expected format
* @throws \InvalidArgumentException
* @return \HubSpot\Client\Oauth\Model\TokenResponseIF|\HubSpot\Client\Oauth\Model\Error
*/
public function create($grant_type = null, $code = null, $redirect_uri = null, $client_id = null, $client_secret = null, $refresh_token = null, string $contentType = self::contentTypes['create'][0])
public function create($grant_type = null, $code = null, $redirect_uri = null, $client_id = null, $client_secret = null, $refresh_token = null, $code_verifier = null, $scope = null, string $contentType = self::contentTypes['create'][0])
{
list($response) = $this->createWithHttpInfo($grant_type, $code, $redirect_uri, $client_id, $client_secret, $refresh_token, $contentType);
list($response) = $this->createWithHttpInfo($grant_type, $code, $redirect_uri, $client_id, $client_secret, $refresh_token, $code_verifier, $scope, $contentType);
return $response;
}

Expand All @@ -159,15 +161,17 @@ public function create($grant_type = null, $code = null, $redirect_uri = null, $
* @param string|null $client_id (optional)
* @param string|null $client_secret (optional)
* @param string|null $refresh_token (optional)
* @param string|null $code_verifier (optional)
* @param string|null $scope (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation
*
* @throws \HubSpot\Client\Oauth\ApiException on non-2xx response or if the response body is not in the expected format
* @throws \InvalidArgumentException
* @return array of \HubSpot\Client\Oauth\Model\TokenResponseIF|\HubSpot\Client\Oauth\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function createWithHttpInfo($grant_type = null, $code = null, $redirect_uri = null, $client_id = null, $client_secret = null, $refresh_token = null, string $contentType = self::contentTypes['create'][0])
public function createWithHttpInfo($grant_type = null, $code = null, $redirect_uri = null, $client_id = null, $client_secret = null, $refresh_token = null, $code_verifier = null, $scope = null, string $contentType = self::contentTypes['create'][0])
{
$request = $this->createRequest($grant_type, $code, $redirect_uri, $client_id, $client_secret, $refresh_token, $contentType);
$request = $this->createRequest($grant_type, $code, $redirect_uri, $client_id, $client_secret, $refresh_token, $code_verifier, $scope, $contentType);

try {
$options = $this->createHttpClientOption();
Expand Down Expand Up @@ -207,7 +211,7 @@ public function createWithHttpInfo($grant_type = null, $code = null, $redirect_u
);
}



if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
Expand Down Expand Up @@ -246,7 +250,7 @@ public function createWithHttpInfo($grant_type = null, $code = null, $redirect_u
$e->setResponseObject($data);
throw $e;
}


throw $e;
}
Expand All @@ -263,14 +267,16 @@ public function createWithHttpInfo($grant_type = null, $code = null, $redirect_u
* @param string|null $client_id (optional)
* @param string|null $client_secret (optional)
* @param string|null $refresh_token (optional)
* @param string|null $code_verifier (optional)
* @param string|null $scope (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function createAsync($grant_type = null, $code = null, $redirect_uri = null, $client_id = null, $client_secret = null, $refresh_token = null, string $contentType = self::contentTypes['create'][0])
public function createAsync($grant_type = null, $code = null, $redirect_uri = null, $client_id = null, $client_secret = null, $refresh_token = null, $code_verifier = null, $scope = null, string $contentType = self::contentTypes['create'][0])
{
return $this->createAsyncWithHttpInfo($grant_type, $code, $redirect_uri, $client_id, $client_secret, $refresh_token, $contentType)
return $this->createAsyncWithHttpInfo($grant_type, $code, $redirect_uri, $client_id, $client_secret, $refresh_token, $code_verifier, $scope, $contentType)
->then(
function ($response) {
return $response[0];
Expand All @@ -289,15 +295,17 @@ function ($response) {
* @param string|null $client_id (optional)
* @param string|null $client_secret (optional)
* @param string|null $refresh_token (optional)
* @param string|null $code_verifier (optional)
* @param string|null $scope (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function createAsyncWithHttpInfo($grant_type = null, $code = null, $redirect_uri = null, $client_id = null, $client_secret = null, $refresh_token = null, string $contentType = self::contentTypes['create'][0])
public function createAsyncWithHttpInfo($grant_type = null, $code = null, $redirect_uri = null, $client_id = null, $client_secret = null, $refresh_token = null, $code_verifier = null, $scope = null, string $contentType = self::contentTypes['create'][0])
{
$returnType = '\HubSpot\Client\Oauth\Model\TokenResponseIF';
$request = $this->createRequest($grant_type, $code, $redirect_uri, $client_id, $client_secret, $refresh_token, $contentType);
$request = $this->createRequest($grant_type, $code, $redirect_uri, $client_id, $client_secret, $refresh_token, $code_verifier, $scope, $contentType);

return $this->client
->sendAsync($request, $this->createHttpClientOption())
Expand Down Expand Up @@ -344,12 +352,14 @@ function ($exception) {
* @param string|null $client_id (optional)
* @param string|null $client_secret (optional)
* @param string|null $refresh_token (optional)
* @param string|null $code_verifier (optional)
* @param string|null $scope (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
public function createRequest($grant_type = null, $code = null, $redirect_uri = null, $client_id = null, $client_secret = null, $refresh_token = null, string $contentType = self::contentTypes['create'][0])
public function createRequest($grant_type = null, $code = null, $redirect_uri = null, $client_id = null, $client_secret = null, $refresh_token = null, $code_verifier = null, $scope = null, string $contentType = self::contentTypes['create'][0])
{


Expand All @@ -359,6 +369,8 @@ public function createRequest($grant_type = null, $code = null, $redirect_uri =





$resourcePath = '/oauth/v1/token';
$formParams = [];
$queryParams = [];
Expand All @@ -379,6 +391,8 @@ public function createRequest($grant_type = null, $code = null, $redirect_uri =
'client_id' => $client_id,
'client_secret' => $client_secret,
'refresh_token' => $refresh_token,
'code_verifier' => $code_verifier,
'scope' => $scope,
]);

$formParams = $formDataProcessor->flatten($formData);
Expand Down
2 changes: 1 addition & 1 deletion codegen/Oauth/Model/AccessTokenInfoResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ public function getScopes()
/**
* Sets scopes
*
* @param string[] $scopes scopes
* @param string[] $scopes An array of strings indicating the scopes
*
* @return self
*/
Expand Down
2 changes: 1 addition & 1 deletion codegen/Oauth/Model/RefreshTokenInfoResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ public function getScopes()
/**
* Sets scopes
*
* @param string[] $scopes scopes
* @param string[] $scopes An array of strings detailing the scopes
*
* @return self
*/
Expand Down
44 changes: 39 additions & 5 deletions codegen/Oauth/Model/TokenResponseIF.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class TokenResponseIF implements ModelInterface, ArrayAccess, \JsonSerializable
*/
protected static $openAPITypes = [
'access_token' => 'string',
'refresh_token' => 'string',
'expires_in' => 'int',
'hub_id' => 'int',
'id_token' => 'string',
Expand All @@ -75,6 +76,7 @@ class TokenResponseIF implements ModelInterface, ArrayAccess, \JsonSerializable
*/
protected static $openAPIFormats = [
'access_token' => null,
'refresh_token' => null,
'expires_in' => 'int64',
'hub_id' => 'int32',
'id_token' => null,
Expand All @@ -90,6 +92,7 @@ class TokenResponseIF implements ModelInterface, ArrayAccess, \JsonSerializable
*/
protected static array $openAPINullables = [
'access_token' => false,
'refresh_token' => false,
'expires_in' => false,
'hub_id' => false,
'id_token' => false,
Expand Down Expand Up @@ -184,12 +187,13 @@ public function isNullableSetToNull(string $property): bool
* @var string[]
*/
protected static $attributeMap = [
'access_token' => 'accessToken',
'expires_in' => 'expiresIn',
'hub_id' => 'hubId',
'access_token' => 'access_token',
'refresh_token' => 'refresh_token',
'expires_in' => 'expires_in',
'hub_id' => 'hub_id',
'id_token' => 'idToken',
'scopes' => 'scopes',
'token_type' => 'tokenType',
'token_type' => 'token_type',
'user_id' => 'userId'
];

Expand All @@ -200,6 +204,7 @@ public function isNullableSetToNull(string $property): bool
*/
protected static $setters = [
'access_token' => 'setAccessToken',
'refresh_token' => 'setRefreshToken',
'expires_in' => 'setExpiresIn',
'hub_id' => 'setHubId',
'id_token' => 'setIdToken',
Expand All @@ -215,6 +220,7 @@ public function isNullableSetToNull(string $property): bool
*/
protected static $getters = [
'access_token' => 'getAccessToken',
'refresh_token' => 'getRefreshToken',
'expires_in' => 'getExpiresIn',
'hub_id' => 'getHubId',
'id_token' => 'getIdToken',
Expand Down Expand Up @@ -281,6 +287,7 @@ public function getModelName()
public function __construct(?array $data = null)
{
$this->setIfExists('access_token', $data ?? [], null);
$this->setIfExists('refresh_token', $data ?? [], null);
$this->setIfExists('expires_in', $data ?? [], null);
$this->setIfExists('hub_id', $data ?? [], null);
$this->setIfExists('id_token', $data ?? [], null);
Expand Down Expand Up @@ -358,6 +365,33 @@ public function setAccessToken($access_token)
return $this;
}

/**
* Gets refresh_token
*
* @return string|null
*/
public function getRefreshToken()
{
return $this->container['refresh_token'];
}

/**
* Sets refresh_token
*
* @param string|null $refresh_token refresh_token
*
* @return self
*/
public function setRefreshToken($refresh_token)
{
if (is_null($refresh_token)) {
throw new \InvalidArgumentException('non-nullable refresh_token cannot be null');
}
$this->container['refresh_token'] = $refresh_token;

return $this;
}

/**
* Gets expires_in
*
Expand Down Expand Up @@ -452,7 +486,7 @@ public function getScopes()
/**
* Sets scopes
*
* @param string[]|null $scopes scopes
* @param string[]|null $scopes An array of strings indicating the scopes
*
* @return self
*/
Expand Down
Loading