/*
 * 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 link resource format.
 *
 * @extends models['ProxyResource']
 */
class LinkResourceFormat extends models['ProxyResource'] {
  /**
   * Create a LinkResourceFormat.
   * @member {string} [tenantId] The hub name.
   * @member {string} [linkName] The link name.
   * @member {string} sourceEntityType Type of source entity. Possible values
   * include: 'None', 'Profile', 'Interaction', 'Relationship'
   * @member {string} targetEntityType Type of target entity. Possible values
   * include: 'None', 'Profile', 'Interaction', 'Relationship'
   * @member {string} sourceEntityTypeName Name of the source Entity Type.
   * @member {string} targetEntityTypeName Name of the target Entity Type.
   * @member {object} [displayName] Localized display name for the Link.
   * @member {object} [description] Localized descriptions for the Link.
   * @member {array} [mappings] The set of properties mappings between the
   * source and target Types.
   * @member {array} participantPropertyReferences The properties that
   * represent the participating profile.
   * @member {string} [provisioningState] Provisioning state. Possible values
   * include: 'Provisioning', 'Succeeded', 'Expiring', 'Deleting',
   * 'HumanIntervention', 'Failed'
   * @member {boolean} [referenceOnly] Indicating whether the link is reference
   * only link. This flag is ingored if the Mappings are defined. If the
   * mappings are not defined and it is set to true, links processing will not
   * create or update profiles.
   * @member {string} [operationType] Determines whether this link is supposed
   * to create or delete instances if Link is NOT Reference Only. Possible
   * values include: 'Upsert', 'Delete'
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of LinkResourceFormat
   *
   * @returns {object} metadata of LinkResourceFormat
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'LinkResourceFormat',
      type: {
        name: 'Composite',
        className: 'LinkResourceFormat',
        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'
            }
          },
          tenantId: {
            required: false,
            readOnly: true,
            serializedName: 'properties.tenantId',
            type: {
              name: 'String'
            }
          },
          linkName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.linkName',
            type: {
              name: 'String'
            }
          },
          sourceEntityType: {
            required: true,
            serializedName: 'properties.sourceEntityType',
            type: {
              name: 'Enum',
              allowedValues: [ 'None', 'Profile', 'Interaction', 'Relationship' ]
            }
          },
          targetEntityType: {
            required: true,
            serializedName: 'properties.targetEntityType',
            type: {
              name: 'Enum',
              allowedValues: [ 'None', 'Profile', 'Interaction', 'Relationship' ]
            }
          },
          sourceEntityTypeName: {
            required: true,
            serializedName: 'properties.sourceEntityTypeName',
            type: {
              name: 'String'
            }
          },
          targetEntityTypeName: {
            required: true,
            serializedName: 'properties.targetEntityTypeName',
            type: {
              name: 'String'
            }
          },
          displayName: {
            required: false,
            serializedName: 'properties.displayName',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          description: {
            required: false,
            serializedName: 'properties.description',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          mappings: {
            required: false,
            serializedName: 'properties.mappings',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'TypePropertiesMappingElementType',
                  type: {
                    name: 'Composite',
                    className: 'TypePropertiesMapping'
                  }
              }
            }
          },
          participantPropertyReferences: {
            required: true,
            serializedName: 'properties.participantPropertyReferences',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ParticipantPropertyReferenceElementType',
                  type: {
                    name: 'Composite',
                    className: 'ParticipantPropertyReference'
                  }
              }
            }
          },
          provisioningState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          referenceOnly: {
            required: false,
            serializedName: 'properties.referenceOnly',
            type: {
              name: 'Boolean'
            }
          },
          operationType: {
            required: false,
            serializedName: 'properties.operationType',
            type: {
              name: 'Enum',
              allowedValues: [ 'Upsert', 'Delete' ]
            }
          }
        }
      }
    };
  }
}

module.exports = LinkResourceFormat;
