Skip to content

Commit

Permalink
Avoid optional properties on responses where possible (#921)
Browse files Browse the repository at this point in the history
  • Loading branch information
frederikprijck authored Aug 28, 2023
1 parent 2efc2b5 commit f695697
Show file tree
Hide file tree
Showing 7 changed files with 1,860 additions and 955 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import type { InitOverride, ApiResponse } from '../../../lib/runtime.js';
import type {
EmailTemplateUpdate,
GetEmailTemplatesByTemplateName200Response,
PatchEmailTemplatesByTemplateNameRequest,
PostEmailTemplatesRequest,
GetEmailTemplatesByTemplateNameRequest,
PatchEmailTemplatesByTemplateNameRequest,
PatchEmailTemplatesByTemplateNameOperationRequest,
PutEmailTemplatesByTemplateNameRequest,
} from '../models/index.js';

Expand Down Expand Up @@ -48,8 +49,8 @@ export class EmailTemplatesManager extends BaseAPI {
* @throws {RequiredError}
*/
async update(
requestParameters: PatchEmailTemplatesByTemplateNameRequest,
bodyParameters: GetEmailTemplatesByTemplateName200Response,
requestParameters: PatchEmailTemplatesByTemplateNameOperationRequest,
bodyParameters: PatchEmailTemplatesByTemplateNameRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<GetEmailTemplatesByTemplateName200Response>> {
runtime.validateRequiredRequestParams(requestParameters, ['templateName']);
Expand Down
21 changes: 10 additions & 11 deletions src/management/__generated/managers/guardian-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ import type {
PutFactorsByName200Response,
PutFactorsByNameRequest,
PutFcmRequest,
PutMessageTypesRequest,
PutPhoneProvidersRequest,
PutPnProvidersRequest,
PutSns200Response,
PutSnsRequest,
PutTwilio200Response,
PutTwilioRequest,
SnsFactorProvider,
TemplateMessages,
Expand Down Expand Up @@ -388,7 +387,7 @@ export class GuardianManager extends BaseAPI {
async updatePushNotificationProviderSNS(
bodyParameters: PutSnsRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<PutSnsRequest>> {
): Promise<ApiResponse<PutSns200Response>> {
const headerParameters: runtime.HTTPHeaders = {};

headerParameters['Content-Type'] = 'application/json';
Expand Down Expand Up @@ -581,7 +580,7 @@ export class GuardianManager extends BaseAPI {
* @throws {RequiredError}
*/
async updatePhoneFactorMessageTypes(
bodyParameters: PutMessageTypesRequest,
bodyParameters: GetMessageTypes200Response,
initOverrides?: InitOverride
): Promise<ApiResponse<GetMessageTypes200Response>> {
const headerParameters: runtime.HTTPHeaders = {};
Expand All @@ -607,7 +606,7 @@ export class GuardianManager extends BaseAPI {
* @throws {RequiredError}
*/
async updatePhoneFactorSelectedProvider(
bodyParameters: PutPhoneProvidersRequest,
bodyParameters: GetPhoneProviders200Response,
initOverrides?: InitOverride
): Promise<ApiResponse<GetPhoneProviders200Response>> {
const headerParameters: runtime.HTTPHeaders = {};
Expand All @@ -633,7 +632,7 @@ export class GuardianManager extends BaseAPI {
* @throws {RequiredError}
*/
async setPushNotificationSelectedProvider(
bodyParameters: PutPnProvidersRequest,
bodyParameters: GetPnProviders200Response,
initOverrides?: InitOverride
): Promise<ApiResponse<GetPnProviders200Response>> {
const headerParameters: runtime.HTTPHeaders = {};
Expand Down Expand Up @@ -692,7 +691,7 @@ export class GuardianManager extends BaseAPI {
* @throws {RequiredError}
*/
async setSmsSelectedProvider(
bodyParameters: PutPhoneProvidersRequest,
bodyParameters: GetPhoneProviders200Response,
initOverrides?: InitOverride
): Promise<ApiResponse<GetPhoneProviders200Response>> {
const headerParameters: runtime.HTTPHeaders = {};
Expand Down Expand Up @@ -723,7 +722,7 @@ export class GuardianManager extends BaseAPI {
async setSmsFactorProviderTwilio(
bodyParameters: PutTwilioRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<PutTwilioRequest>> {
): Promise<ApiResponse<PutTwilio200Response>> {
const headerParameters: runtime.HTTPHeaders = {};

headerParameters['Content-Type'] = 'application/json';
Expand All @@ -750,7 +749,7 @@ export class GuardianManager extends BaseAPI {
async setPushNotificationProviderSNS(
bodyParameters: PutSnsRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<PutSnsRequest>> {
): Promise<ApiResponse<PutSns200Response>> {
const headerParameters: runtime.HTTPHeaders = {};

headerParameters['Content-Type'] = 'application/json';
Expand All @@ -777,7 +776,7 @@ export class GuardianManager extends BaseAPI {
async updatePhoneFactorProviderTwilio(
bodyParameters: PutTwilioRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<PutTwilioRequest>> {
): Promise<ApiResponse<PutTwilio200Response>> {
const headerParameters: runtime.HTTPHeaders = {};

headerParameters['Content-Type'] = 'application/json';
Expand Down
Loading

0 comments on commit f695697

Please sign in to comment.