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

/**
 * The CRM connector properties.
 *
 */
class CrmConnectorProperties {
  /**
   * Create a CrmConnectorProperties.
   * @member {string} [connectionString] The connection string.
   * @member {string} organizationId The organization ID.
   * @member {string} organizationUrl The organization URL.
   * @member {array} entities The entities like account, contact, opportunity.
   * @member {string} [accessToken] The access token.
   */
  constructor() {
  }

  /**
   * Defines the metadata of CrmConnectorProperties
   *
   * @returns {object} metadata of CrmConnectorProperties
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'CrmConnectorProperties',
      type: {
        name: 'Composite',
        className: 'CrmConnectorProperties',
        modelProperties: {
          connectionString: {
            required: false,
            serializedName: 'connectionString',
            type: {
              name: 'String'
            }
          },
          organizationId: {
            required: true,
            serializedName: 'organizationId',
            type: {
              name: 'String'
            }
          },
          organizationUrl: {
            required: true,
            serializedName: 'organizationUrl',
            type: {
              name: 'String'
            }
          },
          entities: {
            required: true,
            serializedName: 'entities',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'CrmConnectorEntitiesElementType',
                  type: {
                    name: 'Composite',
                    className: 'CrmConnectorEntities'
                  }
              }
            }
          },
          accessToken: {
            required: false,
            serializedName: 'accessToken',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = CrmConnectorProperties;
