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

/**
 * Append value for a Variable of type Array.
 *
 * @extends models['ControlActivity']
 */
class AppendVariableActivity extends models['ControlActivity'] {
  /**
   * Create a AppendVariableActivity.
   * @member {string} [variableName] Name of the variable whose value needs to
   * be appended to.
   * @member {object} [value] Value to be appended. Could be a static value or
   * Expression
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of AppendVariableActivity
   *
   * @returns {object} metadata of AppendVariableActivity
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'AppendVariable',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'type',
          clientName: 'type'
        },
        uberParent: 'Activity',
        className: 'AppendVariableActivity',
        modelProperties: {
          name: {
            required: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          description: {
            required: false,
            serializedName: 'description',
            type: {
              name: 'String'
            }
          },
          dependsOn: {
            required: false,
            serializedName: 'dependsOn',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ActivityDependencyElementType',
                  type: {
                    name: 'Composite',
                    additionalProperties: {
                      type: {
                        name: 'Dictionary',
                        value: {
                            required: false,
                            serializedName: 'ObjectElementType',
                            type: {
                              name: 'Object'
                            }
                        }
                      }
                    },
                    className: 'ActivityDependency'
                  }
              }
            }
          },
          userProperties: {
            required: false,
            serializedName: 'userProperties',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'UserPropertyElementType',
                  type: {
                    name: 'Composite',
                    className: 'UserProperty'
                  }
              }
            }
          },
          type: {
            required: true,
            serializedName: 'type',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          variableName: {
            required: false,
            serializedName: 'typeProperties.variableName',
            type: {
              name: 'String'
            }
          },
          value: {
            required: false,
            serializedName: 'typeProperties.value',
            type: {
              name: 'Object'
            }
          }
        }
      }
    };
  }
}

module.exports = AppendVariableActivity;
