/*
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 * 
 * Code generated by Microsoft (R) AutoRest Code Generator.
 * Changes may cause incorrect behavior and will be lost if the code is
 * regenerated.
 */

'use strict';

var models = require('./index');

var util = require('util');

/**
 * @class
 * Initializes a new instance of the StorageAccount class.
 * @constructor
 * The storage account.
 * @member {object} [sku] Gets the SKU.
 * 
 * @member {string} [sku.name] Gets or sets the sku name. Required for account
 * creation, optional for update. Note that in older versions, sku name was
 * called accountType. Possible values include: 'Standard_LRS',
 * 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS'
 * 
 * @member {string} [sku.tier] Gets the sku tier. This is based on the SKU
 * name. Possible values include: 'Standard', 'Premium'
 * 
 * @member {string} [kind] Gets the Kind. Possible values include: 'Storage',
 * 'BlobStorage'
 * 
 * @member {string} [provisioningState] Gets the status of the storage account
 * at the time the operation was called. Possible values include: 'Creating',
 * 'ResolvingDNS', 'Succeeded'
 * 
 * @member {object} [primaryEndpoints] Gets the URLs that are used to perform
 * a retrieval of a public blob, queue or table object.Note that StandardZRS
 * and PremiumLRS accounts only return the blob endpoint.
 * 
 * @member {string} [primaryEndpoints.blob] Gets the blob endpoint.
 * 
 * @member {string} [primaryEndpoints.queue] Gets the queue endpoint.
 * 
 * @member {string} [primaryEndpoints.table] Gets the table endpoint.
 * 
 * @member {string} [primaryEndpoints.file] Gets the file endpoint.
 * 
 * @member {string} [primaryLocation] Gets the location of the primary for the
 * storage account.
 * 
 * @member {string} [statusOfPrimary] Gets the status indicating whether the
 * primary location of the storage account is available or unavailable.
 * Possible values include: 'Available', 'Unavailable'
 * 
 * @member {date} [lastGeoFailoverTime] Gets the timestamp of the most recent
 * instance of a failover to the secondary location. Only the most recent
 * timestamp is retained. This element is not returned if there has never
 * been a failover instance. Only available if the accountType is StandardGRS
 * or StandardRAGRS.
 * 
 * @member {string} [secondaryLocation] Gets the location of the geo
 * replicated secondary for the storage account. Only available if the
 * accountType is StandardGRS or StandardRAGRS.
 * 
 * @member {string} [statusOfSecondary] Gets the status indicating whether the
 * secondary location of the storage account is available or unavailable.
 * Only available if the accountType is StandardGRS or StandardRAGRS.
 * Possible values include: 'Available', 'Unavailable'
 * 
 * @member {date} [creationTime] Gets the creation date and time of the
 * storage account in UTC.
 * 
 * @member {object} [customDomain] Gets the user assigned custom domain
 * assigned to this storage account.
 * 
 * @member {string} [customDomain.name] Gets or sets the custom domain name.
 * Name is the CNAME source.
 * 
 * @member {boolean} [customDomain.useSubDomain] Indicates whether indirect
 * CName validation is enabled. Default value is false. This should only be
 * set on updates
 * 
 * @member {object} [secondaryEndpoints] Gets the URLs that are used to
 * perform a retrieval of a public blob, queue or table object from the
 * secondary location of the storage account. Only available if the
 * accountType is StandardRAGRS.
 * 
 * @member {string} [secondaryEndpoints.blob] Gets the blob endpoint.
 * 
 * @member {string} [secondaryEndpoints.queue] Gets the queue endpoint.
 * 
 * @member {string} [secondaryEndpoints.table] Gets the table endpoint.
 * 
 * @member {string} [secondaryEndpoints.file] Gets the file endpoint.
 * 
 * @member {object} [encryption] Gets the encryption settings on the account.
 * If unspecified the account is unencrypted.
 * 
 * @member {object} [encryption.services] Gets the services which are
 * encrypted.
 * 
 * @member {object} [encryption.services.blob] The blob service.
 * 
 * @member {boolean} [encryption.services.blob.enabled] A boolean indicating
 * whether or not the service is encrypted.
 * 
 * @member {date} [encryption.services.blob.lastEnabledTime] Gets a time value
 * indicating when was the encryption enabled by the user last time. We
 * return this value only when encryption is enabled. There might be some
 * unencrypted blobs which were written after this time. This time is just to
 * give a rough estimate of when encryption was enabled.
 * 
 * @member {string} [accessTier] The access tier used for billing. Access tier
 * cannot be changed more than once every 7 days (168 hours). Access tier
 * cannot be set for StandardLRS, StandardGRS, StandardRAGRS, or PremiumLRS
 * account types. Possible values include: 'Hot', 'Cool'
 * 
 */
