Auto-commit 2026-04-29 16:31
This commit is contained in:
35
node_modules/twilio/lib/rest/iam/V1.d.ts
generated
vendored
Normal file
35
node_modules/twilio/lib/rest/iam/V1.d.ts
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
import IamBase from "../IamBase";
|
||||
import Version from "../../base/Version";
|
||||
import { ApiKeyListInstance } from "./v1/apiKey";
|
||||
import { GetApiKeysListInstance } from "./v1/getApiKeys";
|
||||
import { NewApiKeyListInstance } from "./v1/newApiKey";
|
||||
import { OAuthAppListInstance } from "./v1/oAuthApp";
|
||||
import { TokenListInstance } from "./v1/token";
|
||||
export default class V1 extends Version {
|
||||
/**
|
||||
* Initialize the V1 version of Iam
|
||||
*
|
||||
* @param domain - The Twilio (Twilio.Iam) domain
|
||||
*/
|
||||
constructor(domain: IamBase);
|
||||
/** apiKey - { Twilio.Iam.V1.ApiKeyListInstance } resource */
|
||||
protected _apiKey?: ApiKeyListInstance;
|
||||
/** getApiKeys - { Twilio.Iam.V1.GetApiKeysListInstance } resource */
|
||||
protected _getApiKeys?: GetApiKeysListInstance;
|
||||
/** newApiKey - { Twilio.Iam.V1.NewApiKeyListInstance } resource */
|
||||
protected _newApiKey?: NewApiKeyListInstance;
|
||||
/** oAuthApps - { Twilio.Iam.V1.OAuthAppListInstance } resource */
|
||||
protected _oAuthApps?: OAuthAppListInstance;
|
||||
/** token - { Twilio.Iam.V1.TokenListInstance } resource */
|
||||
protected _token?: TokenListInstance;
|
||||
/** Getter for apiKey resource */
|
||||
get apiKey(): ApiKeyListInstance;
|
||||
/** Getter for getApiKeys resource */
|
||||
get getApiKeys(): GetApiKeysListInstance;
|
||||
/** Getter for newApiKey resource */
|
||||
get newApiKey(): NewApiKeyListInstance;
|
||||
/** Getter for oAuthApps resource */
|
||||
get oAuthApps(): OAuthAppListInstance;
|
||||
/** Getter for token resource */
|
||||
get token(): TokenListInstance;
|
||||
}
|
||||
60
node_modules/twilio/lib/rest/iam/V1.js
generated
vendored
Normal file
60
node_modules/twilio/lib/rest/iam/V1.js
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Iam
|
||||
* This is the public Twilio REST API.
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const Version_1 = __importDefault(require("../../base/Version"));
|
||||
const apiKey_1 = require("./v1/apiKey");
|
||||
const getApiKeys_1 = require("./v1/getApiKeys");
|
||||
const newApiKey_1 = require("./v1/newApiKey");
|
||||
const oAuthApp_1 = require("./v1/oAuthApp");
|
||||
const token_1 = require("./v1/token");
|
||||
class V1 extends Version_1.default {
|
||||
/**
|
||||
* Initialize the V1 version of Iam
|
||||
*
|
||||
* @param domain - The Twilio (Twilio.Iam) domain
|
||||
*/
|
||||
constructor(domain) {
|
||||
super(domain, "v1");
|
||||
}
|
||||
/** Getter for apiKey resource */
|
||||
get apiKey() {
|
||||
this._apiKey = this._apiKey || (0, apiKey_1.ApiKeyListInstance)(this);
|
||||
return this._apiKey;
|
||||
}
|
||||
/** Getter for getApiKeys resource */
|
||||
get getApiKeys() {
|
||||
this._getApiKeys = this._getApiKeys || (0, getApiKeys_1.GetApiKeysListInstance)(this);
|
||||
return this._getApiKeys;
|
||||
}
|
||||
/** Getter for newApiKey resource */
|
||||
get newApiKey() {
|
||||
this._newApiKey = this._newApiKey || (0, newApiKey_1.NewApiKeyListInstance)(this);
|
||||
return this._newApiKey;
|
||||
}
|
||||
/** Getter for oAuthApps resource */
|
||||
get oAuthApps() {
|
||||
this._oAuthApps = this._oAuthApps || (0, oAuthApp_1.OAuthAppListInstance)(this);
|
||||
return this._oAuthApps;
|
||||
}
|
||||
/** Getter for token resource */
|
||||
get token() {
|
||||
this._token = this._token || (0, token_1.TokenListInstance)(this);
|
||||
return this._token;
|
||||
}
|
||||
}
|
||||
exports.default = V1;
|
||||
236
node_modules/twilio/lib/rest/iam/v1/apiKey.d.ts
generated
vendored
Normal file
236
node_modules/twilio/lib/rest/iam/v1/apiKey.d.ts
generated
vendored
Normal file
@@ -0,0 +1,236 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
/**
|
||||
* Options to pass to update a ApiKeyInstance
|
||||
*/
|
||||
export interface ApiKeyContextUpdateOptions {
|
||||
/** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */
|
||||
friendlyName?: string;
|
||||
/** The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). */
|
||||
policy?: any;
|
||||
}
|
||||
export interface ApiKeyContext {
|
||||
/**
|
||||
* Remove a ApiKeyInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a ApiKeyInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean with HTTP metadata
|
||||
*/
|
||||
removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
|
||||
/**
|
||||
* Fetch a ApiKeyInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ApiKeyInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: ApiKeyInstance) => any): Promise<ApiKeyInstance>;
|
||||
/**
|
||||
* Fetch a ApiKeyInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ApiKeyInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ApiKeyInstance>) => any): Promise<ApiResponse<ApiKeyInstance>>;
|
||||
/**
|
||||
* Update a ApiKeyInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ApiKeyInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: ApiKeyInstance) => any): Promise<ApiKeyInstance>;
|
||||
/**
|
||||
* Update a ApiKeyInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ApiKeyInstance
|
||||
*/
|
||||
update(params: ApiKeyContextUpdateOptions, callback?: (error: Error | null, item?: ApiKeyInstance) => any): Promise<ApiKeyInstance>;
|
||||
/**
|
||||
* Update a ApiKeyInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ApiKeyInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ApiKeyInstance>) => any): Promise<ApiResponse<ApiKeyInstance>>;
|
||||
/**
|
||||
* Update a ApiKeyInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ApiKeyInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: ApiKeyContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<ApiKeyInstance>) => any): Promise<ApiResponse<ApiKeyInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface ApiKeyContextSolution {
|
||||
sid: string;
|
||||
}
|
||||
export declare class ApiKeyContextImpl implements ApiKeyContext {
|
||||
protected _version: V1;
|
||||
protected _solution: ApiKeyContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V1, sid: string);
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
|
||||
fetch(callback?: (error: Error | null, item?: ApiKeyInstance) => any): Promise<ApiKeyInstance>;
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ApiKeyInstance>) => any): Promise<ApiResponse<ApiKeyInstance>>;
|
||||
update(params?: ApiKeyContextUpdateOptions | ((error: Error | null, item?: ApiKeyInstance) => any), callback?: (error: Error | null, item?: ApiKeyInstance) => any): Promise<ApiKeyInstance>;
|
||||
updateWithHttpInfo(params?: ApiKeyContextUpdateOptions | ((error: Error | null, item?: ApiResponse<ApiKeyInstance>) => any), callback?: (error: Error | null, item?: ApiResponse<ApiKeyInstance>) => any): Promise<ApiResponse<ApiKeyInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): ApiKeyContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface ApiKeyResource {
|
||||
sid: string;
|
||||
friendly_name: string;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
policy: Record<string, object>;
|
||||
}
|
||||
export declare class ApiKeyInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: ApiKeyContextSolution;
|
||||
protected _context?: ApiKeyContext;
|
||||
constructor(_version: V1, payload: ApiKeyResource, sid?: string);
|
||||
/**
|
||||
* The unique string that we created to identify the Key resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The string that you assigned to describe the resource.
|
||||
*/
|
||||
friendlyName: string;
|
||||
/**
|
||||
* The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* The \\`Policy\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys).
|
||||
*/
|
||||
policy: Record<string, object>;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Remove a ApiKeyInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a ApiKeyInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean with HTTP metadata
|
||||
*/
|
||||
removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
|
||||
/**
|
||||
* Fetch a ApiKeyInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ApiKeyInstance
|
||||
*/
|
||||
fetch(callback?: (error: Error | null, item?: ApiKeyInstance) => any): Promise<ApiKeyInstance>;
|
||||
/**
|
||||
* Fetch a ApiKeyInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ApiKeyInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ApiKeyInstance>) => any): Promise<ApiResponse<ApiKeyInstance>>;
|
||||
/**
|
||||
* Update a ApiKeyInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ApiKeyInstance
|
||||
*/
|
||||
update(callback?: (error: Error | null, item?: ApiKeyInstance) => any): Promise<ApiKeyInstance>;
|
||||
/**
|
||||
* Update a ApiKeyInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ApiKeyInstance
|
||||
*/
|
||||
update(params: ApiKeyContextUpdateOptions, callback?: (error: Error | null, item?: ApiKeyInstance) => any): Promise<ApiKeyInstance>;
|
||||
/**
|
||||
* Update a ApiKeyInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ApiKeyInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ApiKeyInstance>) => any): Promise<ApiResponse<ApiKeyInstance>>;
|
||||
/**
|
||||
* Update a ApiKeyInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ApiKeyInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: ApiKeyContextUpdateOptions, callback?: (error: Error | null, item?: ApiResponse<ApiKeyInstance>) => any): Promise<ApiResponse<ApiKeyInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
friendlyName: string;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
policy: Record<string, object>;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface ApiKeySolution {
|
||||
}
|
||||
export interface ApiKeyListInstance {
|
||||
_version: V1;
|
||||
_solution: ApiKeySolution;
|
||||
_uri: string;
|
||||
(sid: string): ApiKeyContext;
|
||||
get(sid: string): ApiKeyContext;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function ApiKeyListInstance(version: V1): ApiKeyListInstance;
|
||||
export {};
|
||||
256
node_modules/twilio/lib/rest/iam/v1/apiKey.js
generated
vendored
Normal file
256
node_modules/twilio/lib/rest/iam/v1/apiKey.js
generated
vendored
Normal file
@@ -0,0 +1,256 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Iam
|
||||
* This is the public Twilio REST API.
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ApiKeyInstance = exports.ApiKeyContextImpl = void 0;
|
||||
exports.ApiKeyListInstance = ApiKeyListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
const utility_1 = require("../../../base/utility");
|
||||
class ApiKeyContextImpl {
|
||||
constructor(_version, sid) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(sid)) {
|
||||
throw new Error("Parameter 'sid' is not valid.");
|
||||
}
|
||||
this._solution = { sid };
|
||||
this._uri = `/Keys/${sid}`;
|
||||
}
|
||||
remove(callback) {
|
||||
const headers = {};
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.remove({
|
||||
uri: instance._uri,
|
||||
method: "delete",
|
||||
headers,
|
||||
});
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
removeWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// DELETE operation - returns boolean based on status code
|
||||
let operationPromise = operationVersion
|
||||
.removeWithResponseInfo({ uri: instance._uri, method: "delete", headers })
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: response.statusCode === 204,
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetch(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new ApiKeyInstance(operationVersion, payload, instance._solution.sid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
fetchWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.fetchWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new ApiKeyInstance(operationVersion, response.body, instance._solution.sid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
update(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["policy"] !== undefined)
|
||||
data["Policy"] = serialize.object(params["policy"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.update({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new ApiKeyInstance(operationVersion, payload, instance._solution.sid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
updateWithHttpInfo(params, callback) {
|
||||
if (params instanceof Function) {
|
||||
callback = params;
|
||||
params = {};
|
||||
}
|
||||
else {
|
||||
params = params || {};
|
||||
}
|
||||
let data = {};
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["policy"] !== undefined)
|
||||
data["Policy"] = serialize.object(params["policy"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.updateWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new ApiKeyInstance(operationVersion, response.body, instance._solution.sid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return this._solution;
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.ApiKeyContextImpl = ApiKeyContextImpl;
|
||||
class ApiKeyInstance {
|
||||
constructor(_version, payload, sid) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.dateCreated = deserialize.rfc2822DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated);
|
||||
this.policy = payload.policy;
|
||||
this._solution = { sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context || new ApiKeyContextImpl(this._version, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Remove a ApiKeyInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback) {
|
||||
return this._proxy.remove(callback);
|
||||
}
|
||||
/**
|
||||
* Remove a ApiKeyInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean with HTTP metadata
|
||||
*/
|
||||
removeWithHttpInfo(callback) {
|
||||
return this._proxy.removeWithHttpInfo(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a ApiKeyInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ApiKeyInstance
|
||||
*/
|
||||
fetch(callback) {
|
||||
return this._proxy.fetch(callback);
|
||||
}
|
||||
/**
|
||||
* Fetch a ApiKeyInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed ApiKeyInstance with HTTP metadata
|
||||
*/
|
||||
fetchWithHttpInfo(callback) {
|
||||
return this._proxy.fetchWithHttpInfo(callback);
|
||||
}
|
||||
update(params, callback) {
|
||||
return this._proxy.update(params, callback);
|
||||
}
|
||||
updateWithHttpInfo(params, callback) {
|
||||
return this._proxy.updateWithHttpInfo(params, callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
sid: this.sid,
|
||||
friendlyName: this.friendlyName,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
policy: this.policy,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.ApiKeyInstance = ApiKeyInstance;
|
||||
function ApiKeyListInstance(version) {
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new ApiKeyContextImpl(version, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = ``;
|
||||
instance.toJSON = function toJSON() {
|
||||
return instance._solution;
|
||||
};
|
||||
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
||||
return (0, util_1.inspect)(instance.toJSON(), options);
|
||||
};
|
||||
return instance;
|
||||
}
|
||||
215
node_modules/twilio/lib/rest/iam/v1/getApiKeys.d.ts
generated
vendored
Normal file
215
node_modules/twilio/lib/rest/iam/v1/getApiKeys.d.ts
generated
vendored
Normal file
@@ -0,0 +1,215 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import Page, { TwilioResponsePayload } from "../../../base/Page";
|
||||
import Response from "../../../http/response";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
/**
|
||||
* Options to pass to each
|
||||
*/
|
||||
export interface GetApiKeysListInstanceEachOptions {
|
||||
/** The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. */
|
||||
accountSid: string;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
||||
callback?: (item: GetApiKeysInstance, done: (err?: Error) => void) => void;
|
||||
/** Function to be called upon completion of streaming */
|
||||
done?: Function;
|
||||
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to list
|
||||
*/
|
||||
export interface GetApiKeysListInstanceOptions {
|
||||
/** The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. */
|
||||
accountSid: string;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
||||
limit?: number;
|
||||
}
|
||||
/**
|
||||
* Options to pass to page
|
||||
*/
|
||||
export interface GetApiKeysListInstancePageOptions {
|
||||
/** The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. */
|
||||
accountSid: string;
|
||||
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
||||
pageSize?: number;
|
||||
/** Page Number, this value is simply for client state */
|
||||
pageNumber?: number;
|
||||
/** PageToken provided by the API */
|
||||
pageToken?: string;
|
||||
}
|
||||
export interface GetApiKeysSolution {
|
||||
}
|
||||
export interface GetApiKeysListInstance {
|
||||
_version: V1;
|
||||
_solution: GetApiKeysSolution;
|
||||
_uri: string;
|
||||
/**
|
||||
* Streams GetApiKeysInstance records from the API.
|
||||
*
|
||||
* This operation lazily loads records as efficiently as possible until the limit
|
||||
* is reached.
|
||||
*
|
||||
* The results are passed into the callback function, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { GetApiKeysListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
each(params: GetApiKeysListInstanceEachOptions, callback?: (item: GetApiKeysInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Streams GetApiKeysInstance records from the API with HTTP metadata captured per page.
|
||||
*
|
||||
* This operation lazily loads records as efficiently as possible until the limit
|
||||
* is reached. HTTP metadata (status code, headers) is captured for each page request.
|
||||
*
|
||||
* The results are passed into the callback function, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { GetApiKeysListInstanceEachOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Function to process each record
|
||||
*/
|
||||
eachWithHttpInfo(params: GetApiKeysListInstanceEachOptions, callback?: (item: GetApiKeysInstance, done: (err?: Error) => void) => void): void;
|
||||
/**
|
||||
* Retrieve a single target page of GetApiKeysInstance records from the API.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
getPage(targetUrl: string, callback?: (error: Error | null, items: GetApiKeysPage) => any): Promise<GetApiKeysPage>;
|
||||
/**
|
||||
* Retrieve a single target page of GetApiKeysInstance records from the API with HTTP metadata.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
getPageWithHttpInfo(targetUrl: string, callback?: (error: Error | null, items: ApiResponse<GetApiKeysPage>) => any): Promise<ApiResponse<GetApiKeysPage>>;
|
||||
/**
|
||||
* Lists GetApiKeysInstance records from the API as a list.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { GetApiKeysListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
list(params: GetApiKeysListInstanceOptions, callback?: (error: Error | null, items: GetApiKeysInstance[]) => any): Promise<GetApiKeysInstance[]>;
|
||||
/**
|
||||
* Lists GetApiKeysInstance records from the API as a list with HTTP metadata.
|
||||
*
|
||||
* Returns all records along with HTTP metadata from the first page fetched.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { GetApiKeysListInstanceOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
listWithHttpInfo(params: GetApiKeysListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<GetApiKeysInstance[]>) => any): Promise<ApiResponse<GetApiKeysInstance[]>>;
|
||||
/**
|
||||
* Retrieve a single page of GetApiKeysInstance records from the API.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { GetApiKeysListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records
|
||||
*/
|
||||
page(params: GetApiKeysListInstancePageOptions, callback?: (error: Error | null, items: GetApiKeysPage) => any): Promise<GetApiKeysPage>;
|
||||
/**
|
||||
* Retrieve a single page of GetApiKeysInstance records from the API with HTTP metadata.
|
||||
*
|
||||
* The request is executed immediately.
|
||||
*
|
||||
* If a function is passed as the first argument, it will be used as the callback
|
||||
* function.
|
||||
*
|
||||
* @param { GetApiKeysListInstancePageOptions } [params] - Options for request
|
||||
* @param { function } [callback] - Callback to handle list of records with metadata
|
||||
*/
|
||||
pageWithHttpInfo(params: GetApiKeysListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<GetApiKeysPage>) => any): Promise<ApiResponse<GetApiKeysPage>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function GetApiKeysListInstance(version: V1): GetApiKeysListInstance;
|
||||
interface GetApiKeysPayload extends TwilioResponsePayload {
|
||||
keys: GetApiKeysResource[];
|
||||
}
|
||||
interface GetApiKeysResource {
|
||||
sid: string;
|
||||
friendly_name: string;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
flags: Array<string>;
|
||||
}
|
||||
export declare class GetApiKeysInstance {
|
||||
protected _version: V1;
|
||||
constructor(_version: V1, payload: GetApiKeysResource);
|
||||
/**
|
||||
* The unique string that we created to identify the Key resource.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The string that you assigned to describe the resource.
|
||||
*/
|
||||
friendlyName: string;
|
||||
/**
|
||||
* The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
flags: Array<string>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
friendlyName: string;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
flags: string[];
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export declare class GetApiKeysPage extends Page<V1, GetApiKeysPayload, GetApiKeysResource, GetApiKeysInstance> {
|
||||
/**
|
||||
* Initialize the GetApiKeysPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version: V1, response: Response<string>, solution: GetApiKeysSolution);
|
||||
/**
|
||||
* Build an instance of GetApiKeysInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload: GetApiKeysResource): GetApiKeysInstance;
|
||||
[inspect.custom](depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
175
node_modules/twilio/lib/rest/iam/v1/getApiKeys.js
generated
vendored
Normal file
175
node_modules/twilio/lib/rest/iam/v1/getApiKeys.js
generated
vendored
Normal file
@@ -0,0 +1,175 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Iam
|
||||
* This is the public Twilio REST API.
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GetApiKeysPage = exports.GetApiKeysInstance = void 0;
|
||||
exports.GetApiKeysListInstance = GetApiKeysListInstance;
|
||||
const util_1 = require("util");
|
||||
const Page_1 = __importDefault(require("../../../base/Page"));
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
function GetApiKeysListInstance(version) {
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/Keys`;
|
||||
instance.page = function page(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["accountSid"] === null || params["accountSid"] === undefined) {
|
||||
throw new Error("Required parameter \"params['accountSid']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["AccountSid"] = params["accountSid"];
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.page({
|
||||
uri: instance._uri,
|
||||
method: "get",
|
||||
params: data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new GetApiKeysPage(operationVersion, payload, instance._solution));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.each = instance._version.each;
|
||||
instance.list = instance._version.list;
|
||||
instance.getPage = function getPage(targetUrl, callback) {
|
||||
const operationPromise = instance._version._domain.twilio.request({
|
||||
method: "get",
|
||||
uri: targetUrl,
|
||||
});
|
||||
let pagePromise = operationPromise.then((payload) => new GetApiKeysPage(instance._version, payload, instance._solution));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["accountSid"] === null || params["accountSid"] === undefined) {
|
||||
throw new Error("Required parameter \"params['accountSid']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["AccountSid"] = params["accountSid"];
|
||||
if (params["pageSize"] !== undefined)
|
||||
data["PageSize"] = params["pageSize"];
|
||||
if (params.pageNumber !== undefined)
|
||||
data["Page"] = params.pageNumber;
|
||||
if (params.pageToken !== undefined)
|
||||
data["PageToken"] = params.pageToken;
|
||||
const headers = {};
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// For page operations, use page() directly as it already returns { statusCode, body, headers }
|
||||
// IMPORTANT: Pass full response to Page constructor, not response.body
|
||||
let operationPromise = operationVersion
|
||||
.page({ uri: instance._uri, method: "get", params: data, headers })
|
||||
.then((response) => ({
|
||||
statusCode: response.statusCode,
|
||||
headers: response.headers,
|
||||
body: new GetApiKeysPage(operationVersion, response, instance._solution),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.each = instance._version.each;
|
||||
instance.eachWithHttpInfo = instance._version.eachWithHttpInfo;
|
||||
instance.list = instance._version.list;
|
||||
instance.listWithHttpInfo = instance._version.listWithHttpInfo;
|
||||
instance.getPageWithHttpInfo = function getPageWithHttpInfo(targetUrl, callback) {
|
||||
// Use request() directly as it already returns { statusCode, body, headers }
|
||||
const operationPromise = instance._version._domain.twilio.request({
|
||||
method: "get",
|
||||
uri: targetUrl,
|
||||
});
|
||||
let pagePromise = operationPromise.then((response) => ({
|
||||
statusCode: response.statusCode,
|
||||
headers: response.headers,
|
||||
body: new GetApiKeysPage(instance._version, response, instance._solution),
|
||||
}));
|
||||
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
||||
return pagePromise;
|
||||
};
|
||||
instance.toJSON = function toJSON() {
|
||||
return instance._solution;
|
||||
};
|
||||
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
||||
return (0, util_1.inspect)(instance.toJSON(), options);
|
||||
};
|
||||
return instance;
|
||||
}
|
||||
class GetApiKeysInstance {
|
||||
constructor(_version, payload) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.dateCreated = deserialize.rfc2822DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated);
|
||||
this.flags = payload.flags;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
sid: this.sid,
|
||||
friendlyName: this.friendlyName,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
flags: this.flags,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.GetApiKeysInstance = GetApiKeysInstance;
|
||||
class GetApiKeysPage extends Page_1.default {
|
||||
/**
|
||||
* Initialize the GetApiKeysPage
|
||||
*
|
||||
* @param version - Version of the resource
|
||||
* @param response - Response from the API
|
||||
* @param solution - Path solution
|
||||
*/
|
||||
constructor(version, response, solution) {
|
||||
super(version, response, solution);
|
||||
}
|
||||
/**
|
||||
* Build an instance of GetApiKeysInstance
|
||||
*
|
||||
* @param payload - Payload response from the API
|
||||
*/
|
||||
getInstance(payload) {
|
||||
return new GetApiKeysInstance(this._version, payload);
|
||||
}
|
||||
[util_1.inspect.custom](depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.GetApiKeysPage = GetApiKeysPage;
|
||||
99
node_modules/twilio/lib/rest/iam/v1/newApiKey.d.ts
generated
vendored
Normal file
99
node_modules/twilio/lib/rest/iam/v1/newApiKey.d.ts
generated
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
export type NewApiKeyKeytype = "restricted";
|
||||
/**
|
||||
* Options to pass to create a NewApiKeyInstance
|
||||
*/
|
||||
export interface NewApiKeyListInstanceCreateOptions {
|
||||
/** The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. */
|
||||
accountSid: string;
|
||||
/** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */
|
||||
friendlyName?: string;
|
||||
/** */
|
||||
keyType?: NewApiKeyKeytype;
|
||||
/** The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). */
|
||||
policy?: any;
|
||||
}
|
||||
export interface NewApiKeySolution {
|
||||
}
|
||||
export interface NewApiKeyListInstance {
|
||||
_version: V1;
|
||||
_solution: NewApiKeySolution;
|
||||
_uri: string;
|
||||
/**
|
||||
* Create a NewApiKeyInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed NewApiKeyInstance
|
||||
*/
|
||||
create(params: NewApiKeyListInstanceCreateOptions, callback?: (error: Error | null, item?: NewApiKeyInstance) => any): Promise<NewApiKeyInstance>;
|
||||
/**
|
||||
* Create a NewApiKeyInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed NewApiKeyInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: NewApiKeyListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<NewApiKeyInstance>) => any): Promise<ApiResponse<NewApiKeyInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function NewApiKeyListInstance(version: V1): NewApiKeyListInstance;
|
||||
interface NewApiKeyResource {
|
||||
sid: string;
|
||||
friendly_name: string;
|
||||
date_created: Date;
|
||||
date_updated: Date;
|
||||
secret: string;
|
||||
policy: Record<string, object>;
|
||||
}
|
||||
export declare class NewApiKeyInstance {
|
||||
protected _version: V1;
|
||||
constructor(_version: V1, payload: NewApiKeyResource);
|
||||
/**
|
||||
* The unique string that that we created to identify the NewKey resource. You will use this as the basic-auth `user` when authenticating to the API.
|
||||
*/
|
||||
sid: string;
|
||||
/**
|
||||
* The string that you assigned to describe the resource.
|
||||
*/
|
||||
friendlyName: string;
|
||||
/**
|
||||
* The date and time in GMT that the API Key was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateCreated: Date;
|
||||
/**
|
||||
* The date and time in GMT that the new API Key was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
|
||||
*/
|
||||
dateUpdated: Date;
|
||||
/**
|
||||
* The secret your application uses to sign Access Tokens and to authenticate to the REST API (you will use this as the basic-auth `password`). **Note that for security reasons, this field is ONLY returned when the API Key is first created.**
|
||||
*/
|
||||
secret: string;
|
||||
/**
|
||||
* Collection of allow assertions.
|
||||
*/
|
||||
policy: Record<string, object>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
sid: string;
|
||||
friendlyName: string;
|
||||
dateCreated: Date;
|
||||
dateUpdated: Date;
|
||||
secret: string;
|
||||
policy: Record<string, object>;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
125
node_modules/twilio/lib/rest/iam/v1/newApiKey.js
generated
vendored
Normal file
125
node_modules/twilio/lib/rest/iam/v1/newApiKey.js
generated
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Iam
|
||||
* This is the public Twilio REST API.
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.NewApiKeyInstance = void 0;
|
||||
exports.NewApiKeyListInstance = NewApiKeyListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
function NewApiKeyListInstance(version) {
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/Keys`;
|
||||
instance.create = function create(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["accountSid"] === null || params["accountSid"] === undefined) {
|
||||
throw new Error("Required parameter \"params['accountSid']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["AccountSid"] = params["accountSid"];
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["keyType"] !== undefined)
|
||||
data["KeyType"] = params["keyType"];
|
||||
if (params["policy"] !== undefined)
|
||||
data["Policy"] = serialize.object(params["policy"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.create({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new NewApiKeyInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.createWithHttpInfo = function createWithHttpInfo(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["accountSid"] === null || params["accountSid"] === undefined) {
|
||||
throw new Error("Required parameter \"params['accountSid']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["AccountSid"] = params["accountSid"];
|
||||
if (params["friendlyName"] !== undefined)
|
||||
data["FriendlyName"] = params["friendlyName"];
|
||||
if (params["keyType"] !== undefined)
|
||||
data["KeyType"] = params["keyType"];
|
||||
if (params["policy"] !== undefined)
|
||||
data["Policy"] = serialize.object(params["policy"]);
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.createWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new NewApiKeyInstance(operationVersion, response.body),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.toJSON = function toJSON() {
|
||||
return instance._solution;
|
||||
};
|
||||
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
||||
return (0, util_1.inspect)(instance.toJSON(), options);
|
||||
};
|
||||
return instance;
|
||||
}
|
||||
class NewApiKeyInstance {
|
||||
constructor(_version, payload) {
|
||||
this._version = _version;
|
||||
this.sid = payload.sid;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.dateCreated = deserialize.rfc2822DateTime(payload.date_created);
|
||||
this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated);
|
||||
this.secret = payload.secret;
|
||||
this.policy = payload.policy;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
sid: this.sid,
|
||||
friendlyName: this.friendlyName,
|
||||
dateCreated: this.dateCreated,
|
||||
dateUpdated: this.dateUpdated,
|
||||
secret: this.secret,
|
||||
policy: this.policy,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.NewApiKeyInstance = NewApiKeyInstance;
|
||||
257
node_modules/twilio/lib/rest/iam/v1/oAuthApp.d.ts
generated
vendored
Normal file
257
node_modules/twilio/lib/rest/iam/v1/oAuthApp.d.ts
generated
vendored
Normal file
@@ -0,0 +1,257 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
export declare class IamV1AccountVendorOauthAppCreateRequest {
|
||||
"type"?: string;
|
||||
"friendlyName"?: string;
|
||||
"ownerSid"?: string | null;
|
||||
"description"?: string;
|
||||
"clientSid"?: string | null;
|
||||
"policy"?: IamV1OrganizationVendoroauthappPolicy;
|
||||
"accessTokenTtl"?: number;
|
||||
constructor(payload: any);
|
||||
}
|
||||
export declare class IamV1AccountVendorOauthAppUpdateRequest {
|
||||
"type"?: string | null;
|
||||
"friendlyName"?: string | null;
|
||||
"description"?: string | null;
|
||||
"policy"?: IamV1OrganizationVendorOauthAppUpdateRequestPolicy | null;
|
||||
"accessTokenTtl"?: number | null;
|
||||
constructor(payload: any);
|
||||
}
|
||||
export declare class IamV1OrganizationVendorOauthAppUpdateRequestPolicy {
|
||||
/**
|
||||
* Set of permissions explicitly allowed
|
||||
*/
|
||||
"allow"?: Array<string>;
|
||||
/**
|
||||
* Set of permissions explicitly denied
|
||||
*/
|
||||
"deny"?: Array<string>;
|
||||
constructor(payload: any);
|
||||
}
|
||||
export declare class IamV1OrganizationVendoroauthappPolicy {
|
||||
/**
|
||||
* Set of permissions explicitly allowed
|
||||
*/
|
||||
"allow"?: Array<string>;
|
||||
/**
|
||||
* Set of permissions explicitly denied
|
||||
*/
|
||||
"deny"?: Array<string>;
|
||||
constructor(payload: any);
|
||||
}
|
||||
/**
|
||||
* Options to pass to update a OAuthAppInstance
|
||||
*/
|
||||
export interface OAuthAppContextUpdateOptions {
|
||||
/** */
|
||||
iamV1AccountVendorOauthAppUpdateRequest: IamV1AccountVendorOauthAppUpdateRequest;
|
||||
}
|
||||
/**
|
||||
* Options to pass to create a OAuthAppInstance
|
||||
*/
|
||||
export interface OAuthAppListInstanceCreateOptions {
|
||||
/** */
|
||||
iamV1AccountVendorOauthAppCreateRequest: IamV1AccountVendorOauthAppCreateRequest;
|
||||
}
|
||||
export interface OAuthAppContext {
|
||||
/**
|
||||
* Remove a OAuthAppInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a OAuthAppInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean with HTTP metadata
|
||||
*/
|
||||
removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
|
||||
/**
|
||||
* Update a OAuthAppInstance
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed OAuthAppInstance
|
||||
*/
|
||||
update(params: IamV1AccountVendorOauthAppUpdateRequest, headers?: any, callback?: (error: Error | null, item?: OAuthAppInstance) => any): Promise<OAuthAppInstance>;
|
||||
/**
|
||||
* Update a OAuthAppInstance and return HTTP info
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed OAuthAppInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: IamV1AccountVendorOauthAppUpdateRequest, headers?: any, callback?: (error: Error | null, item?: ApiResponse<OAuthAppInstance>) => any): Promise<ApiResponse<OAuthAppInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export interface OAuthAppContextSolution {
|
||||
sid: string;
|
||||
}
|
||||
export declare class OAuthAppContextImpl implements OAuthAppContext {
|
||||
protected _version: V1;
|
||||
protected _solution: OAuthAppContextSolution;
|
||||
protected _uri: string;
|
||||
constructor(_version: V1, sid: string);
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
|
||||
update(params: IamV1AccountVendorOauthAppUpdateRequest, headers?: any, callback?: (error: Error | null, item?: OAuthAppInstance) => any): Promise<OAuthAppInstance>;
|
||||
updateWithHttpInfo(params: IamV1AccountVendorOauthAppUpdateRequest, headers?: any, callback?: (error: Error | null, item?: ApiResponse<OAuthAppInstance>) => any): Promise<ApiResponse<OAuthAppInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): OAuthAppContextSolution;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
interface OAuthAppResource {
|
||||
type: string;
|
||||
sid: string;
|
||||
friendly_name: string;
|
||||
description: string;
|
||||
date_created: Date;
|
||||
created_by: string;
|
||||
secret: string;
|
||||
status: string;
|
||||
policy: IamV1OrganizationVendoroauthappPolicy;
|
||||
access_token_ttl: number;
|
||||
code: number;
|
||||
message: string;
|
||||
more_info: string;
|
||||
}
|
||||
export declare class OAuthAppInstance {
|
||||
protected _version: V1;
|
||||
protected _solution: OAuthAppContextSolution;
|
||||
protected _context?: OAuthAppContext;
|
||||
constructor(_version: V1, payload: OAuthAppResource, sid?: string);
|
||||
type: string;
|
||||
sid: string;
|
||||
friendlyName: string;
|
||||
description: string;
|
||||
dateCreated: Date;
|
||||
createdBy: string;
|
||||
secret: string;
|
||||
status: string;
|
||||
policy: IamV1OrganizationVendoroauthappPolicy;
|
||||
accessTokenTtl: number;
|
||||
/**
|
||||
* Twilio-specific error code
|
||||
*/
|
||||
code: number;
|
||||
/**
|
||||
* Error message
|
||||
*/
|
||||
message: string;
|
||||
/**
|
||||
* Link to Error Code References
|
||||
*/
|
||||
moreInfo: string;
|
||||
private get _proxy();
|
||||
/**
|
||||
* Remove a OAuthAppInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
||||
/**
|
||||
* Remove a OAuthAppInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean with HTTP metadata
|
||||
*/
|
||||
removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
|
||||
/**
|
||||
* Update a OAuthAppInstance
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed OAuthAppInstance
|
||||
*/
|
||||
update(params: IamV1AccountVendorOauthAppUpdateRequest, headers?: any, callback?: (error: Error | null, item?: OAuthAppInstance) => any): Promise<OAuthAppInstance>;
|
||||
/**
|
||||
* Update a OAuthAppInstance and return HTTP info
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed OAuthAppInstance with HTTP metadata
|
||||
*/
|
||||
updateWithHttpInfo(params: IamV1AccountVendorOauthAppUpdateRequest, headers?: any, callback?: (error: Error | null, item?: ApiResponse<OAuthAppInstance>) => any): Promise<ApiResponse<OAuthAppInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
type: string;
|
||||
sid: string;
|
||||
friendlyName: string;
|
||||
description: string;
|
||||
dateCreated: Date;
|
||||
createdBy: string;
|
||||
secret: string;
|
||||
status: string;
|
||||
policy: IamV1OrganizationVendoroauthappPolicy;
|
||||
accessTokenTtl: number;
|
||||
code: number;
|
||||
message: string;
|
||||
moreInfo: string;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export interface OAuthAppSolution {
|
||||
}
|
||||
export interface OAuthAppListInstance {
|
||||
_version: V1;
|
||||
_solution: OAuthAppSolution;
|
||||
_uri: string;
|
||||
(sid: string): OAuthAppContext;
|
||||
get(sid: string): OAuthAppContext;
|
||||
/**
|
||||
* Create a OAuthAppInstance
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed OAuthAppInstance
|
||||
*/
|
||||
create(params: IamV1AccountVendorOauthAppCreateRequest, headers?: any, callback?: (error: Error | null, item?: OAuthAppInstance) => any): Promise<OAuthAppInstance>;
|
||||
/**
|
||||
* Create a OAuthAppInstance and return HTTP info
|
||||
*
|
||||
* @param params - Body for request
|
||||
* @param headers - header params for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed OAuthAppInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: IamV1AccountVendorOauthAppCreateRequest, headers?: any, callback?: (error: Error | null, item?: ApiResponse<OAuthAppInstance>) => any): Promise<ApiResponse<OAuthAppInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function OAuthAppListInstance(version: V1): OAuthAppListInstance;
|
||||
export {};
|
||||
298
node_modules/twilio/lib/rest/iam/v1/oAuthApp.js
generated
vendored
Normal file
298
node_modules/twilio/lib/rest/iam/v1/oAuthApp.js
generated
vendored
Normal file
@@ -0,0 +1,298 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Iam
|
||||
* This is the public Twilio REST API.
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.OAuthAppInstance = exports.OAuthAppContextImpl = exports.IamV1OrganizationVendoroauthappPolicy = exports.IamV1OrganizationVendorOauthAppUpdateRequestPolicy = exports.IamV1AccountVendorOauthAppUpdateRequest = exports.IamV1AccountVendorOauthAppCreateRequest = void 0;
|
||||
exports.OAuthAppListInstance = OAuthAppListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
const utility_1 = require("../../../base/utility");
|
||||
class IamV1AccountVendorOauthAppCreateRequest {
|
||||
constructor(payload) {
|
||||
this.type = payload["type"];
|
||||
this.friendlyName = payload["friendly_name"];
|
||||
this.ownerSid = payload["owner_sid"];
|
||||
this.description = payload["description"];
|
||||
this.clientSid = payload["client_sid"];
|
||||
this.policy = payload["policy"];
|
||||
this.accessTokenTtl = payload["access_token_ttl"];
|
||||
}
|
||||
}
|
||||
exports.IamV1AccountVendorOauthAppCreateRequest = IamV1AccountVendorOauthAppCreateRequest;
|
||||
class IamV1AccountVendorOauthAppUpdateRequest {
|
||||
constructor(payload) {
|
||||
this.type = payload["type"];
|
||||
this.friendlyName = payload["friendly_name"];
|
||||
this.description = payload["description"];
|
||||
this.policy = payload["policy"];
|
||||
this.accessTokenTtl = payload["access_token_ttl"];
|
||||
}
|
||||
}
|
||||
exports.IamV1AccountVendorOauthAppUpdateRequest = IamV1AccountVendorOauthAppUpdateRequest;
|
||||
class IamV1OrganizationVendorOauthAppUpdateRequestPolicy {
|
||||
constructor(payload) {
|
||||
this.allow = payload["allow"];
|
||||
this.deny = payload["deny"];
|
||||
}
|
||||
}
|
||||
exports.IamV1OrganizationVendorOauthAppUpdateRequestPolicy = IamV1OrganizationVendorOauthAppUpdateRequestPolicy;
|
||||
class IamV1OrganizationVendoroauthappPolicy {
|
||||
constructor(payload) {
|
||||
this.allow = payload["allow"];
|
||||
this.deny = payload["deny"];
|
||||
}
|
||||
}
|
||||
exports.IamV1OrganizationVendoroauthappPolicy = IamV1OrganizationVendoroauthappPolicy;
|
||||
class OAuthAppContextImpl {
|
||||
constructor(_version, sid) {
|
||||
this._version = _version;
|
||||
if (!(0, utility_1.isValidPathParam)(sid)) {
|
||||
throw new Error("Parameter 'sid' is not valid.");
|
||||
}
|
||||
this._solution = { sid };
|
||||
this._uri = `/Account/OAuthApps/${sid}`;
|
||||
}
|
||||
remove(callback) {
|
||||
const headers = {};
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.remove({
|
||||
uri: instance._uri,
|
||||
method: "delete",
|
||||
headers,
|
||||
});
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
removeWithHttpInfo(callback) {
|
||||
const headers = {};
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// DELETE operation - returns boolean based on status code
|
||||
let operationPromise = operationVersion
|
||||
.removeWithResponseInfo({ uri: instance._uri, method: "delete", headers })
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: response.statusCode === 204,
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
update(params, headers, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
let data = {};
|
||||
data = params;
|
||||
if (headers === null || headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers["Content-Type"] = "application/json";
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version, operationPromise = operationVersion.update({
|
||||
uri: instance._uri,
|
||||
method: "put",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new OAuthAppInstance(operationVersion, payload, instance._solution.sid));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
updateWithHttpInfo(params, headers, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
let data = {};
|
||||
data = params;
|
||||
if (headers === null || headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers["Content-Type"] = "application/json";
|
||||
headers["Accept"] = "application/json";
|
||||
const instance = this;
|
||||
let operationVersion = instance._version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.updateWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "put",
|
||||
data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new OAuthAppInstance(operationVersion, response.body, instance._solution.sid),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return this._solution;
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.OAuthAppContextImpl = OAuthAppContextImpl;
|
||||
class OAuthAppInstance {
|
||||
constructor(_version, payload, sid) {
|
||||
this._version = _version;
|
||||
this.type = payload.type;
|
||||
this.sid = payload.sid;
|
||||
this.friendlyName = payload.friendly_name;
|
||||
this.description = payload.description;
|
||||
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
||||
this.createdBy = payload.created_by;
|
||||
this.secret = payload.secret;
|
||||
this.status = payload.status;
|
||||
this.policy =
|
||||
payload.policy !== null && payload.policy !== undefined
|
||||
? new IamV1OrganizationVendoroauthappPolicy(payload.policy)
|
||||
: null;
|
||||
this.accessTokenTtl = deserialize.integer(payload.access_token_ttl);
|
||||
this.code = payload.code;
|
||||
this.message = payload.message;
|
||||
this.moreInfo = payload.more_info;
|
||||
this._solution = { sid: sid || this.sid };
|
||||
}
|
||||
get _proxy() {
|
||||
this._context =
|
||||
this._context ||
|
||||
new OAuthAppContextImpl(this._version, this._solution.sid);
|
||||
return this._context;
|
||||
}
|
||||
/**
|
||||
* Remove a OAuthAppInstance
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean
|
||||
*/
|
||||
remove(callback) {
|
||||
return this._proxy.remove(callback);
|
||||
}
|
||||
/**
|
||||
* Remove a OAuthAppInstance and return HTTP info
|
||||
*
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed boolean with HTTP metadata
|
||||
*/
|
||||
removeWithHttpInfo(callback) {
|
||||
return this._proxy.removeWithHttpInfo(callback);
|
||||
}
|
||||
update(params, callback) {
|
||||
return this._proxy.update(params, callback);
|
||||
}
|
||||
updateWithHttpInfo(params, callback) {
|
||||
return this._proxy.updateWithHttpInfo(params, callback);
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
type: this.type,
|
||||
sid: this.sid,
|
||||
friendlyName: this.friendlyName,
|
||||
description: this.description,
|
||||
dateCreated: this.dateCreated,
|
||||
createdBy: this.createdBy,
|
||||
secret: this.secret,
|
||||
status: this.status,
|
||||
policy: this.policy,
|
||||
accessTokenTtl: this.accessTokenTtl,
|
||||
code: this.code,
|
||||
message: this.message,
|
||||
moreInfo: this.moreInfo,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.OAuthAppInstance = OAuthAppInstance;
|
||||
function OAuthAppListInstance(version) {
|
||||
const instance = ((sid) => instance.get(sid));
|
||||
instance.get = function get(sid) {
|
||||
return new OAuthAppContextImpl(version, sid);
|
||||
};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/Account/OAuthApps`;
|
||||
instance.create = function create(params, headers, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
let data = {};
|
||||
data = params;
|
||||
if (headers === null || headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers["Content-Type"] = "application/json";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.create({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new OAuthAppInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
let data = {};
|
||||
data = params;
|
||||
if (headers === null || headers === undefined) {
|
||||
headers = {};
|
||||
}
|
||||
headers["Content-Type"] = "application/json";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.createWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new OAuthAppInstance(operationVersion, response.body),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.toJSON = function toJSON() {
|
||||
return instance._solution;
|
||||
};
|
||||
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
||||
return (0, util_1.inspect)(instance.toJSON(), options);
|
||||
};
|
||||
return instance;
|
||||
}
|
||||
97
node_modules/twilio/lib/rest/iam/v1/token.d.ts
generated
vendored
Normal file
97
node_modules/twilio/lib/rest/iam/v1/token.d.ts
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
import { inspect, InspectOptions } from "util";
|
||||
import V1 from "../V1";
|
||||
import { ApiResponse } from "../../../base/ApiResponse";
|
||||
/**
|
||||
* Options to pass to create a TokenInstance
|
||||
*/
|
||||
export interface TokenListInstanceCreateOptions {
|
||||
/** Grant type is a credential representing resource owner\\\'s authorization which can be used by client to obtain access token. */
|
||||
grantType: string;
|
||||
/** A 34 character string that uniquely identifies this OAuth App. */
|
||||
clientId: string;
|
||||
/** The credential for confidential OAuth App. */
|
||||
clientSecret?: string;
|
||||
/** JWT token related to the authorization code grant type. */
|
||||
code?: string;
|
||||
/** The redirect uri */
|
||||
redirectUri?: string;
|
||||
/** The targeted audience uri */
|
||||
audience?: string;
|
||||
/** JWT token related to refresh access token. */
|
||||
refreshToken?: string;
|
||||
/** The scope of token */
|
||||
scope?: string;
|
||||
}
|
||||
export interface TokenSolution {
|
||||
}
|
||||
export interface TokenListInstance {
|
||||
_version: V1;
|
||||
_solution: TokenSolution;
|
||||
_uri: string;
|
||||
/**
|
||||
* Create a TokenInstance
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TokenInstance
|
||||
*/
|
||||
create(params: TokenListInstanceCreateOptions, callback?: (error: Error | null, item?: TokenInstance) => any): Promise<TokenInstance>;
|
||||
/**
|
||||
* Create a TokenInstance and return HTTP info
|
||||
*
|
||||
* @param params - Parameter for request
|
||||
* @param callback - Callback to handle processed record
|
||||
*
|
||||
* @returns Resolves to processed TokenInstance with HTTP metadata
|
||||
*/
|
||||
createWithHttpInfo(params: TokenListInstanceCreateOptions, callback?: (error: Error | null, item?: ApiResponse<TokenInstance>) => any): Promise<ApiResponse<TokenInstance>>;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*/
|
||||
toJSON(): any;
|
||||
[inspect.custom](_depth: any, options: InspectOptions): any;
|
||||
}
|
||||
export declare function TokenListInstance(version: V1): TokenListInstance;
|
||||
interface TokenResource {
|
||||
access_token: string;
|
||||
refresh_token: string;
|
||||
id_token: string;
|
||||
token_type: string;
|
||||
expires_in: number;
|
||||
}
|
||||
export declare class TokenInstance {
|
||||
protected _version: V1;
|
||||
constructor(_version: V1, payload: TokenResource);
|
||||
/**
|
||||
* Token which carries the necessary information to access a Twilio resource directly.
|
||||
*/
|
||||
accessToken: string;
|
||||
/**
|
||||
* Token which carries the information necessary to get a new access token.
|
||||
*/
|
||||
refreshToken: string;
|
||||
/**
|
||||
* Token which carries the information necessary of user profile.
|
||||
*/
|
||||
idToken: string;
|
||||
/**
|
||||
* Token type
|
||||
*/
|
||||
tokenType: string;
|
||||
expiresIn: number;
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON(): {
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
idToken: string;
|
||||
tokenType: string;
|
||||
expiresIn: number;
|
||||
};
|
||||
[inspect.custom](_depth: any, options: InspectOptions): string;
|
||||
}
|
||||
export {};
|
||||
143
node_modules/twilio/lib/rest/iam/v1/token.js
generated
vendored
Normal file
143
node_modules/twilio/lib/rest/iam/v1/token.js
generated
vendored
Normal file
@@ -0,0 +1,143 @@
|
||||
"use strict";
|
||||
/*
|
||||
* This code was generated by
|
||||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
||||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
||||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
||||
*
|
||||
* Twilio - Iam
|
||||
* This is the public Twilio REST API.
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.TokenInstance = void 0;
|
||||
exports.TokenListInstance = TokenListInstance;
|
||||
const util_1 = require("util");
|
||||
const deserialize = require("../../../base/deserialize");
|
||||
const serialize = require("../../../base/serialize");
|
||||
function TokenListInstance(version) {
|
||||
const instance = {};
|
||||
instance._version = version;
|
||||
instance._solution = {};
|
||||
instance._uri = `/token`;
|
||||
instance.create = function create(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["grantType"] === null || params["grantType"] === undefined) {
|
||||
throw new Error("Required parameter \"params['grantType']\" missing.");
|
||||
}
|
||||
if (params["clientId"] === null || params["clientId"] === undefined) {
|
||||
throw new Error("Required parameter \"params['clientId']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["grant_type"] = params["grantType"];
|
||||
data["client_id"] = params["clientId"];
|
||||
if (params["clientSecret"] !== undefined)
|
||||
data["client_secret"] = params["clientSecret"];
|
||||
if (params["code"] !== undefined)
|
||||
data["code"] = params["code"];
|
||||
if (params["redirectUri"] !== undefined)
|
||||
data["redirect_uri"] = params["redirectUri"];
|
||||
if (params["audience"] !== undefined)
|
||||
data["audience"] = params["audience"];
|
||||
if (params["refreshToken"] !== undefined)
|
||||
data["refresh_token"] = params["refreshToken"];
|
||||
if (params["scope"] !== undefined)
|
||||
data["scope"] = params["scope"];
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version, operationPromise = operationVersion.create({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
});
|
||||
operationPromise = operationPromise.then((payload) => new TokenInstance(operationVersion, payload));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.createWithHttpInfo = function createWithHttpInfo(params, callback) {
|
||||
if (params === null || params === undefined) {
|
||||
throw new Error('Required parameter "params" missing.');
|
||||
}
|
||||
if (params["grantType"] === null || params["grantType"] === undefined) {
|
||||
throw new Error("Required parameter \"params['grantType']\" missing.");
|
||||
}
|
||||
if (params["clientId"] === null || params["clientId"] === undefined) {
|
||||
throw new Error("Required parameter \"params['clientId']\" missing.");
|
||||
}
|
||||
let data = {};
|
||||
data["grant_type"] = params["grantType"];
|
||||
data["client_id"] = params["clientId"];
|
||||
if (params["clientSecret"] !== undefined)
|
||||
data["client_secret"] = params["clientSecret"];
|
||||
if (params["code"] !== undefined)
|
||||
data["code"] = params["code"];
|
||||
if (params["redirectUri"] !== undefined)
|
||||
data["redirect_uri"] = params["redirectUri"];
|
||||
if (params["audience"] !== undefined)
|
||||
data["audience"] = params["audience"];
|
||||
if (params["refreshToken"] !== undefined)
|
||||
data["refresh_token"] = params["refreshToken"];
|
||||
if (params["scope"] !== undefined)
|
||||
data["scope"] = params["scope"];
|
||||
const headers = {};
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
||||
headers["Accept"] = "application/json";
|
||||
let operationVersion = version;
|
||||
// CREATE, FETCH, UPDATE operations
|
||||
let operationPromise = operationVersion
|
||||
.createWithResponseInfo({
|
||||
uri: instance._uri,
|
||||
method: "post",
|
||||
data,
|
||||
headers,
|
||||
})
|
||||
.then((response) => ({
|
||||
...response,
|
||||
body: new TokenInstance(operationVersion, response.body),
|
||||
}));
|
||||
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
||||
return operationPromise;
|
||||
};
|
||||
instance.toJSON = function toJSON() {
|
||||
return instance._solution;
|
||||
};
|
||||
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
||||
return (0, util_1.inspect)(instance.toJSON(), options);
|
||||
};
|
||||
return instance;
|
||||
}
|
||||
class TokenInstance {
|
||||
constructor(_version, payload) {
|
||||
this._version = _version;
|
||||
this.accessToken = payload.access_token;
|
||||
this.refreshToken = payload.refresh_token;
|
||||
this.idToken = payload.id_token;
|
||||
this.tokenType = payload.token_type;
|
||||
this.expiresIn = payload.expires_in;
|
||||
}
|
||||
/**
|
||||
* Provide a user-friendly representation
|
||||
*
|
||||
* @returns Object
|
||||
*/
|
||||
toJSON() {
|
||||
return {
|
||||
accessToken: this.accessToken,
|
||||
refreshToken: this.refreshToken,
|
||||
idToken: this.idToken,
|
||||
tokenType: this.tokenType,
|
||||
expiresIn: this.expiresIn,
|
||||
};
|
||||
}
|
||||
[util_1.inspect.custom](_depth, options) {
|
||||
return (0, util_1.inspect)(this.toJSON(), options);
|
||||
}
|
||||
}
|
||||
exports.TokenInstance = TokenInstance;
|
||||
Reference in New Issue
Block a user