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

/**
 * Defines the PUT rollout request body.
 *
 * @extends models['TrackedResource']
 */
class RolloutRequest extends models['TrackedResource'] {
  /**
   * Create a RolloutRequest.
   * @member {object} identity Identity for the resource.
   * @member {string} [identity.type] The identity type.
   * @member {array} [identity.identityIds] The list of identities.
   * @member {string} buildVersion The version of the build being deployed.
   * @member {string} [artifactSourceId] The reference to the artifact source
   * resource Id where the payload is located.
   * @member {string} targetServiceTopologyId The resource Id of the service
   * topology from which service units are being referenced in step groups to
   * be deployed.
   * @member {array} stepGroups The list of step groups that define the
   * orchestration.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of RolloutRequest
   *
   * @returns {object} metadata of RolloutRequest
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'RolloutRequest',
      type: {
        name: 'Composite',
        className: 'RolloutRequest',
        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'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          location: {
            required: true,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          identity: {
            required: true,
            serializedName: 'identity',
            type: {
              name: 'Composite',
              className: 'Identity'
            }
          },
          buildVersion: {
            required: true,
            serializedName: 'properties.buildVersion',
            type: {
              name: 'String'
            }
          },
          artifactSourceId: {
            required: false,
            serializedName: 'properties.artifactSourceId',
            type: {
              name: 'String'
            }
          },
          targetServiceTopologyId: {
            required: true,
            serializedName: 'properties.targetServiceTopologyId',
            type: {
              name: 'String'
            }
          },
          stepGroups: {
            required: true,
            serializedName: 'properties.stepGroups',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StepElementType',
                  type: {
                    name: 'Composite',
                    className: 'Step'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = RolloutRequest;
