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

/**
 * Information about a Service Fabric property.
 *
 */
class PropertyInfo {
  /**
   * Create a PropertyInfo.
   * @property {string} name The name of the Service Fabric property.
   * @property {object} [value] Describes a Service Fabric property value.
   * @property {string} [value.kind] Polymorphic Discriminator
   * @property {object} metadata The metadata associated with a property,
   * including the property's name.
   * @property {string} [metadata.typeId] The kind of property, determined by
   * the type of data. Following are the possible values. Possible values
   * include: 'Invalid', 'Binary', 'Int64', 'Double', 'String', 'Guid'
   * @property {string} [metadata.customTypeId] The property's custom type ID.
   * @property {string} [metadata.parent] The name of the parent Service Fabric
   * Name for the property. It could be thought of as the name-space/table
   * under which the property exists.
   * @property {number} [metadata.sizeInBytes] The length of the serialized
   * property value.
   * @property {date} [metadata.lastModifiedUtcTimestamp] Represents when the
   * Property was last modified. Only write operations will cause this field to
   * be updated.
   * @property {string} [metadata.sequenceNumber] The version of the property.
   * Every time a property is modified, its sequence number is increased.
   */
  constructor() {
  }

  /**
   * Defines the metadata of PropertyInfo
   *
   * @returns {object} metadata of PropertyInfo
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'PropertyInfo',
      type: {
        name: 'Composite',
        className: 'PropertyInfo',
        modelProperties: {
          name: {
            required: true,
            serializedName: 'Name',
            type: {
              name: 'String'
            }
          },
          value: {
            required: false,
            serializedName: 'Value',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'Kind',
                clientName: 'kind'
              },
              uberParent: 'PropertyValue',
              className: 'PropertyValue'
            }
          },
          metadata: {
            required: true,
            serializedName: 'Metadata',
            type: {
              name: 'Composite',
              className: 'PropertyMetadata'
            }
          }
        }
      }
    };
  }
}

module.exports = PropertyInfo;
