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

/**
 * Operations discovery class.
 *
 */
class OperationsDiscovery {
  /**
   * Create a OperationsDiscovery.
   * @member {string} [name] Name of the API. The name of the operation being
   * performed on this particular object. It should match the action name that
   * appears in RBAC / the event service. Examples of operations include: *
   * Microsoft.Compute/virtualMachine/capture/action *
   * Microsoft.Compute/virtualMachine/restart/action *
   * Microsoft.Compute/virtualMachine/write *
   * Microsoft.Compute/virtualMachine/read *
   * Microsoft.Compute/virtualMachine/delete Each action should include, in
   * order: (1) Resource Provider Namespace (2) Type hierarchy for which the
   * action applies (e.g. server/databases for a SQL Azure database) (3) Read,
   * Write, Action or Delete indicating which type applies. If it is a
   * PUT/PATCH on a collection or named value, Write should be used. If it is a
   * GET, Read should be used. If it is a DELETE, Delete should be used. If it
   * is a POST, Action should be used. As a note: all resource providers would
   * need to include the "{Resource Provider Namespace}/register/action"
   * operation in their response. This API is used to register for their
   * service, and should include details about the operation (e.g. a localized
   * name for the resource provider + any special considerations like PII
   * release)
   * @member {object} [display] Object type
   * @member {string} [display.provider] The provider. The localized friendly
   * form of the resource provider name – it is expected to also include the
   * publisher/company responsible. It should use Title Casing and begin with
   * "Microsoft" for 1st party services. e.g. "Microsoft Monitoring Insights"
   * or "Microsoft Compute."
   * @member {string} [display.resource] The resource. The localized friendly
   * form of the resource related to this action/operation – it should match
   * the public documentation for the resource provider. It should use Title
   * Casing. This value should be unique for a particular URL type (e.g. nested
   * types should *not* reuse their parent’s display.resource field). e.g.
   * "Virtual Machines" or "Scheduler Job Collections", or "Virtual Machine VM
   * Sizes" or "Scheduler Jobs"
   * @member {string} [display.operation] The operation. The localized friendly
   * name for the operation, as it should be shown to the user. It should be
   * concise (to fit in drop downs) but clear (i.e. self-documenting). It
   * should use Title Casing. Prescriptive guidance: Read Create or Update
   * Delete 'ActionName'
   * @member {string} [display.description] The description. The localized
   * friendly description for the operation, as it should be shown to the user.
   * It should be thorough, yet concise – it will be used in tool tips and
   * detailed views. Prescriptive guidance for namespaces: Read any
   * 'display.provider' resource Create or Update any 'display.provider'
   * resource Delete any 'display.provider' resource Perform any other action
   * on any 'display.provider' resource Prescriptive guidance for namespaces:
   * Read any 'display.resource' Create or Update any 'display.resource' Delete
   * any 'display.resource' 'ActionName' any 'display.resources'
   * @member {string} [origin] Origin. The intended executor of the operation;
   * governs the display of the operation in the RBAC UX and the audit logs UX.
   * Default value is "user,system"
   * @member {object} [properties] Properties. Reserved for future use.
   */
  constructor() {
  }

  /**
   * Defines the metadata of OperationsDiscovery
   *
   * @returns {object} metadata of OperationsDiscovery
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'OperationsDiscovery',
      type: {
        name: 'Composite',
        className: 'OperationsDiscovery',
        modelProperties: {
          name: {
            required: false,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          display: {
            required: false,
            serializedName: 'display',
            type: {
              name: 'Composite',
              className: 'Display'
            }
          },
          origin: {
            required: false,
            serializedName: 'origin',
            type: {
              name: 'String'
            }
          },
          properties: {
            required: false,
            serializedName: 'properties',
            type: {
              name: 'Object'
            }
          }
        }
      }
    };
  }
}

module.exports = OperationsDiscovery;
