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

/**
 * Compliance of a scope
 *
 * @extends models['Resource']
 */
class Compliance extends models['Resource'] {
  /**
   * Create a Compliance.
   * @member {date} [assessmentTimestampUtcDate] The timestamp when the
   * Compliance calculation was conducted.
   * @member {number} [resourceCount] The resource count of the given
   * subscription for which the Compliance calculation was conducted (needed
   * for Management Group Compliance calculation).
   * @member {array} [assessmentResult] An array of segment, which is the
   * actually the compliance assessment.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of Compliance
   *
   * @returns {object} metadata of Compliance
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Compliance',
      type: {
        name: 'Composite',
        className: 'Compliance',
        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'
            }
          },
          assessmentTimestampUtcDate: {
            required: false,
            readOnly: true,
            serializedName: 'properties.assessmentTimestampUtcDate',
            type: {
              name: 'DateTime'
            }
          },
          resourceCount: {
            required: false,
            readOnly: true,
            serializedName: 'properties.resourceCount',
            type: {
              name: 'Number'
            }
          },
          assessmentResult: {
            required: false,
            readOnly: true,
            serializedName: 'properties.assessmentResult',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ComplianceSegmentElementType',
                  type: {
                    name: 'Composite',
                    className: 'ComplianceSegment'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = Compliance;
