}
throw ex;
}
// Create Result
MediaServicesAccountGetResponse result = null;
// Deserialize Response
InputStream responseContent = httpResponse.getEntity().getContent();
result = new MediaServicesAccountGetResponse();
ObjectMapper objectMapper = new ObjectMapper();
JsonNode responseDoc = null;
if (responseContent == null == false) {
responseDoc = objectMapper.readTree(responseContent);
}
if (responseDoc != null) {
MediaServicesAccount accountInstance = new MediaServicesAccount();
result.setAccount(accountInstance);
JsonNode accountNameValue = responseDoc.get("AccountName");
if (accountNameValue != null) {
String accountNameInstance;
accountNameInstance = accountNameValue.getTextValue();
accountInstance.setAccountName(accountNameInstance);
}
JsonNode accountKeyValue = responseDoc.get("AccountKey");
if (accountKeyValue != null) {
String accountKeyInstance;
accountKeyInstance = accountKeyValue.getTextValue();
accountInstance.setAccountKey(accountKeyInstance);
}
JsonNode accountKeysValue = responseDoc.get("AccountKeys");
if (accountKeysValue != null) {
MediaServicesAccount.AccountKeys accountKeysInstance = new MediaServicesAccount.AccountKeys();
accountInstance.setStorageAccountKeys(accountKeysInstance);
JsonNode primaryValue = accountKeysValue.get("Primary");
if (primaryValue != null) {
String primaryInstance;
primaryInstance = primaryValue.getTextValue();
accountKeysInstance.setPrimary(primaryInstance);
}
JsonNode secondaryValue = accountKeysValue.get("Secondary");
if (secondaryValue != null) {
String secondaryInstance;
secondaryInstance = secondaryValue.getTextValue();
accountKeysInstance.setSecondary(secondaryInstance);
}
}
JsonNode accountRegionValue = responseDoc.get("AccountRegion");
if (accountRegionValue != null) {
String accountRegionInstance;
accountRegionInstance = accountRegionValue.getTextValue();
accountInstance.setAccountRegion(accountRegionInstance);
}
JsonNode storageAccountNameValue = responseDoc.get("StorageAccountName");
if (storageAccountNameValue != null) {
String storageAccountNameInstance;
storageAccountNameInstance = storageAccountNameValue.getTextValue();
accountInstance.setStorageAccountName(storageAccountNameInstance);
}
}
result.setStatusCode(statusCode);
if (httpResponse.getHeaders("x-ms-request-id").length > 0) {
result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue());
}
if (shouldTrace) {
CloudTracing.exit(invocationId, result);
}