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

/**
 * Routing rules to apply to an endpoint
 *
 */
class RoutingRuleUpdateParameters {
  /**
   * Create a RoutingRuleUpdateParameters.
   * @member {array} [frontendEndpoints] Frontend endpoints associated with
   * this rule
   * @member {array} [acceptedProtocols] Protocol schemes to match for this
   * rule
   * @member {array} [patternsToMatch] The route patterns of the rule.
   * @member {string} [customForwardingPath] A custom path used to rewrite
   * resource paths matched by this rule. Leave empty to use incoming path.
   * @member {string} [forwardingProtocol] Protocol this rule will use when
   * forwarding traffic to backends. Possible values include: 'HttpOnly',
   * 'HttpsOnly', 'MatchRequest'
   * @member {object} [cacheConfiguration] The caching configuration associated
   * with this rule.
   * @member {string} [cacheConfiguration.queryParameterStripDirective]
   * Treatment of URL query terms when forming the cache key. Possible values
   * include: 'StripNone', 'StripAll'
   * @member {string} [cacheConfiguration.dynamicCompression] Whether to use
   * dynamic compression for cached content. Possible values include:
   * 'Enabled', 'Disabled'
   * @member {object} [backendPool] A reference to the BackendPool which this
   * rule routes to.
   * @member {string} [backendPool.id] Resource ID.
   * @member {string} [enabledState] Whether to enable use of this rule.
   * Permitted values are 'Enabled' or 'Disabled'. Possible values include:
   * 'Enabled', 'Disabled'
   */
  constructor() {
  }

  /**
   * Defines the metadata of RoutingRuleUpdateParameters
   *
   * @returns {object} metadata of RoutingRuleUpdateParameters
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'RoutingRuleUpdateParameters',
      type: {
        name: 'Composite',
        className: 'RoutingRuleUpdateParameters',
        modelProperties: {
          frontendEndpoints: {
            required: false,
            serializedName: 'frontendEndpoints',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'SubResourceElementType',
                  type: {
                    name: 'Composite',
                    className: 'SubResource'
                  }
              }
            }
          },
          acceptedProtocols: {
            required: false,
            serializedName: 'acceptedProtocols',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'FrontDoorProtocolElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          patternsToMatch: {
            required: false,
            serializedName: 'patternsToMatch',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          customForwardingPath: {
            required: false,
            serializedName: 'customForwardingPath',
            type: {
              name: 'String'
            }
          },
          forwardingProtocol: {
            required: false,
            serializedName: 'forwardingProtocol',
            type: {
              name: 'String'
            }
          },
          cacheConfiguration: {
            required: false,
            serializedName: 'cacheConfiguration',
            type: {
              name: 'Composite',
              className: 'CacheConfiguration'
            }
          },
          backendPool: {
            required: false,
            serializedName: 'backendPool',
            type: {
              name: 'Composite',
              className: 'SubResource'
            }
          },
          enabledState: {
            required: false,
            serializedName: 'enabledState',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = RoutingRuleUpdateParameters;
