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

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

/**
 * Delegation settings for a developer portal.
 *
 * @extends models['Resource']
 */
class PortalDelegationSettings extends models['Resource'] {
  /**
   * Create a PortalDelegationSettings.
   * @property {string} [url] A delegation Url.
   * @property {string} [validationKey] A base64-encoded validation key to
   * validate, that a request is coming from Azure API Management.
   * @property {object} [subscriptions] Subscriptions delegation settings.
   * @property {boolean} [subscriptions.enabled] Enable or disable delegation
   * for subscriptions.
   * @property {object} [userRegistration] User registration delegation
   * settings.
   * @property {boolean} [userRegistration.enabled] Enable or disable
   * delegation for user registration.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of PortalDelegationSettings
   *
   * @returns {object} metadata of PortalDelegationSettings
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'PortalDelegationSettings',
      type: {
        name: 'Composite',
        className: 'PortalDelegationSettings',
        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'
            }
          },
          url: {
            required: false,
            serializedName: 'properties.url',
            type: {
              name: 'String'
            }
          },
          validationKey: {
            required: false,
            serializedName: 'properties.validationKey',
            type: {
              name: 'String'
            }
          },
          subscriptions: {
            required: false,
            serializedName: 'properties.subscriptions',
            type: {
              name: 'Composite',
              className: 'SubscriptionsDelegationSettingsProperties'
            }
          },
          userRegistration: {
            required: false,
            serializedName: 'properties.userRegistration',
            type: {
              name: 'Composite',
              className: 'RegistrationDelegationSettingsProperties'
            }
          }
        }
      }
    };
  }
}

module.exports = PortalDelegationSettings;
