UNPKG

cybersource-rest-client-typescript

Version:
107 lines (92 loc) 3.97 kB
/** * CyberSource Merged Spec * All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html * * OpenAPI spec version: 0.0.1 * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * * Swagger Codegen version: 2.3.0 * * Do not edit the class manually. * */ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['ApiClient', 'model/InlineResponse4005', 'model/InlineResponse5001', 'model/UpdatePasswordKeysRequest'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory(require('../ApiClient'), require('../model/InlineResponse4005'), require('../model/InlineResponse5001'), require('../model/UpdatePasswordKeysRequest')); } else { // Browser globals (root is window) if (!root.CyberSource) { root.CyberSource = {}; } root.CyberSource.KeyManagementPasswordApi = factory(root.CyberSource.ApiClient, root.CyberSource.InlineResponse4005, root.CyberSource.InlineResponse5001, root.CyberSource.UpdatePasswordKeysRequest); } }(this, function(ApiClient, InlineResponse4005, InlineResponse5001, UpdatePasswordKeysRequest) { 'use strict'; /** * KeyManagementPassword service. * @module api/KeyManagementPasswordApi * @version 0.0.1 */ /** * Constructs a new KeyManagementPasswordApi. * @alias module:api/KeyManagementPasswordApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, * default to {@link module:ApiClient#instance} if unspecified. */ var exports = function(configObject, apiClient) { this.apiClient = apiClient || ApiClient.instance; this.apiClient.setConfiguration(configObject); /** * Callback function to receive the result of the updatePassword operation. * @callback module:api/KeyManagementPasswordApi~updatePasswordCallback * @param {String} error Error message, if any. * @param {Object} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Activate or De-activate Password * Activate or De-activate key of type password * @param {String} keyId Key ID. * @param {module:model/UpdatePasswordKeysRequest} updatePasswordKeysRequest * @param {module:api/KeyManagementPasswordApi~updatePasswordCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link Object} */ this.updatePassword = function(keyId, updatePasswordKeysRequest, callback) { var postBody = updatePasswordKeysRequest; // verify the required parameter 'keyId' is set if (keyId === undefined || keyId === null) { throw new Error("Missing the required parameter 'keyId' when calling updatePassword"); } // verify the required parameter 'updatePasswordKeysRequest' is set if (updatePasswordKeysRequest === undefined || updatePasswordKeysRequest === null) { throw new Error("Missing the required parameter 'updatePasswordKeysRequest' when calling updatePassword"); } var pathParams = { 'keyId': keyId }; var queryParams = { }; var headerParams = { }; var formParams = { }; var authNames = []; var contentTypes = ['application/json;charset=utf-8']; var accepts = ['application/hal+json;charset=utf-8']; var returnType = Object; return this.apiClient.callApi( '/kms/v2/keys-password/{keyId}', 'PATCH', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } }; return exports; }));