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

/**
 * Product Update parameters.
 *
 */
class ProductUpdateParameters {
  /**
   * Create a ProductUpdateParameters.
   * @property {string} [description] Product description. May include HTML
   * formatting tags.
   * @property {string} [terms] Product terms of use. Developers trying to
   * subscribe to the product will be presented and required to accept these
   * terms before they can complete the subscription process.
   * @property {boolean} [subscriptionRequired] Whether a product subscription
   * is required for accessing APIs included in this product. If true, the
   * product is referred to as "protected" and a valid subscription key is
   * required for a request to an API included in the product to succeed. If
   * false, the product is referred to as "open" and requests to an API
   * included in the product can be made without a subscription key. If
   * property is omitted when creating a new product it's value is assumed to
   * be true.
   * @property {boolean} [approvalRequired] whether subscription approval is
   * required. If false, new subscriptions will be approved automatically
   * enabling developers to call the product’s APIs immediately after
   * subscribing. If true, administrators must manually approve the
   * subscription before the developer can any of the product’s APIs. Can be
   * present only if subscriptionRequired property is present and has a value
   * of false.
   * @property {number} [subscriptionsLimit] Whether the number of
   * subscriptions a user can have to this product at the same time. Set to
   * null or omit to allow unlimited per user subscriptions. Can be present
   * only if subscriptionRequired property is present and has a value of false.
   * @property {string} [state] whether product is published or not. Published
   * products are discoverable by users of developer portal. Non published
   * products are visible only to administrators. Default state of Product is
   * notPublished. Possible values include: 'notPublished', 'published'
   * @property {string} [displayName] Product name.
   */
  constructor() {
  }

  /**
   * Defines the metadata of ProductUpdateParameters
   *
   * @returns {object} metadata of ProductUpdateParameters
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ProductUpdateParameters',
      type: {
        name: 'Composite',
        className: 'ProductUpdateParameters',
        modelProperties: {
          description: {
            required: false,
            serializedName: 'properties.description',
            constraints: {
              MaxLength: 1000,
              MinLength: 1
            },
            type: {
              name: 'String'
            }
          },
          terms: {
            required: false,
            serializedName: 'properties.terms',
            type: {
              name: 'String'
            }
          },
          subscriptionRequired: {
            required: false,
            serializedName: 'properties.subscriptionRequired',
            type: {
              name: 'Boolean'
            }
          },
          approvalRequired: {
            required: false,
            serializedName: 'properties.approvalRequired',
            type: {
              name: 'Boolean'
            }
          },
          subscriptionsLimit: {
            required: false,
            serializedName: 'properties.subscriptionsLimit',
            type: {
              name: 'Number'
            }
          },
          state: {
            required: false,
            serializedName: 'properties.state',
            type: {
              name: 'Enum',
              allowedValues: [ 'notPublished', 'published' ]
            }
          },
          displayName: {
            required: false,
            serializedName: 'properties.displayName',
            constraints: {
              MaxLength: 300,
              MinLength: 1
            },
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ProductUpdateParameters;
