Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/5.0.0-rc' into 5.0.0-rc
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/base/RequestClient.ts
#	src/rest/PreviewMessaging.ts
#	src/rest/PreviewMessagingBase.ts
#	src/rest/previewMessaging/V1.ts
#	src/rest/previewMessaging/v1/broadcast.ts
#	src/rest/previewMessaging/v1/message.ts
  • Loading branch information
tiwarishubham635 committed Nov 13, 2023
2 parents a50e8f0 + 33140aa commit c8ab68a
Show file tree
Hide file tree
Showing 3 changed files with 238 additions and 234 deletions.
4 changes: 4 additions & 0 deletions src/rest/PreviewMessagingBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import Domain from "../base/Domain";
import V1 from "./previewMessaging/V1";

class PreviewMessagingBase extends Domain {
_v1?: V1;

/**
* Initialize accounts domain
*
Expand All @@ -21,9 +23,11 @@ class PreviewMessagingBase extends Domain {
constructor(twilio: any) {
super(twilio, "https://preview.messaging.twilio.com");
}

get v1(): V1 {
this._v1 = this._v1 || new V1(this);
return this._v1;
}
}

export = PreviewMessagingBase;
236 changes: 118 additions & 118 deletions src/rest/previewMessaging/v1/broadcast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,91 +51,91 @@ export interface BroadcastListInstance {
_solution: BroadcastSolution;
_uri: string;

/**
* Create a BroadcastInstance
*
* @param callback - Callback to handle processed record
*
* @returns Resolves to processed BroadcastInstance
*/
create(
callback?: (error: Error | null, item?: BroadcastInstance) => any
): Promise<BroadcastInstance>;
/**
* Create a BroadcastInstance
*
* @param params - Parameter for request
* @param callback - Callback to handle processed record
*
* @returns Resolves to processed BroadcastInstance
*/
create(
params: BroadcastListInstanceCreateOptions,
callback?: (error: Error | null, item?: BroadcastInstance) => any
): Promise<BroadcastInstance>;

/**
* Provide a user-friendly representation
*/
toJSON(): any;
[inspect.custom](_depth: any, options: InspectOptions): any;
/**
* Create a BroadcastInstance
*
* @param callback - Callback to handle processed record
*
* @returns Resolves to processed BroadcastInstance
*/
create(
callback?: (error: Error | null, item?: BroadcastInstance) => any
): Promise<BroadcastInstance>;
/**
* Create a BroadcastInstance
*
* @param params - Parameter for request
* @param callback - Callback to handle processed record
*
* @returns Resolves to processed BroadcastInstance
*/
create(
params: BroadcastListInstanceCreateOptions,
callback?: (error: Error | null, item?: BroadcastInstance) => any
): Promise<BroadcastInstance>;

/**
* Provide a user-friendly representation
*/
toJSON(): any;
[inspect.custom](_depth: any, options: InspectOptions): any;
}

export function BroadcastListInstance(version: V1): BroadcastListInstance {
const instance = {} as BroadcastListInstance;

instance._version = version;
instance._solution = {};
instance._uri = `/Broadcasts`;

instance.create = function create(
params?:
| BroadcastListInstanceCreateOptions
| ((error: Error | null, items: BroadcastInstance) => any),
callback?: (error: Error | null, items: BroadcastInstance) => any
): Promise<BroadcastInstance> {
if (params instanceof Function) {
callback = params;
params = {};
} else {
params = params || {};
}

let data: any = {};

const headers: any = {};
if (params["xTwilioRequestKey"] !== undefined)
headers["X-Twilio-Request-Key"] = params["xTwilioRequestKey"];

let operationVersion = version,
operationPromise = operationVersion.create({
uri: instance._uri,
method: "post",
data,
headers,
});

operationPromise = operationPromise.then(
(payload) => new BroadcastInstance(operationVersion, payload)
);

operationPromise = instance._version.setPromiseCallback(
operationPromise,
callback
);
return operationPromise;
};
const instance = {} as BroadcastListInstance;

instance._version = version;
instance._solution = {};
instance._uri = `/Broadcasts`;

instance.create = function create(
params?:
| BroadcastListInstanceCreateOptions
| ((error: Error | null, items: BroadcastInstance) => any),
callback?: (error: Error | null, items: BroadcastInstance) => any
): Promise<BroadcastInstance> {
if (params instanceof Function) {
callback = params;
params = {};
} else {
params = params || {};
}

instance.toJSON = function toJSON() {
return instance._solution;
};

instance[inspect.custom] = function inspectImpl(
_depth: any,
options: InspectOptions
) {
return inspect(instance.toJSON(), options);
};
let data: any = {};

const headers: any = {};
if (params["xTwilioRequestKey"] !== undefined)
headers["X-Twilio-Request-Key"] = params["xTwilioRequestKey"];

let operationVersion = version,
operationPromise = operationVersion.create({
uri: instance._uri,
method: "post",
data,
headers,
});

operationPromise = operationPromise.then(
(payload) => new BroadcastInstance(operationVersion, payload)
);

operationPromise = instance._version.setPromiseCallback(
operationPromise,
callback
);
return operationPromise;
};

instance.toJSON = function toJSON() {
return instance._solution;
};

instance[inspect.custom] = function inspectImpl(
_depth: any,
options: InspectOptions
) {
return inspect(instance.toJSON(), options);
};

return instance;
}
Expand Down Expand Up @@ -164,43 +164,43 @@ export class BroadcastInstance {
this.errorsFile = payload.errors_file;
}

/**
* Numeric ID indentifying individual Broadcast requests
*/
broadcastSid: string;
/**
* Timestamp of when the Broadcast was created
*/
createdDate: Date;
/**
* Timestamp of when the Broadcast was last updated
*/
updatedDate: Date;
/**
* Status of the Broadcast request. Valid values are None, Pending-Upload, Uploaded, Queued, Executing, Execution-Failure, Execution-Completed, Cancelation-Requested, and Canceled
*/
broadcastStatus: string;
executionDetails: MessagingV1BroadcastExecutionDetails;
/**
* Path to a file detailing errors from Broadcast execution
*/
errorsFile: string;

/**
* Provide a user-friendly representation
*
* @returns Object
*/
toJSON() {
return {
broadcastSid: this.broadcastSid,
createdDate: this.createdDate,
updatedDate: this.updatedDate,
broadcastStatus: this.broadcastStatus,
executionDetails: this.executionDetails,
errorsFile: this.errorsFile,
};
}
/**
* Numeric ID indentifying individual Broadcast requests
*/
broadcastSid: string;
/**
* Timestamp of when the Broadcast was created
*/
createdDate: Date;
/**
* Timestamp of when the Broadcast was last updated
*/
updatedDate: Date;
/**
* Status of the Broadcast request. Valid values are None, Pending-Upload, Uploaded, Queued, Executing, Execution-Failure, Execution-Completed, Cancelation-Requested, and Canceled
*/
broadcastStatus: string;
executionDetails: MessagingV1BroadcastExecutionDetails;
/**
* Path to a file detailing errors from Broadcast execution
*/
errorsFile: string;

/**
* Provide a user-friendly representation
*
* @returns Object
*/
toJSON() {
return {
broadcastSid: this.broadcastSid,
createdDate: this.createdDate,
updatedDate: this.updatedDate,
broadcastStatus: this.broadcastStatus,
executionDetails: this.executionDetails,
errorsFile: this.errorsFile,
};
}

[inspect.custom](_depth: any, options: InspectOptions) {
return inspect(this.toJSON(), options);
Expand Down
Loading

0 comments on commit c8ab68a

Please sign in to comment.