From 1e313a84c7d50d5e81734edbe16a52b1a7d28b24 Mon Sep 17 00:00:00 2001 From: Ajevan M Date: Thu, 30 Jan 2025 14:28:43 -0500 Subject: [PATCH 1/4] Update SDK with latest spec changes --- .openapi-generator/FILES | 2 + CHANGELOG.md | 5 +- README.md | 4 +- __tests__/models/AccountResult.spec.ts | 3 +- __tests__/models/CallResult.spec.ts | 4 +- __tests__/models/ConferenceResult.spec.ts | 3 +- __tests__/models/MessageResult.spec.ts | 27 ++++ __tests__/models/QueueResult.spec.ts | 3 +- __tests__/models/TFNCampaign.spec.ts | 78 ++++++++++ models/MessageResult.ts | 46 ++++++ models/MessageResultAllOfTfn.ts | 58 ++++++++ models/ObjectSerializer.ts | 6 + models/TFNCampaign.ts | 166 ++++++++++++++++++++++ models/all.ts | 2 + openapi.json | 71 +++++++++ package.json | 2 +- types/ObjectParamAPI.ts | 2 + types/ObservableAPI.ts | 2 + types/PromiseAPI.ts | 2 + 19 files changed, 478 insertions(+), 8 deletions(-) create mode 100644 __tests__/models/TFNCampaign.spec.ts create mode 100644 models/MessageResultAllOfTfn.ts create mode 100644 models/TFNCampaign.ts diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 7f01e9b..53ca485 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -79,6 +79,7 @@ models/MessageDeliveryWebhook.ts models/MessageDirection.ts models/MessageRequest.ts models/MessageResult.ts +models/MessageResultAllOfTfn.ts models/MessageStatus.ts models/MessageStatusWebhook.ts models/MessagesList.ts @@ -139,6 +140,7 @@ models/SetTalk.ts models/Sms.ts models/StartRecordCall.ts models/TFN.ts +models/TFNCampaign.ts models/TerminateConference.ts models/TranscribeReason.ts models/TranscribeTermReason.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index ba3b739..ee68667 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,14 +14,17 @@ None ## [4.0.0] - 2025-01-08 ### Added + - Webhook classes - More idiomated Enum management ### Changed + - Use upgraded openapi generator ### Removed -- *AllOf model files + +- \*AllOf model files diff --git a/README.md b/README.md index bc68368..483b23f 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,9 @@ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-g ## Installing ```sh -npm install @freeclimb/sdk@4.0.0 +npm install @freeclimb/sdk@4.1.0 or -yarn add @freeclimb/sdk@4.0.0 +yarn add @freeclimb/sdk@4.1.0 ``` ## Getting Started diff --git a/__tests__/models/AccountResult.spec.ts b/__tests__/models/AccountResult.spec.ts index 884ba74..5bed6bc 100644 --- a/__tests__/models/AccountResult.spec.ts +++ b/__tests__/models/AccountResult.spec.ts @@ -85,7 +85,8 @@ describe("AccountResult", () => { describe(".subresourceUris", () => { it("resolves to particular value on initialization", () => { const value = {}; - expect(model.subresourceUris).toStrictEqual(value); + const receivedValue: any = model.subresourceUris; + expect(receivedValue).toStrictEqual(value); }); }); }); diff --git a/__tests__/models/CallResult.spec.ts b/__tests__/models/CallResult.spec.ts index 07f24fc..4fee26f 100644 --- a/__tests__/models/CallResult.spec.ts +++ b/__tests__/models/CallResult.spec.ts @@ -25,6 +25,7 @@ describe("CallResult", () => { answeredBy: freeclimb.AnsweredBy.HUMAN, subresourceUris: {}, + applicationId: "test_applicationId", }); describe("CallResult class test", () => { @@ -143,7 +144,8 @@ describe("CallResult", () => { describe(".subresourceUris", () => { it("resolves to particular value on initialization", () => { const value = {}; - expect(model.subresourceUris).toStrictEqual(value); + const receivedValue: any = model.subresourceUris; + expect(receivedValue).toStrictEqual(value); }); }); describe(".applicationId", () => { diff --git a/__tests__/models/ConferenceResult.spec.ts b/__tests__/models/ConferenceResult.spec.ts index 1824258..c23dd27 100644 --- a/__tests__/models/ConferenceResult.spec.ts +++ b/__tests__/models/ConferenceResult.spec.ts @@ -106,7 +106,8 @@ describe("ConferenceResult", () => { describe(".subresourceUris", () => { it("resolves to particular value on initialization", () => { const value = {}; - expect(model.subresourceUris).toStrictEqual(value); + const receivedValue: any = model.subresourceUris; + expect(receivedValue).toStrictEqual(value); }); }); }); diff --git a/__tests__/models/MessageResult.spec.ts b/__tests__/models/MessageResult.spec.ts index 159f0f8..66ef6bb 100644 --- a/__tests__/models/MessageResult.spec.ts +++ b/__tests__/models/MessageResult.spec.ts @@ -20,6 +20,12 @@ describe("MessageResult", () => { campaignId: "test_campaignId", segmentCount: 1.0, mediaUrls: [], + tfn: { + campaignId: "cmptfn_387ec3f6e03b340553f35f29c8f118cdf3eae08a", + }, + + phoneNumberId: "test_phoneNumberId", + applicationId: "test_applicationId", }); describe("MessageResult class test", () => { it("resolves to the class type upon initialization", () => { @@ -122,4 +128,25 @@ describe("MessageResult", () => { expect(model.mediaUrls).toStrictEqual(value); }); }); + describe(".tfn", () => { + it("resolves to particular value on initialization", () => { + const value = { + campaignId: "cmptfn_387ec3f6e03b340553f35f29c8f118cdf3eae08a", + }; + const receivedValue: any = model.tfn; + expect(receivedValue).toStrictEqual(value); + }); + }); + describe(".phoneNumberId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_phoneNumberId"; + expect(model.phoneNumberId).toBe(value); + }); + }); + describe(".applicationId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_applicationId"; + expect(model.applicationId).toBe(value); + }); + }); }); diff --git a/__tests__/models/QueueResult.spec.ts b/__tests__/models/QueueResult.spec.ts index 6a7ba4c..5d7e86c 100644 --- a/__tests__/models/QueueResult.spec.ts +++ b/__tests__/models/QueueResult.spec.ts @@ -83,7 +83,8 @@ describe("QueueResult", () => { describe(".subresourceUris", () => { it("resolves to particular value on initialization", () => { const value = {}; - expect(model.subresourceUris).toStrictEqual(value); + const receivedValue: any = model.subresourceUris; + expect(receivedValue).toStrictEqual(value); }); }); }); diff --git a/__tests__/models/TFNCampaign.spec.ts b/__tests__/models/TFNCampaign.spec.ts new file mode 100644 index 0000000..7e895da --- /dev/null +++ b/__tests__/models/TFNCampaign.spec.ts @@ -0,0 +1,78 @@ +import * as freeclimb from "../../index"; +import { describe, expect, it } from "@jest/globals"; + +describe("TFNCampaign", () => { + let model: freeclimb.TFNCampaign = new freeclimb.TFNCampaign({ + accountId: "test_accountId", + campaignId: "test_campaignId", + + useCase: "test_useCase", + + registrationStatus: + freeclimb.SMSTollFreeCampaignRegistrationStatus.UNREGISTERED, + dateCreated: "test_dateCreated", + dateUpdated: "test_dateUpdated", + dateCreatedISO: "test_dateCreatedISO", + dateUpdatedISO: "test_dateUpdatedISO", + revision: 1, + }); + describe("TFNCampaign class test", () => { + it("resolves to the class type upon initialization", () => { + expect(model).toBeInstanceOf(freeclimb.TFNCampaign); + }); + }); + describe(".accountId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_accountId"; + expect(model.accountId).toBe(value); + }); + }); + describe(".campaignId", () => { + it("resolves to particular value on initialization", () => { + const value = "test_campaignId"; + expect(model.campaignId).toBe(value); + }); + }); + describe(".useCase", () => { + it("resolves to particular value on initialization", () => { + const value = "test_useCase"; + expect(model.useCase).toBe(value); + }); + }); + describe(".registrationStatus", () => { + it("resolves to particular value on initialization", () => { + const value = "UNREGISTERED"; + expect(model.registrationStatus).toBe(value); + }); + }); + describe(".dateCreated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateCreated"; + expect(model.dateCreated).toBe(value); + }); + }); + describe(".dateUpdated", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateUpdated"; + expect(model.dateUpdated).toBe(value); + }); + }); + describe(".dateCreatedISO", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateCreatedISO"; + expect(model.dateCreatedISO).toBe(value); + }); + }); + describe(".dateUpdatedISO", () => { + it("resolves to particular value on initialization", () => { + const value = "test_dateUpdatedISO"; + expect(model.dateUpdatedISO).toBe(value); + }); + }); + describe(".revision", () => { + it("resolves to particular value on initialization", () => { + const value = 1; + expect(model.revision).toBe(value); + }); + }); +}); diff --git a/models/MessageResult.ts b/models/MessageResult.ts index 0d815d7..ae78580 100644 --- a/models/MessageResult.ts +++ b/models/MessageResult.ts @@ -10,6 +10,7 @@ * Do not edit the class manually. */ +import { MessageResultAllOfTfn } from "./../models/MessageResultAllOfTfn"; import { MessageStatus } from "./../models/MessageStatus"; import { HttpFile } from "../http/http"; @@ -37,6 +38,9 @@ interface ArgumentsType { campaignId?: string; segmentCount?: number; mediaUrls?: Array; + tfn?: MessageResultAllOfTfn; + phoneNumberId?: string; + applicationId?: string; } export class MessageResult { /** @@ -100,6 +104,15 @@ export class MessageResult { * an array of HTTP URLs which were attached this this message */ "mediaUrls"?: Array; + "tfn"?: MessageResultAllOfTfn; + /** + * String that uniquely identifies the phoneNumber resource used to send this Message + */ + "phoneNumberId"?: string; + /** + * String that uniquely identifies the Application resource used to send this Message + */ + "applicationId"?: string; static readonly discriminator: string | undefined = undefined; @@ -230,6 +243,30 @@ export class MessageResult { type: "Array", format: "uri", + defaultValue: undefined, + }, + { + name: "tfn", + baseName: "tfn", + type: "MessageResultAllOfTfn", + format: "", + + defaultValue: undefined, + }, + { + name: "phoneNumberId", + baseName: "phoneNumberId", + type: "string", + format: "", + + defaultValue: undefined, + }, + { + name: "applicationId", + baseName: "applicationId", + type: "string", + format: "", + defaultValue: undefined, }, ]; @@ -291,5 +328,14 @@ export class MessageResult { if (args["mediaUrls"]) { this["mediaUrls"] = assign>("mediaUrls"); } + if (args["tfn"]) { + this["tfn"] = assign("tfn"); + } + if (args["phoneNumberId"]) { + this["phoneNumberId"] = assign("phoneNumberId"); + } + if (args["applicationId"]) { + this["applicationId"] = assign("applicationId"); + } } } diff --git a/models/MessageResultAllOfTfn.ts b/models/MessageResultAllOfTfn.ts new file mode 100644 index 0000000..e24a93a --- /dev/null +++ b/models/MessageResultAllOfTfn.ts @@ -0,0 +1,58 @@ +/** + * FreeClimb API + * FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + * + * OpenAPI spec version: 1.0.0 + * Contact: support@freeclimb.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from "../http/http"; + +interface AttributeType { + name: string; + baseName: string; + type: string; + format: string; + defaultValue: any; +} +interface ArgumentsType { + campaignId: string; +} +export class MessageResultAllOfTfn { + /** + * TFNCampaignId + */ + "campaignId": string; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: AttributeType[] = [ + { + name: "campaignId", + baseName: "campaignId", + type: "string", + format: "", + + defaultValue: undefined, + }, + ]; + + static getAttributeTypeMap(): AttributeType[] { + return MessageResultAllOfTfn.attributeTypeMap; + } + public constructor(args: ArgumentsType) { + const assign = (attribute: keyof ArgumentsType): T => { + return (args[attribute] ?? + MessageResultAllOfTfn.attributeTypeMap.find( + (attr) => attr.name === attribute, + )?.defaultValue) as T; + }; + if (args["campaignId"]) { + this["campaignId"] = assign("campaignId"); + } + } +} diff --git a/models/ObjectSerializer.ts b/models/ObjectSerializer.ts index 7400c2f..b9ebfd7 100644 --- a/models/ObjectSerializer.ts +++ b/models/ObjectSerializer.ts @@ -65,6 +65,7 @@ export * from "./MessageDeliveryWebhook"; export * from "./MessageDirection"; export * from "./MessageRequest"; export * from "./MessageResult"; +export * from "./MessageResultAllOfTfn"; export * from "./MessageStatus"; export * from "./MessageStatusWebhook"; export * from "./MessagesList"; @@ -124,6 +125,7 @@ export * from "./SetTalk"; export * from "./Sms"; export * from "./StartRecordCall"; export * from "./TFN"; +export * from "./TFNCampaign"; export * from "./TerminateConference"; export * from "./TranscribeReason"; export * from "./TranscribeTermReason"; @@ -205,6 +207,7 @@ import { MessageDeliveryWebhook } from "./MessageDeliveryWebhook"; import { MessageDirection } from "./MessageDirection"; import { MessageRequest } from "./MessageRequest"; import { MessageResult } from "./MessageResult"; +import { MessageResultAllOfTfn } from "./MessageResultAllOfTfn"; import { MessageStatus } from "./MessageStatus"; import { MessageStatusWebhook } from "./MessageStatusWebhook"; import { MessagesList } from "./MessagesList"; @@ -264,6 +267,7 @@ import { SetTalk } from "./SetTalk"; import { Sms } from "./Sms"; import { StartRecordCall } from "./StartRecordCall"; import { TFN } from "./TFN"; +import { TFNCampaign } from "./TFNCampaign"; import { TerminateConference } from "./TerminateConference"; import { TranscribeReason } from "./TranscribeReason"; import { TranscribeTermReason } from "./TranscribeTermReason"; @@ -384,6 +388,7 @@ let typeMap: { [index: string]: any } = { MessageDeliveryWebhook: MessageDeliveryWebhook, MessageRequest: MessageRequest, MessageResult: MessageResult, + MessageResultAllOfTfn: MessageResultAllOfTfn, MessageStatusWebhook: MessageStatusWebhook, MessagesList: MessagesList, MutableResourceModel: MutableResourceModel, @@ -430,6 +435,7 @@ let typeMap: { [index: string]: any } = { Sms: Sms, StartRecordCall: StartRecordCall, TFN: TFN, + TFNCampaign: TFNCampaign, TerminateConference: TerminateConference, TranscribeUtterance: TranscribeUtterance, TranscribeUtteranceRecord: TranscribeUtteranceRecord, diff --git a/models/TFNCampaign.ts b/models/TFNCampaign.ts new file mode 100644 index 0000000..8eaa5ce --- /dev/null +++ b/models/TFNCampaign.ts @@ -0,0 +1,166 @@ +/** + * FreeClimb API + * FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + * + * OpenAPI spec version: 1.0.0 + * Contact: support@freeclimb.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { SMSTollFreeCampaignRegistrationStatus } from "./../models/SMSTollFreeCampaignRegistrationStatus"; +import { HttpFile } from "../http/http"; + +interface AttributeType { + name: string; + baseName: string; + type: string; + format: string; + defaultValue: any; +} +interface ArgumentsType { + accountId: string; + campaignId: string; + useCase: string; + registrationStatus: SMSTollFreeCampaignRegistrationStatus; + dateCreated: string; + dateUpdated: string; + dateCreatedISO: string; + dateUpdatedISO: string; + revision: number; +} +export class TFNCampaign { + /** + * ID of the account that created this participant. + */ + "accountId": string; + /** + * TFNCampaignId + */ + "campaignId": string; + "useCase": string; + "registrationStatus": SMSTollFreeCampaignRegistrationStatus; + "dateCreated": string; + "dateUpdated": string; + "dateCreatedISO": string; + "dateUpdatedISO": string; + "revision": number; + + static readonly discriminator: string | undefined = undefined; + + static readonly attributeTypeMap: AttributeType[] = [ + { + name: "accountId", + baseName: "accountId", + type: "string", + format: "", + + defaultValue: undefined, + }, + { + name: "campaignId", + baseName: "campaignId", + type: "string", + format: "", + + defaultValue: undefined, + }, + { + name: "useCase", + baseName: "useCase", + type: "string", + format: "", + + defaultValue: undefined, + }, + { + name: "registrationStatus", + baseName: "registrationStatus", + type: "SMSTollFreeCampaignRegistrationStatus", + format: "", + + defaultValue: undefined, + }, + { + name: "dateCreated", + baseName: "dateCreated", + type: "string", + format: "", + + defaultValue: undefined, + }, + { + name: "dateUpdated", + baseName: "dateUpdated", + type: "string", + format: "", + + defaultValue: undefined, + }, + { + name: "dateCreatedISO", + baseName: "dateCreatedISO", + type: "string", + format: "", + + defaultValue: undefined, + }, + { + name: "dateUpdatedISO", + baseName: "dateUpdatedISO", + type: "string", + format: "", + + defaultValue: undefined, + }, + { + name: "revision", + baseName: "revision", + type: "number", + format: "", + + defaultValue: undefined, + }, + ]; + + static getAttributeTypeMap(): AttributeType[] { + return TFNCampaign.attributeTypeMap; + } + public constructor(args: ArgumentsType) { + const assign = (attribute: keyof ArgumentsType): T => { + return (args[attribute] ?? + TFNCampaign.attributeTypeMap.find((attr) => attr.name === attribute) + ?.defaultValue) as T; + }; + if (args["accountId"]) { + this["accountId"] = assign("accountId"); + } + if (args["campaignId"]) { + this["campaignId"] = assign("campaignId"); + } + if (args["useCase"]) { + this["useCase"] = assign("useCase"); + } + if (args["registrationStatus"]) { + this["registrationStatus"] = + assign("registrationStatus"); + } + if (args["dateCreated"]) { + this["dateCreated"] = assign("dateCreated"); + } + if (args["dateUpdated"]) { + this["dateUpdated"] = assign("dateUpdated"); + } + if (args["dateCreatedISO"]) { + this["dateCreatedISO"] = assign("dateCreatedISO"); + } + if (args["dateUpdatedISO"]) { + this["dateUpdatedISO"] = assign("dateUpdatedISO"); + } + if (args["revision"]) { + this["revision"] = assign("revision"); + } + } +} diff --git a/models/all.ts b/models/all.ts index a1e2fd1..775f75a 100644 --- a/models/all.ts +++ b/models/all.ts @@ -65,6 +65,7 @@ export * from "./MessageDeliveryWebhook"; export * from "./MessageDirection"; export * from "./MessageRequest"; export * from "./MessageResult"; +export * from "./MessageResultAllOfTfn"; export * from "./MessageStatus"; export * from "./MessageStatusWebhook"; export * from "./MessagesList"; @@ -124,6 +125,7 @@ export * from "./SetTalk"; export * from "./Sms"; export * from "./StartRecordCall"; export * from "./TFN"; +export * from "./TFNCampaign"; export * from "./TerminateConference"; export * from "./TranscribeReason"; export * from "./TranscribeTermReason"; diff --git a/openapi.json b/openapi.json index 368e14e..7b369b9 100644 --- a/openapi.json +++ b/openapi.json @@ -3586,11 +3586,82 @@ "format": "uri" }, "nullable": true + }, + "tfn": { + "type": "object", + "required": ["campaignId"], + "properties": { + "campaignId": { + "$ref": "#/components/schemas/TFNCampaignId" + } + }, + "nullable": true + }, + "phoneNumberId": { + "type": "string", + "description": "String that uniquely identifies the phoneNumber resource used to send this Message", + "nullable": true + }, + "applicationId": { + "type": "string", + "description": "String that uniquely identifies the Application resource used to send this Message", + "nullable": true } } } ] }, + "TFNCampaign": { + "type": "object", + "required": [ + "accountId", + "campaignId", + "useCase", + "registrationStatus", + "dateCreated", + "dateUpdated", + "dateCreatedISO", + "dateUpdatedISO", + "revision" + ], + "properties": { + "accountId": { + "type": "string", + "description": "ID of the account that created this participant.", + "nullable": true + }, + "campaignId": { + "$ref": "#/components/schemas/TFNCampaignId" + }, + "useCase": { + "type": "string" + }, + "registrationStatus": { + "$ref": "#/components/schemas/SMSTollFreeCampaignRegistrationStatus" + }, + "dateCreated": { + "type": "string" + }, + "dateUpdated": { + "type": "string" + }, + "dateCreatedISO": { + "type": "string" + }, + "dateUpdatedISO": { + "type": "string" + }, + "revision": { + "type": "integer" + } + } + }, + "TFNCampaignId": { + "type": "string", + "description": "TFNCampaignId", + "pattern": "cmptfn_[a-fA-F0-9]{40}", + "example": "cmptfn_387ec3f6e03b340553f35f29c8f118cdf3eae08a" + }, "CreateConferenceRequest": { "type": "object", "properties": { diff --git a/package.json b/package.json index 88884fe..6aace06 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@freeclimb/sdk", - "version": "4.0.0", + "version": "4.1.0", "description": "OpenAPI client for @freeclimb/sdk", "author": "OpenAPI-Generator Contributors", "keywords": [ diff --git a/types/ObjectParamAPI.ts b/types/ObjectParamAPI.ts index 6839f23..550eeca 100644 --- a/types/ObjectParamAPI.ts +++ b/types/ObjectParamAPI.ts @@ -69,6 +69,7 @@ import { MessageDeliveryWebhook } from "../models/MessageDeliveryWebhook"; import { MessageDirection } from "../models/MessageDirection"; import { MessageRequest } from "../models/MessageRequest"; import { MessageResult } from "../models/MessageResult"; +import { MessageResultAllOfTfn } from "../models/MessageResultAllOfTfn"; import { MessageStatus } from "../models/MessageStatus"; import { MessageStatusWebhook } from "../models/MessageStatusWebhook"; import { MessagesList } from "../models/MessagesList"; @@ -128,6 +129,7 @@ import { SetTalk } from "../models/SetTalk"; import { Sms } from "../models/Sms"; import { StartRecordCall } from "../models/StartRecordCall"; import { TFN } from "../models/TFN"; +import { TFNCampaign } from "../models/TFNCampaign"; import { TerminateConference } from "../models/TerminateConference"; import { TranscribeReason } from "../models/TranscribeReason"; import { TranscribeTermReason } from "../models/TranscribeTermReason"; diff --git a/types/ObservableAPI.ts b/types/ObservableAPI.ts index 66645a5..2f9af95 100644 --- a/types/ObservableAPI.ts +++ b/types/ObservableAPI.ts @@ -70,6 +70,7 @@ import { MessageDeliveryWebhook } from "../models/MessageDeliveryWebhook"; import { MessageDirection } from "../models/MessageDirection"; import { MessageRequest } from "../models/MessageRequest"; import { MessageResult } from "../models/MessageResult"; +import { MessageResultAllOfTfn } from "../models/MessageResultAllOfTfn"; import { MessageStatus } from "../models/MessageStatus"; import { MessageStatusWebhook } from "../models/MessageStatusWebhook"; import { MessagesList } from "../models/MessagesList"; @@ -129,6 +130,7 @@ import { SetTalk } from "../models/SetTalk"; import { Sms } from "../models/Sms"; import { StartRecordCall } from "../models/StartRecordCall"; import { TFN } from "../models/TFN"; +import { TFNCampaign } from "../models/TFNCampaign"; import { TerminateConference } from "../models/TerminateConference"; import { TranscribeReason } from "../models/TranscribeReason"; import { TranscribeTermReason } from "../models/TranscribeTermReason"; diff --git a/types/PromiseAPI.ts b/types/PromiseAPI.ts index 34f3940..d9d74ea 100644 --- a/types/PromiseAPI.ts +++ b/types/PromiseAPI.ts @@ -69,6 +69,7 @@ import { MessageDeliveryWebhook } from "../models/MessageDeliveryWebhook"; import { MessageDirection } from "../models/MessageDirection"; import { MessageRequest } from "../models/MessageRequest"; import { MessageResult } from "../models/MessageResult"; +import { MessageResultAllOfTfn } from "../models/MessageResultAllOfTfn"; import { MessageStatus } from "../models/MessageStatus"; import { MessageStatusWebhook } from "../models/MessageStatusWebhook"; import { MessagesList } from "../models/MessagesList"; @@ -128,6 +129,7 @@ import { SetTalk } from "../models/SetTalk"; import { Sms } from "../models/Sms"; import { StartRecordCall } from "../models/StartRecordCall"; import { TFN } from "../models/TFN"; +import { TFNCampaign } from "../models/TFNCampaign"; import { TerminateConference } from "../models/TerminateConference"; import { TranscribeReason } from "../models/TranscribeReason"; import { TranscribeTermReason } from "../models/TranscribeTermReason"; From 2976986ccb09924e5a7d130ab8c03b4a36307837 Mon Sep 17 00:00:00 2001 From: Ajevan M Date: Fri, 31 Jan 2025 16:59:30 -0500 Subject: [PATCH 2/4] Fix spec for TFN property in MessageResult --- .openapi-generator/FILES | 1 - __tests__/models/MessageResult.spec.ts | 15 ++++--- models/MessageResult.ts | 10 ++--- models/MessageResultAllOfTfn.ts | 58 -------------------------- models/ObjectSerializer.ts | 3 -- models/all.ts | 1 - openapi.json | 8 +--- types/ObjectParamAPI.ts | 1 - types/ObservableAPI.ts | 1 - types/PromiseAPI.ts | 1 - 10 files changed, 13 insertions(+), 86 deletions(-) delete mode 100644 models/MessageResultAllOfTfn.ts diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 53ca485..48da1ae 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -79,7 +79,6 @@ models/MessageDeliveryWebhook.ts models/MessageDirection.ts models/MessageRequest.ts models/MessageResult.ts -models/MessageResultAllOfTfn.ts models/MessageStatus.ts models/MessageStatusWebhook.ts models/MessagesList.ts diff --git a/__tests__/models/MessageResult.spec.ts b/__tests__/models/MessageResult.spec.ts index 66ef6bb..0c8073b 100644 --- a/__tests__/models/MessageResult.spec.ts +++ b/__tests__/models/MessageResult.spec.ts @@ -20,10 +20,10 @@ describe("MessageResult", () => { campaignId: "test_campaignId", segmentCount: 1.0, mediaUrls: [], - tfn: { - campaignId: "cmptfn_387ec3f6e03b340553f35f29c8f118cdf3eae08a", - }, + tfn: new freeclimb.TFN({ + campaignId: null as any, + }), phoneNumberId: "test_phoneNumberId", applicationId: "test_applicationId", }); @@ -130,11 +130,10 @@ describe("MessageResult", () => { }); describe(".tfn", () => { it("resolves to particular value on initialization", () => { - const value = { - campaignId: "cmptfn_387ec3f6e03b340553f35f29c8f118cdf3eae08a", - }; - const receivedValue: any = model.tfn; - expect(receivedValue).toStrictEqual(value); + const value = new freeclimb.TFN({ + campaignId: null as any, + }); + expect(model.tfn).toStrictEqual(value); }); }); describe(".phoneNumberId", () => { diff --git a/models/MessageResult.ts b/models/MessageResult.ts index ae78580..2f99ac4 100644 --- a/models/MessageResult.ts +++ b/models/MessageResult.ts @@ -10,8 +10,8 @@ * Do not edit the class manually. */ -import { MessageResultAllOfTfn } from "./../models/MessageResultAllOfTfn"; import { MessageStatus } from "./../models/MessageStatus"; +import { TFN } from "./../models/TFN"; import { HttpFile } from "../http/http"; interface AttributeType { @@ -38,7 +38,7 @@ interface ArgumentsType { campaignId?: string; segmentCount?: number; mediaUrls?: Array; - tfn?: MessageResultAllOfTfn; + tfn?: TFN; phoneNumberId?: string; applicationId?: string; } @@ -104,7 +104,7 @@ export class MessageResult { * an array of HTTP URLs which were attached this this message */ "mediaUrls"?: Array; - "tfn"?: MessageResultAllOfTfn; + "tfn"?: TFN; /** * String that uniquely identifies the phoneNumber resource used to send this Message */ @@ -248,7 +248,7 @@ export class MessageResult { { name: "tfn", baseName: "tfn", - type: "MessageResultAllOfTfn", + type: "TFN", format: "", defaultValue: undefined, @@ -329,7 +329,7 @@ export class MessageResult { this["mediaUrls"] = assign>("mediaUrls"); } if (args["tfn"]) { - this["tfn"] = assign("tfn"); + this["tfn"] = assign("tfn"); } if (args["phoneNumberId"]) { this["phoneNumberId"] = assign("phoneNumberId"); diff --git a/models/MessageResultAllOfTfn.ts b/models/MessageResultAllOfTfn.ts deleted file mode 100644 index e24a93a..0000000 --- a/models/MessageResultAllOfTfn.ts +++ /dev/null @@ -1,58 +0,0 @@ -/** - * FreeClimb API - * FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - * - * OpenAPI spec version: 1.0.0 - * Contact: support@freeclimb.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { HttpFile } from "../http/http"; - -interface AttributeType { - name: string; - baseName: string; - type: string; - format: string; - defaultValue: any; -} -interface ArgumentsType { - campaignId: string; -} -export class MessageResultAllOfTfn { - /** - * TFNCampaignId - */ - "campaignId": string; - - static readonly discriminator: string | undefined = undefined; - - static readonly attributeTypeMap: AttributeType[] = [ - { - name: "campaignId", - baseName: "campaignId", - type: "string", - format: "", - - defaultValue: undefined, - }, - ]; - - static getAttributeTypeMap(): AttributeType[] { - return MessageResultAllOfTfn.attributeTypeMap; - } - public constructor(args: ArgumentsType) { - const assign = (attribute: keyof ArgumentsType): T => { - return (args[attribute] ?? - MessageResultAllOfTfn.attributeTypeMap.find( - (attr) => attr.name === attribute, - )?.defaultValue) as T; - }; - if (args["campaignId"]) { - this["campaignId"] = assign("campaignId"); - } - } -} diff --git a/models/ObjectSerializer.ts b/models/ObjectSerializer.ts index b9ebfd7..ca13ae3 100644 --- a/models/ObjectSerializer.ts +++ b/models/ObjectSerializer.ts @@ -65,7 +65,6 @@ export * from "./MessageDeliveryWebhook"; export * from "./MessageDirection"; export * from "./MessageRequest"; export * from "./MessageResult"; -export * from "./MessageResultAllOfTfn"; export * from "./MessageStatus"; export * from "./MessageStatusWebhook"; export * from "./MessagesList"; @@ -207,7 +206,6 @@ import { MessageDeliveryWebhook } from "./MessageDeliveryWebhook"; import { MessageDirection } from "./MessageDirection"; import { MessageRequest } from "./MessageRequest"; import { MessageResult } from "./MessageResult"; -import { MessageResultAllOfTfn } from "./MessageResultAllOfTfn"; import { MessageStatus } from "./MessageStatus"; import { MessageStatusWebhook } from "./MessageStatusWebhook"; import { MessagesList } from "./MessagesList"; @@ -388,7 +386,6 @@ let typeMap: { [index: string]: any } = { MessageDeliveryWebhook: MessageDeliveryWebhook, MessageRequest: MessageRequest, MessageResult: MessageResult, - MessageResultAllOfTfn: MessageResultAllOfTfn, MessageStatusWebhook: MessageStatusWebhook, MessagesList: MessagesList, MutableResourceModel: MutableResourceModel, diff --git a/models/all.ts b/models/all.ts index 775f75a..70ecbca 100644 --- a/models/all.ts +++ b/models/all.ts @@ -65,7 +65,6 @@ export * from "./MessageDeliveryWebhook"; export * from "./MessageDirection"; export * from "./MessageRequest"; export * from "./MessageResult"; -export * from "./MessageResultAllOfTfn"; export * from "./MessageStatus"; export * from "./MessageStatusWebhook"; export * from "./MessagesList"; diff --git a/openapi.json b/openapi.json index 7b369b9..0302013 100644 --- a/openapi.json +++ b/openapi.json @@ -3588,13 +3588,7 @@ "nullable": true }, "tfn": { - "type": "object", - "required": ["campaignId"], - "properties": { - "campaignId": { - "$ref": "#/components/schemas/TFNCampaignId" - } - }, + "$ref": "#/components/schemas/TFN", "nullable": true }, "phoneNumberId": { diff --git a/types/ObjectParamAPI.ts b/types/ObjectParamAPI.ts index 550eeca..da93909 100644 --- a/types/ObjectParamAPI.ts +++ b/types/ObjectParamAPI.ts @@ -69,7 +69,6 @@ import { MessageDeliveryWebhook } from "../models/MessageDeliveryWebhook"; import { MessageDirection } from "../models/MessageDirection"; import { MessageRequest } from "../models/MessageRequest"; import { MessageResult } from "../models/MessageResult"; -import { MessageResultAllOfTfn } from "../models/MessageResultAllOfTfn"; import { MessageStatus } from "../models/MessageStatus"; import { MessageStatusWebhook } from "../models/MessageStatusWebhook"; import { MessagesList } from "../models/MessagesList"; diff --git a/types/ObservableAPI.ts b/types/ObservableAPI.ts index 2f9af95..8a08eaa 100644 --- a/types/ObservableAPI.ts +++ b/types/ObservableAPI.ts @@ -70,7 +70,6 @@ import { MessageDeliveryWebhook } from "../models/MessageDeliveryWebhook"; import { MessageDirection } from "../models/MessageDirection"; import { MessageRequest } from "../models/MessageRequest"; import { MessageResult } from "../models/MessageResult"; -import { MessageResultAllOfTfn } from "../models/MessageResultAllOfTfn"; import { MessageStatus } from "../models/MessageStatus"; import { MessageStatusWebhook } from "../models/MessageStatusWebhook"; import { MessagesList } from "../models/MessagesList"; diff --git a/types/PromiseAPI.ts b/types/PromiseAPI.ts index d9d74ea..f9d60aa 100644 --- a/types/PromiseAPI.ts +++ b/types/PromiseAPI.ts @@ -69,7 +69,6 @@ import { MessageDeliveryWebhook } from "../models/MessageDeliveryWebhook"; import { MessageDirection } from "../models/MessageDirection"; import { MessageRequest } from "../models/MessageRequest"; import { MessageResult } from "../models/MessageResult"; -import { MessageResultAllOfTfn } from "../models/MessageResultAllOfTfn"; import { MessageStatus } from "../models/MessageStatus"; import { MessageStatusWebhook } from "../models/MessageStatusWebhook"; import { MessagesList } from "../models/MessagesList"; From 28faebd31887a6747b0329d7e842e0f42b9c3957 Mon Sep 17 00:00:00 2001 From: Ajevan M Date: Mon, 3 Feb 2025 14:00:46 -0500 Subject: [PATCH 3/4] Add changelog entry to SDK PR --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee68667..8d32637 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,14 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm None + + +## [4.1.0] - 2025-01-08 + +### Added + +- CampaignTFN and MessageResultsAllOfTfn models + ## [4.0.0] - 2025-01-08 From de1937f781e5727eb95ef3f5d8cb44e4bf82ef9a Mon Sep 17 00:00:00 2001 From: Ajevan M Date: Wed, 5 Feb 2025 17:33:55 -0500 Subject: [PATCH 4/4] Update latest changelog entry date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d32637..4e5f9cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ None -## [4.1.0] - 2025-01-08 +## [4.1.0] - 2025-02-05 ### Added