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

/**
 * Subscription update details.
 *
 */
class SubscriptionUpdateParameters {
  /**
   * Create a SubscriptionUpdateParameters.
   * @property {string} [ownerId] User identifier path: /users/{userId}
   * @property {string} [scope] Scope like /products/{productId} or /apis or
   * /apis/{apiId}
   * @property {date} [expirationDate] Subscription expiration date. The
   * setting is for audit purposes only and the subscription is not
   * automatically expired. The subscription lifecycle can be managed by using
   * the `state` property. The date conforms to the following format:
   * `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
   * @property {string} [displayName] Subscription name.
   * @property {string} [primaryKey] Primary subscription key.
   * @property {string} [secondaryKey] Secondary subscription key.
   * @property {string} [state] Subscription state. Possible states are *
   * active – the subscription is active, * suspended – the subscription is
   * blocked, and the subscriber cannot call any APIs of the product, *
   * submitted – the subscription request has been made by the developer, but
   * has not yet been approved or rejected, * rejected – the subscription
   * request has been denied by an administrator, * cancelled – the
   * subscription has been cancelled by the developer or administrator, *
   * expired – the subscription reached its expiration date and was
   * deactivated. Possible values include: 'suspended', 'active', 'expired',
   * 'submitted', 'rejected', 'cancelled'
   * @property {string} [stateComment] Comments describing subscription state
   * change by the administrator when the state is changed to the 'rejected'.
   * @property {boolean} [allowTracing] Determines whether tracing can be
   * enabled
   */
  constructor() {
  }

  /**
   * Defines the metadata of SubscriptionUpdateParameters
   *
   * @returns {object} metadata of SubscriptionUpdateParameters
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'SubscriptionUpdateParameters',
      type: {
        name: 'Composite',
        className: 'SubscriptionUpdateParameters',
        modelProperties: {
          ownerId: {
            required: false,
            serializedName: 'properties.ownerId',
            type: {
              name: 'String'
            }
          },
          scope: {
            required: false,
            serializedName: 'properties.scope',
            type: {
              name: 'String'
            }
          },
          expirationDate: {
            required: false,
            serializedName: 'properties.expirationDate',
            type: {
              name: 'DateTime'
            }
          },
          displayName: {
            required: false,
            serializedName: 'properties.displayName',
            type: {
              name: 'String'
            }
          },
          primaryKey: {
            required: false,
            serializedName: 'properties.primaryKey',
            constraints: {
              MaxLength: 256,
              MinLength: 1
            },
            type: {
              name: 'String'
            }
          },
          secondaryKey: {
            required: false,
            serializedName: 'properties.secondaryKey',
            constraints: {
              MaxLength: 256,
              MinLength: 1
            },
            type: {
              name: 'String'
            }
          },
          state: {
            required: false,
            serializedName: 'properties.state',
            type: {
              name: 'Enum',
              allowedValues: [ 'suspended', 'active', 'expired', 'submitted', 'rejected', 'cancelled' ]
            }
          },
          stateComment: {
            required: false,
            serializedName: 'properties.stateComment',
            type: {
              name: 'String'
            }
          },
          allowTracing: {
            required: false,
            serializedName: 'properties.allowTracing',
            type: {
              name: 'Boolean'
            }
          }
        }
      }
    };
  }
}

module.exports = SubscriptionUpdateParameters;
