Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var responseBody = pollingResult.body;
if (responseBody === '') responseBody = null;
// Deserialize Response
var parsedResponse = null;
try {
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined) {
var resultMapper = new client.models['GatewayRouteListResult']().mapper();
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody));
deserializationError.request = msRest.stripRequest(httpRequest);
deserializationError.response = msRest.stripResponse(response);
return callback(deserializationError);
}
return callback(null, result, httpRequest, response);
});
});
let result = null;
if (responseBody === '') responseBody = null;
// Deserialize Response
if (statusCode === 200) {
let parsedResponse = null;
try {
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined) {
let resultMapper = new client.models['NetworkInterfaceLoadBalancerListResult']().mapper();
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
deserializationError.request = msRest.stripRequest(httpRequest);
deserializationError.response = msRest.stripResponse(response);
return callback(deserializationError);
}
}
return callback(null, result, httpRequest, response);
});
}
let responseBody = pollingResult.body;
if (responseBody === '') responseBody = null;
// Deserialize Response
let parsedResponse = null;
try {
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined) {
let resultMapper = new client.models['User']().mapper();
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
deserializationError.request = msRest.stripRequest(httpRequest);
deserializationError.response = msRest.stripResponse(response);
return callback(deserializationError);
}
return callback(null, result, httpRequest, response);
});
});
let result = null;
if (responseBody === '') responseBody = null;
// Deserialize Response
if (statusCode === 200) {
let parsedResponse = null;
try {
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined) {
let resultMapper = new client.models['WorkloadProtectableItemResourceList']().mapper();
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
deserializationError.request = msRest.stripRequest(httpRequest);
deserializationError.response = msRest.stripResponse(response);
return callback(deserializationError);
}
}
return callback(null, result, httpRequest, response);
});
}
let result = null;
if (responseBody === '') responseBody = null;
// Deserialize Response
if (statusCode === 200) {
let parsedResponse = null;
try {
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined) {
let resultMapper = new client.models['ArrayWrapper']().mapper();
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
deserializationError.request = msRest.stripRequest(httpRequest);
deserializationError.response = msRest.stripResponse(response);
return callback(deserializationError);
}
}
return callback(null, result, httpRequest, response);
});
}
let responseBody = pollingResult.body;
if (responseBody === '') responseBody = null;
// Deserialize Response
let parsedResponse = null;
try {
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined) {
let resultMapper = new client.models['OperationStatusResponse']().mapper();
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
deserializationError.request = msRest.stripRequest(httpRequest);
deserializationError.response = msRest.stripResponse(response);
return callback(deserializationError);
}
return callback(null, result, httpRequest, response);
});
});
response = pollingResult.response;
let responseBody = pollingResult.body;
if (responseBody === '') responseBody = null;
// Deserialize Response
let parsedResponse = null;
try {
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined && options.deserializationMapperForTerminalResponse) {
result = msRest.deserialize(options.deserializationMapperForTerminalResponse, parsedResponse, 'result');
}
} catch (error) {
let deserializationError = new Error(`Error "${JSON.stringify(error, null, 2)}" occurred in deserializing the responseBody - "${responseBody}".`);
deserializationError.request = msRest.stripRequest(request);
deserializationError.response = msRest.stripResponse(response);
return callback(deserializationError);
}
return callback(null, result, request, response);
});
});
let responseBody = pollingResult.body;
if (responseBody === '') responseBody = null;
// Deserialize Response
let parsedResponse = null;
try {
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined) {
let resultMapper = new client.models['NetworkMapping']().mapper();
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
deserializationError.request = msRest.stripRequest(httpRequest);
deserializationError.response = msRest.stripResponse(response);
return callback(deserializationError);
}
return callback(null, result, httpRequest, response);
});
});
}
}
// Deserialize Response
if (statusCode === 201) {
var parsedResponse = null;
try {
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined) {
var resultMapper = new client.models['AlertRuleResource']().mapper();
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
var deserializationError1 = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody));
deserializationError1.request = msRest.stripRequest(httpRequest);
deserializationError1.response = msRest.stripResponse(response);
return callback(deserializationError1);
}
}
return callback(null, result, httpRequest, response);
});
};
element: {
required: false,
serializedName: 'UserProfileResponseElementType',
type: {
name: 'Composite',
className: 'UserProfileResponse'
}
}
}
};
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
deserializationError.request = msRest.stripRequest(httpRequest);
deserializationError.response = msRest.stripResponse(response);
return callback(deserializationError);
}
}
return callback(null, result, httpRequest, response);
});
}