/*
 * 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';

/**
 * Parameters supplied to the Create Redis operation.
 *
 */
class RedisCreateParameters {
  /**
   * Create a RedisCreateParameters.
   * @property {object} [redisConfiguration] All Redis Settings. Few possible
   * keys:
   * rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value
   * etc.
   * @property {boolean} [enableNonSslPort] Specifies whether the non-ssl Redis
   * server port (6379) is enabled.
   * @property {object} [tenantSettings] A dictionary of tenant settings
   * @property {number} [shardCount] The number of shards to be created on a
   * Premium Cluster Cache.
   * @property {string} [minimumTlsVersion] Optional: requires clients to use a
   * specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2').
   * Possible values include: '1.0', '1.1', '1.2'
   * @property {object} sku The SKU of the Redis cache to deploy.
   * @property {string} [sku.name] The type of Redis cache to deploy. Valid
   * values: (Basic, Standard, Premium). Possible values include: 'Basic',
   * 'Standard', 'Premium'
   * @property {string} [sku.family] The SKU family to use. Valid values: (C,
   * P). (C = Basic/Standard, P = Premium). Possible values include: 'C', 'P'
   * @property {number} [sku.capacity] The size of the Redis cache to deploy.
   * Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), for P
   * (Premium) family (1, 2, 3, 4).
   * @property {string} [subnetId] The full resource ID of a subnet in a
   * virtual network to deploy the Redis cache in. Example format:
   * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1
   * @property {string} [staticIP] Static IP address. Required when deploying a
   * Redis cache inside an existing Azure Virtual Network.
   * @property {array} [zones] A list of availability zones denoting where the
   * resource needs to come from.
   * @property {string} location The geo-location where the resource lives
   * @property {object} [tags] Resource tags.
   */
  constructor() {
  }

  /**
   * Defines the metadata of RedisCreateParameters
   *
   * @returns {object} metadata of RedisCreateParameters
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'RedisCreateParameters',
      type: {
        name: 'Composite',
        className: 'RedisCreateParameters',
        modelProperties: {
          redisConfiguration: {
            required: false,
            serializedName: 'properties.redisConfiguration',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          enableNonSslPort: {
            required: false,
            serializedName: 'properties.enableNonSslPort',
            type: {
              name: 'Boolean'
            }
          },
          tenantSettings: {
            required: false,
            serializedName: 'properties.tenantSettings',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          shardCount: {
            required: false,
            serializedName: 'properties.shardCount',
            type: {
              name: 'Number'
            }
          },
          minimumTlsVersion: {
            required: false,
            serializedName: 'properties.minimumTlsVersion',
            type: {
              name: 'String'
            }
          },
          sku: {
            required: true,
            serializedName: 'properties.sku',
            type: {
              name: 'Composite',
              className: 'Sku'
            }
          },
          subnetId: {
            required: false,
            serializedName: 'properties.subnetId',
            constraints: {
              Pattern: /^\/subscriptions\/[^\/]*\/resourceGroups\/[^\/]*\/providers\/Microsoft.(ClassicNetwork|Network)\/virtualNetworks\/[^\/]*\/subnets\/[^\/]*$/
            },
            type: {
              name: 'String'
            }
          },
          staticIP: {
            required: false,
            serializedName: 'properties.staticIP',
            constraints: {
              Pattern: /^\d+\.\d+\.\d+\.\d+$/
            },
            type: {
              name: 'String'
            }
          },
          zones: {
            required: false,
            serializedName: 'zones',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          location: {
            required: true,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = RedisCreateParameters;
