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

/**
 * A PowerShell session resource (practically equivalent to a runspace
 * instance).
 *
 * @extends models['Resource']
 */
class PowerShellSessionResource extends models['Resource'] {
  /**
   * Create a PowerShellSessionResource.
   * @member {string} [sessionId] The PowerShell Session ID.
   * @member {string} [state] The runspace state.
   * @member {string} [runspaceAvailability] The availability of the runspace.
   * @member {date} [disconnectedOn] Timestamp of last time the service
   * disconnected from the runspace.
   * @member {date} [expiresOn] Timestamp when the runspace expires.
   * @member {object} [version]
   * @member {number} [version.major] The leftmost number of the version.
   * @member {number} [version.minor] The second leftmost number of the
   * version.
   * @member {number} [version.build] The third number of the version.
   * @member {number} [version.revision] The fourth number of the version.
   * @member {number} [version.majorRevision] The MSW of the fourth part.
   * @member {number} [version.minorRevision] The LSW of the fourth part.
   * @member {string} [powerShellSessionResourceName] Name of the runspace.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of PowerShellSessionResource
   *
   * @returns {object} metadata of PowerShellSessionResource
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'PowerShellSessionResource',
      type: {
        name: 'Composite',
        className: 'PowerShellSessionResource',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          location: {
            required: false,
            readOnly: true,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          etag: {
            required: false,
            serializedName: 'etag',
            type: {
              name: 'String'
            }
          },
          sessionId: {
            required: false,
            serializedName: 'properties.sessionId',
            type: {
              name: 'String'
            }
          },
          state: {
            required: false,
            serializedName: 'properties.state',
            type: {
              name: 'String'
            }
          },
          runspaceAvailability: {
            required: false,
            serializedName: 'properties.runspaceAvailability',
            type: {
              name: 'String'
            }
          },
          disconnectedOn: {
            required: false,
            serializedName: 'properties.disconnectedOn',
            type: {
              name: 'DateTime'
            }
          },
          expiresOn: {
            required: false,
            serializedName: 'properties.expiresOn',
            type: {
              name: 'DateTime'
            }
          },
          version: {
            required: false,
            serializedName: 'properties.version',
            type: {
              name: 'Composite',
              className: 'Version'
            }
          },
          powerShellSessionResourceName: {
            required: false,
            serializedName: 'properties.name',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = PowerShellSessionResource;
