Skip to content

Commit

Permalink
Merge pull request #458 from HubSpot/feature/AutomationActionsUpCodeg…
Browse files Browse the repository at this point in the history
…enVersion

Up codegenerator version to 7.2.0: Automation Actions API
  • Loading branch information
ksvirkou-hubspot authored Jan 30, 2024
2 parents 19ed9ea + 24f9b83 commit 5cd7a30
Show file tree
Hide file tree
Showing 16 changed files with 851 additions and 123 deletions.
14 changes: 7 additions & 7 deletions codegen/automation/actions/apis/CallbacksApi.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// TODO: better import syntax?
import {BaseAPIRequestFactory, RequiredError} from './baseapi';
import {Configuration} from '../configuration';
import {RequestContext, HttpMethod, ResponseContext} from '../http/http';
import {RequestContext, HttpMethod, ResponseContext, HttpInfo} from '../http/http';
import {ObjectSerializer} from '../models/ObjectSerializer';
import {ApiException} from './exception';
import { isCodeInRange} from '../util';
Expand Down Expand Up @@ -129,10 +129,10 @@ export class CallbacksApiResponseProcessor {
* @params response Response returned by the server for a request to complete
* @throws ApiException if the response code was not in [200, 299]
*/
public async complete(response: ResponseContext): Promise<void > {
public async completeWithHttpInfo(response: ResponseContext): Promise<HttpInfo<void >> {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("204", response.httpStatusCode)) {
return;
return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined);
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: Error = ObjectSerializer.deserialize(
Expand All @@ -148,7 +148,7 @@ export class CallbacksApiResponseProcessor {
ObjectSerializer.parse(await response.body.text(), contentType),
"void", ""
) as void;
return body;
return new HttpInfo(response.httpStatusCode, response.headers, response.body, body);
}

throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
Expand All @@ -161,10 +161,10 @@ export class CallbacksApiResponseProcessor {
* @params response Response returned by the server for a request to completeBatch
* @throws ApiException if the response code was not in [200, 299]
*/
public async completeBatch(response: ResponseContext): Promise<void > {
public async completeBatchWithHttpInfo(response: ResponseContext): Promise<HttpInfo<void >> {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("204", response.httpStatusCode)) {
return;
return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined);
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: Error = ObjectSerializer.deserialize(
Expand All @@ -180,7 +180,7 @@ export class CallbacksApiResponseProcessor {
ObjectSerializer.parse(await response.body.text(), contentType),
"void", ""
) as void;
return body;
return new HttpInfo(response.httpStatusCode, response.headers, response.body, body);
}

throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
Expand Down
32 changes: 16 additions & 16 deletions codegen/automation/actions/apis/DefinitionsApi.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// TODO: better import syntax?
import {BaseAPIRequestFactory, RequiredError} from './baseapi';
import {Configuration} from '../configuration';
import {RequestContext, HttpMethod, ResponseContext} from '../http/http';
import {RequestContext, HttpMethod, ResponseContext, HttpInfo} from '../http/http';
import {ObjectSerializer} from '../models/ObjectSerializer';
import {ApiException} from './exception';
import { isCodeInRange} from '../util';
Expand Down Expand Up @@ -302,10 +302,10 @@ export class DefinitionsApiResponseProcessor {
* @params response Response returned by the server for a request to archive
* @throws ApiException if the response code was not in [200, 299]
*/
public async archive(response: ResponseContext): Promise<void > {
public async archiveWithHttpInfo(response: ResponseContext): Promise<HttpInfo<void >> {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("204", response.httpStatusCode)) {
return;
return new HttpInfo(response.httpStatusCode, response.headers, response.body, undefined);
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: Error = ObjectSerializer.deserialize(
Expand All @@ -321,7 +321,7 @@ export class DefinitionsApiResponseProcessor {
ObjectSerializer.parse(await response.body.text(), contentType),
"void", ""
) as void;
return body;
return new HttpInfo(response.httpStatusCode, response.headers, response.body, body);
}

throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
Expand All @@ -334,14 +334,14 @@ export class DefinitionsApiResponseProcessor {
* @params response Response returned by the server for a request to create
* @throws ApiException if the response code was not in [200, 299]
*/
public async create(response: ResponseContext): Promise<PublicActionDefinition > {
public async createWithHttpInfo(response: ResponseContext): Promise<HttpInfo<PublicActionDefinition >> {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("201", response.httpStatusCode)) {
const body: PublicActionDefinition = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"PublicActionDefinition", ""
) as PublicActionDefinition;
return body;
return new HttpInfo(response.httpStatusCode, response.headers, response.body, body);
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: Error = ObjectSerializer.deserialize(
Expand All @@ -357,7 +357,7 @@ export class DefinitionsApiResponseProcessor {
ObjectSerializer.parse(await response.body.text(), contentType),
"PublicActionDefinition", ""
) as PublicActionDefinition;
return body;
return new HttpInfo(response.httpStatusCode, response.headers, response.body, body);
}

throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
Expand All @@ -370,14 +370,14 @@ export class DefinitionsApiResponseProcessor {
* @params response Response returned by the server for a request to getById
* @throws ApiException if the response code was not in [200, 299]
*/
public async getById(response: ResponseContext): Promise<PublicActionDefinition > {
public async getByIdWithHttpInfo(response: ResponseContext): Promise<HttpInfo<PublicActionDefinition >> {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: PublicActionDefinition = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"PublicActionDefinition", ""
) as PublicActionDefinition;
return body;
return new HttpInfo(response.httpStatusCode, response.headers, response.body, body);
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: Error = ObjectSerializer.deserialize(
Expand All @@ -393,7 +393,7 @@ export class DefinitionsApiResponseProcessor {
ObjectSerializer.parse(await response.body.text(), contentType),
"PublicActionDefinition", ""
) as PublicActionDefinition;
return body;
return new HttpInfo(response.httpStatusCode, response.headers, response.body, body);
}

throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
Expand All @@ -406,14 +406,14 @@ export class DefinitionsApiResponseProcessor {
* @params response Response returned by the server for a request to getPage
* @throws ApiException if the response code was not in [200, 299]
*/
public async getPage(response: ResponseContext): Promise<CollectionResponsePublicActionDefinitionForwardPaging > {
public async getPageWithHttpInfo(response: ResponseContext): Promise<HttpInfo<CollectionResponsePublicActionDefinitionForwardPaging >> {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: CollectionResponsePublicActionDefinitionForwardPaging = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"CollectionResponsePublicActionDefinitionForwardPaging", ""
) as CollectionResponsePublicActionDefinitionForwardPaging;
return body;
return new HttpInfo(response.httpStatusCode, response.headers, response.body, body);
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: Error = ObjectSerializer.deserialize(
Expand All @@ -429,7 +429,7 @@ export class DefinitionsApiResponseProcessor {
ObjectSerializer.parse(await response.body.text(), contentType),
"CollectionResponsePublicActionDefinitionForwardPaging", ""
) as CollectionResponsePublicActionDefinitionForwardPaging;
return body;
return new HttpInfo(response.httpStatusCode, response.headers, response.body, body);
}

throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
Expand All @@ -442,14 +442,14 @@ export class DefinitionsApiResponseProcessor {
* @params response Response returned by the server for a request to update
* @throws ApiException if the response code was not in [200, 299]
*/
public async update(response: ResponseContext): Promise<PublicActionDefinition > {
public async updateWithHttpInfo(response: ResponseContext): Promise<HttpInfo<PublicActionDefinition >> {
const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: PublicActionDefinition = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"PublicActionDefinition", ""
) as PublicActionDefinition;
return body;
return new HttpInfo(response.httpStatusCode, response.headers, response.body, body);
}
if (isCodeInRange("0", response.httpStatusCode)) {
const body: Error = ObjectSerializer.deserialize(
Expand All @@ -465,7 +465,7 @@ export class DefinitionsApiResponseProcessor {
ObjectSerializer.parse(await response.body.text(), contentType),
"PublicActionDefinition", ""
) as PublicActionDefinition;
return body;
return new HttpInfo(response.httpStatusCode, response.headers, response.body, body);
}

throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
Expand Down
Loading

0 comments on commit 5cd7a30

Please sign in to comment.