Skip to content

Commit

Permalink
chore: applied code prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
tiwarishubham635 committed Nov 16, 2023
1 parent f9e006b commit 10edc86
Show file tree
Hide file tree
Showing 6 changed files with 165 additions and 165 deletions.
2 changes: 1 addition & 1 deletion src/base/RequestClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class RequestClient {
if (
options.headers["Content-Type"] === "application/x-www-form-urlencoded"
) {
options.data = qs.stringify(opts.data, { arrayFormat: "repeat" });
options.data = qs.stringify(opts.data, { arrayFormat: "repeat" });
} else if (options.headers["Content-Type"] === "application/json") {
options.data = opts.data;
}
Expand Down
14 changes: 7 additions & 7 deletions src/rest/PreviewMessaging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import PreviewMessagingBase from "./PreviewMessagingBase";
import { MessageListInstance } from "./previewMessaging/v1/message";

class PreviewMessaging extends PreviewMessagingBase {
/**
* @deprecated - Use v1.messages; instead
*/
get messages(): MessageListInstance {
console.warn("messages is deprecated. Use v1.messages; instead.");
return this.v1.messages;
}
/**
* @deprecated - Use v1.messages; instead
*/
get messages(): MessageListInstance {
console.warn("messages is deprecated. Use v1.messages; instead.");
return this.v1.messages;
}
}
export = PreviewMessaging;
26 changes: 13 additions & 13 deletions src/rest/PreviewMessagingBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ import Domain from "../base/Domain";
import V1 from "./previewMessaging/V1";

class PreviewMessagingBase extends Domain {
_v1?: V1;
_v1?: V1;

/**
* Initialize accounts domain
*
* @param twilio - The twilio client
*/
constructor(twilio: any) {
super(twilio, "https://preview.messaging.twilio.com");
}
/**
* Initialize accounts domain
*
* @param twilio - The twilio client
*/
constructor(twilio: any) {
super(twilio, "https://preview.messaging.twilio.com");
}

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

export = PreviewMessagingBase;
44 changes: 22 additions & 22 deletions src/rest/previewMessaging/V1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,29 @@ import { BroadcastListInstance } from "./v1/broadcast";
import { MessageListInstance } from "./v1/message";

export default class V1 extends Version {
/**
* Initialize the V1 version of PreviewMessaging
*
* @param domain - The Twilio (Twilio.PreviewMessaging) domain
*/
constructor(domain: PreviewMessagingBase) {
super(domain, "v1");
}
/**
* Initialize the V1 version of PreviewMessaging
*
* @param domain - The Twilio (Twilio.PreviewMessaging) domain
*/
constructor(domain: PreviewMessagingBase) {
super(domain, "v1");
}

/** broadcasts - { Twilio.PreviewMessaging.V1.BroadcastListInstance } resource */
protected _broadcasts?: BroadcastListInstance;
/** messages - { Twilio.PreviewMessaging.V1.MessageListInstance } resource */
protected _messages?: MessageListInstance;
/** broadcasts - { Twilio.PreviewMessaging.V1.BroadcastListInstance } resource */
protected _broadcasts?: BroadcastListInstance;
/** messages - { Twilio.PreviewMessaging.V1.MessageListInstance } resource */
protected _messages?: MessageListInstance;

/** Getter for broadcasts resource */
get broadcasts(): BroadcastListInstance {
this._broadcasts = this._broadcasts || BroadcastListInstance(this);
return this._broadcasts;
}
/** Getter for broadcasts resource */
get broadcasts(): BroadcastListInstance {
this._broadcasts = this._broadcasts || BroadcastListInstance(this);
return this._broadcasts;
}

/** Getter for messages resource */
get messages(): MessageListInstance {
this._messages = this._messages || MessageListInstance(this);
return this._messages;
}
/** Getter for messages resource */
get messages(): MessageListInstance {
this._messages = this._messages || MessageListInstance(this);
return this._messages;
}
}
70 changes: 35 additions & 35 deletions src/rest/previewMessaging/v1/broadcast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,34 @@ import { isValidPathParam } from "../../../base/utility";
* Details on the statuses of messages sent to recipients
*/
export class MessagingV1BroadcastExecutionDetails {
/**
* Number of recipients in the Broadcast request
*/
"totalRecords"?: number;
/**
* Number of recipients with messages successfully sent to them
*/
"totalCompleted"?: number;
/**
* Number of recipients with messages unsuccessfully sent to them, producing an error
*/
"totalErrors"?: number;
/**
* Number of recipients in the Broadcast request
*/
"totalRecords"?: number;
/**
* Number of recipients with messages successfully sent to them
*/
"totalCompleted"?: number;
/**
* Number of recipients with messages unsuccessfully sent to them, producing an error
*/
"totalErrors"?: number;
}

/**
* Options to pass to create a BroadcastInstance
*/
export interface BroadcastListInstanceCreateOptions {
/** Idempotency key provided by the client */
xTwilioRequestKey?: string;
/** Idempotency key provided by the client */
xTwilioRequestKey?: string;
}

export interface BroadcastSolution {}

export interface BroadcastListInstance {
_version: V1;
_solution: BroadcastSolution;
_uri: string;
_version: V1;
_solution: BroadcastSolution;
_uri: string;

/**
* Create a BroadcastInstance
Expand Down Expand Up @@ -137,32 +137,32 @@ export function BroadcastListInstance(version: V1): BroadcastListInstance {
return inspect(instance.toJSON(), options);
};

return instance;
return instance;
}

interface BroadcastPayload extends BroadcastResource {}

interface BroadcastResource {
broadcast_sid: string;
created_date: Date;
updated_date: Date;
broadcast_status: string;
execution_details: MessagingV1BroadcastExecutionDetails;
errors_file: string;
broadcast_sid: string;
created_date: Date;
updated_date: Date;
broadcast_status: string;
execution_details: MessagingV1BroadcastExecutionDetails;
errors_file: string;
}

/**
* Details of a Broadcast
*/
export class BroadcastInstance {
constructor(protected _version: V1, payload: BroadcastResource) {
this.broadcastSid = payload.broadcast_sid;
this.createdDate = deserialize.iso8601DateTime(payload.created_date);
this.updatedDate = deserialize.iso8601DateTime(payload.updated_date);
this.broadcastStatus = payload.broadcast_status;
this.executionDetails = payload.execution_details;
this.errorsFile = payload.errors_file;
}
constructor(protected _version: V1, payload: BroadcastResource) {
this.broadcastSid = payload.broadcast_sid;
this.createdDate = deserialize.iso8601DateTime(payload.created_date);
this.updatedDate = deserialize.iso8601DateTime(payload.updated_date);
this.broadcastStatus = payload.broadcast_status;
this.executionDetails = payload.execution_details;
this.errorsFile = payload.errors_file;
}

/**
* Numeric ID indentifying individual Broadcast requests
Expand Down Expand Up @@ -202,7 +202,7 @@ export class BroadcastInstance {
};
}

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

0 comments on commit 10edc86

Please sign in to comment.