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

/**
 * Describes an entity.
 *
 * @extends models['MetadataDefinitionBase']
 */
class EntityTypeDefinition extends models['MetadataDefinitionBase'] {
  /**
   * Create a EntityTypeDefinition.
   * @member {string} [apiEntitySetName] The api entity set name. This becomes
   * the odata entity set name for the entity Type being refered in this
   * object.
   * @member {string} [entityType] Type of entity. Possible values include:
   * 'None', 'Profile', 'Interaction', 'Relationship'
   * @member {array} [fields] The properties of the Profile.
   * @member {number} [instancesCount] The instance count.
   * @member {date} [lastChangedUtc] The last changed time for the type
   * definition.
   * @member {string} [provisioningState] Provisioning state. Possible values
   * include: 'Provisioning', 'Succeeded', 'Expiring', 'Deleting',
   * 'HumanIntervention', 'Failed'
   * @member {string} [schemaItemTypeLink] The schema org link. This helps ACI
   * identify and suggest semantic models.
   * @member {string} [tenantId] The hub name.
   * @member {string} [timestampFieldName] The timestamp property name.
   * Represents the time when the interaction or profile update happened.
   * @member {string} [typeName] The name of the entity.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of EntityTypeDefinition
   *
   * @returns {object} metadata of EntityTypeDefinition
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'EntityTypeDefinition',
      type: {
        name: 'Composite',
        className: 'EntityTypeDefinition',
        modelProperties: {
          attributes: {
            required: false,
            serializedName: 'attributes',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'ArrayElementType',
                  type: {
                    name: 'Sequence',
                    element: {
                        required: false,
                        serializedName: 'StringElementType',
                        type: {
                          name: 'String'
                        }
                    }
                  }
              }
            }
          },
          description: {
            required: false,
            serializedName: 'description',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          displayName: {
            required: false,
            serializedName: 'displayName',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          localizedAttributes: {
            required: false,
            serializedName: 'localizedAttributes',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'ObjectElementType',
                  type: {
                    name: 'Dictionary',
                    value: {
                        required: false,
                        serializedName: 'StringElementType',
                        type: {
                          name: 'String'
                        }
                    }
                  }
              }
            }
          },
          smallImage: {
            required: false,
            serializedName: 'smallImage',
            type: {
              name: 'String'
            }
          },
          mediumImage: {
            required: false,
            serializedName: 'mediumImage',
            type: {
              name: 'String'
            }
          },
          largeImage: {
            required: false,
            serializedName: 'largeImage',
            type: {
              name: 'String'
            }
          },
          apiEntitySetName: {
            required: false,
            serializedName: 'apiEntitySetName',
            type: {
              name: 'String'
            }
          },
          entityType: {
            required: false,
            serializedName: 'entityType',
            type: {
              name: 'Enum',
              allowedValues: [ 'None', 'Profile', 'Interaction', 'Relationship' ]
            }
          },
          fields: {
            required: false,
            serializedName: 'fields',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'PropertyDefinitionElementType',
                  type: {
                    name: 'Composite',
                    className: 'PropertyDefinition'
                  }
              }
            }
          },
          instancesCount: {
            required: false,
            serializedName: 'instancesCount',
            type: {
              name: 'Number'
            }
          },
          lastChangedUtc: {
            required: false,
            readOnly: true,
            serializedName: 'lastChangedUtc',
            type: {
              name: 'DateTime'
            }
          },
          provisioningState: {
            required: false,
            readOnly: true,
            serializedName: 'provisioningState',
            type: {
              name: 'String'
            }
          },
          schemaItemTypeLink: {
            required: false,
            serializedName: 'schemaItemTypeLink',
            type: {
              name: 'String'
            }
          },
          tenantId: {
            required: false,
            readOnly: true,
            serializedName: 'tenantId',
            type: {
              name: 'String'
            }
          },
          timestampFieldName: {
            required: false,
            serializedName: 'timestampFieldName',
            type: {
              name: 'String'
            }
          },
          typeName: {
            required: false,
            serializedName: 'typeName',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = EntityTypeDefinition;
