diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 7f01e9b..48da1ae 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -139,6 +139,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..4e5f9cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,19 +9,30 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm None + + +## [4.1.0] - 2025-02-05 + +### Added + +- CampaignTFN and MessageResultsAllOfTfn models + ## [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..0c8073b 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: new freeclimb.TFN({ + campaignId: null as any, + }), + phoneNumberId: "test_phoneNumberId", + applicationId: "test_applicationId", }); describe("MessageResult class test", () => { it("resolves to the class type upon initialization", () => { @@ -122,4 +128,24 @@ describe("MessageResult", () => { expect(model.mediaUrls).toStrictEqual(value); }); }); + describe(".tfn", () => { + it("resolves to particular value on initialization", () => { + const value = new freeclimb.TFN({ + campaignId: null as any, + }); + expect(model.tfn).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..2f99ac4 100644 --- a/models/MessageResult.ts +++ b/models/MessageResult.ts @@ -11,6 +11,7 @@ */ import { MessageStatus } from "./../models/MessageStatus"; +import { TFN } from "./../models/TFN"; import { HttpFile } from "../http/http"; interface AttributeType { @@ -37,6 +38,9 @@ interface ArgumentsType { campaignId?: string; segmentCount?: number; mediaUrls?: Array; + tfn?: TFN; + 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"?: TFN; + /** + * 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: "TFN", + 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/ObjectSerializer.ts b/models/ObjectSerializer.ts index 7400c2f..ca13ae3 100644 --- a/models/ObjectSerializer.ts +++ b/models/ObjectSerializer.ts @@ -124,6 +124,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"; @@ -264,6 +265,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"; @@ -430,6 +432,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..70ecbca 100644 --- a/models/all.ts +++ b/models/all.ts @@ -124,6 +124,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..0302013 100644 --- a/openapi.json +++ b/openapi.json @@ -3586,11 +3586,76 @@ "format": "uri" }, "nullable": true + }, + "tfn": { + "$ref": "#/components/schemas/TFN", + "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..da93909 100644 --- a/types/ObjectParamAPI.ts +++ b/types/ObjectParamAPI.ts @@ -128,6 +128,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..8a08eaa 100644 --- a/types/ObservableAPI.ts +++ b/types/ObservableAPI.ts @@ -129,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/PromiseAPI.ts b/types/PromiseAPI.ts index 34f3940..f9d60aa 100644 --- a/types/PromiseAPI.ts +++ b/types/PromiseAPI.ts @@ -128,6 +128,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";