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

/**
 * Factory resource type.
 *
 * @extends models['Resource']
 */
class Factory extends models['Resource'] {
  /**
   * Create a Factory.
   * @member {object} [identity] Managed service identity of the factory.
   * @member {uuid} [identity.principalId] The principal id of the identity.
   * @member {uuid} [identity.tenantId] The client tenant id of the identity.
   * @member {string} [provisioningState] Factory provisioning state, example
   * Succeeded.
   * @member {date} [createTime] Time the factory was created in ISO8601
   * format.
   * @member {string} [version] Version of the factory.
   * @member {object} [repoConfiguration] Git repo information of the factory.
   * @member {string} [repoConfiguration.accountName] Account name.
   * @member {string} [repoConfiguration.repositoryName] Rrepository name.
   * @member {string} [repoConfiguration.collaborationBranch] Collaboration
   * branch.
   * @member {string} [repoConfiguration.rootFolder] Root folder.
   * @member {string} [repoConfiguration.lastCommitId] Last commit id.
   * @member {string} [repoConfiguration.type] Polymorphic Discriminator
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of Factory
   *
   * @returns {object} metadata of Factory
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Factory',
      type: {
        name: 'Composite',
        additionalProperties: {
          type: {
            name: 'Dictionary',
            value: {
                required: false,
                serializedName: 'ObjectElementType',
                type: {
                  name: 'Object'
                }
            }
          }
        },
        className: 'Factory',
        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'
            }
          },
          location: {
            required: false,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          eTag: {
            required: false,
            readOnly: true,
            serializedName: 'eTag',
            type: {
              name: 'String'
            }
          },
          identity: {
            required: false,
            serializedName: 'identity',
            type: {
              name: 'Composite',
              className: 'FactoryIdentity'
            }
          },
          provisioningState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          createTime: {
            required: false,
            readOnly: true,
            serializedName: 'properties.createTime',
            type: {
              name: 'DateTime'
            }
          },
          version: {
            required: false,
            readOnly: true,
            serializedName: 'properties.version',
            type: {
              name: 'String'
            }
          },
          repoConfiguration: {
            required: false,
            serializedName: 'properties.repoConfiguration',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'type',
                clientName: 'type'
              },
              uberParent: 'FactoryRepoConfiguration',
              className: 'FactoryRepoConfiguration'
            }
          }
        }
      }
    };
  }
}

module.exports = Factory;