function StorageAccount() {
  StorageAccount['super_'].call(this);
}

util.inherits(StorageAccount, models['Resource']);

/**
 * Defines the metadata of StorageAccount
 *
 * @returns {object} metadata of StorageAccount
 *
 */
StorageAccount.prototype.mapper = function () {
  return {
    required: false,
    serializedName: 'StorageAccount',
    type: {
      name: 'Composite',
      className: 'StorageAccount',
      modelProperties: {
        id: {
          required: false,
          readOnly: true,
          serializedName: 'id',
          type: {
            name: 'String'
          }
        },
        name: {
          required: false,
          readOnly: true,
          serializedName: 'name',
          type: {
            name: 'String'
          }
        },
        type: {
          required: false,
          readOnly: true,
          serializedName: 'type',
          type: {
            name: 'String'
          }
        },
        location: {
          required: false,
          serializedName: 'location',
          type: {
            name: 'String'
          }
        },
        tags: {
          required: false,
          serializedName: 'tags',
          type: {
            name: 'Dictionary',
            value: {
                required: false,
                serializedName: 'StringElementType',
                type: {
                  name: 'String'
                }
            }
          }
        },
        sku: {
          required: false,
          readOnly: true,
          serializedName: 'sku',
          type: {
            name: 'Composite',
            className: 'Sku'
          }
        },
        kind: {
          required: false,
          readOnly: true,
          serializedName: 'kind',
          type: {
            name: 'Enum',
            allowedValues: [ 'Storage', 'BlobStorage' ]
          }
        },
        provisioningState: {
          required: false,
          readOnly: true,
          serializedName: 'properties.provisioningState',
          type: {
            name: 'Enum',
            allowedValues: [ 'Creating', 'ResolvingDNS', 'Succeeded' ]
          }
        },
        primaryEndpoints: {
          required: false,
          readOnly: true,
          serializedName: 'properties.primaryEndpoints',
          type: {
            name: 'Composite',
            className: 'Endpoints'
          }
        },
        primaryLocation: {
          required: false,
          readOnly: true,
          serializedName: 'properties.primaryLocation',
          type: {
            name: 'String'
          }
        },
        statusOfPrimary: {
          required: false,
          readOnly: true,
          serializedName: 'properties.statusOfPrimary',
          type: {
            name: 'Enum',
            allowedValues: [ 'Available', 'Unavailable' ]
          }
        },
        lastGeoFailoverTime: {
          required: false,
          readOnly: true,
          serializedName: 'properties.lastGeoFailoverTime',
          type: {
            name: 'DateTime'
          }
        },
        secondaryLocation: {
          required: false,
          readOnly: true,
          serializedName: 'properties.secondaryLocation',
          type: {
            name: 'String'
          }
        },
        statusOfSecondary: {
          required: false,
          readOnly: true,
          serializedName: 'properties.statusOfSecondary',
          type: {
            name: 'Enum',
            allowedValues: [ 'Available', 'Unavailable' ]
          }
        },
        creationTime: {
          required: false,
          readOnly: true,
          serializedName: 'properties.creationTime',
          type: {
            name: 'DateTime'
          }
        },
        customDomain: {
          required: false,
          readOnly: true,
          serializedName: 'properties.customDomain',
          type: {
            name: 'Composite',
            className: 'CustomDomain'
          }
        },
        secondaryEndpoints: {
          required: false,
          readOnly: true,
          serializedName: 'properties.secondaryEndpoints',
          type: {
            name: 'Composite',
            className: 'Endpoints'
          }
        },
        encryption: {
          required: false,
          readOnly: true,
          serializedName: 'properties.encryption',
          type: {
            name: 'Composite',
            className: 'Encryption'
          }
        },
        accessTier: {
          required: false,
          readOnly: true,
          serializedName: 'properties.accessTier',
          type: {
            name: 'Enum',
            allowedValues: [ 'Hot', 'Cool' ]
          }
        }
      }
    }
  };
};

module.exports = StorageAccount;
