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

/**
 * Resource information.
 *
 * @extends models['Resource']
 */
class GenericResource extends models['Resource'] {
  /**
   * Create a GenericResource.
   * @property {object} [plan] The plan of the resource.
   * @property {string} [plan.name] The plan ID.
   * @property {string} [plan.publisher] The publisher ID.
   * @property {string} [plan.product] The offer ID.
   * @property {string} [plan.promotionCode] The promotion code.
   * @property {string} [plan.version] The plan's version.
   * @property {object} [properties] The resource properties.
   * @property {string} [kind] The kind of the resource.
   * @property {string} [managedBy] ID of the resource that manages this
   * resource.
   * @property {object} [sku] The SKU of the resource.
   * @property {string} [sku.name] The SKU name.
   * @property {string} [sku.tier] The SKU tier.
   * @property {string} [sku.size] The SKU size.
   * @property {string} [sku.family] The SKU family.
   * @property {string} [sku.model] The SKU model.
   * @property {number} [sku.capacity] The SKU capacity.
   * @property {object} [identity] The identity of the resource.
   * @property {string} [identity.principalId] The principal ID of resource
   * identity.
   * @property {string} [identity.tenantId] The tenant ID of resource.
   * @property {string} [identity.type] The identity type. Possible values
   * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned',
   * 'None'
   * @property {object} [identity.userAssignedIdentities] The list of user
   * identities associated with the resource. The user identity dictionary key
   * references will be ARM resource ids in the form:
   * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of GenericResource
   *
   * @returns {object} metadata of GenericResource
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'GenericResource',
      type: {
        name: 'Composite',
        className: 'GenericResource',
        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'
            }
          },
          location: {
            required: false,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          plan: {
            required: false,
            serializedName: 'plan',
            type: {
              name: 'Composite',
              className: 'Plan'
            }
          },
          properties: {
            required: false,
            serializedName: 'properties',
            type: {
              name: 'Object'
            }
          },
          kind: {
            required: false,
            serializedName: 'kind',
            constraints: {
              Pattern: /^[-\w\._,\(\)]+$/
            },
            type: {
              name: 'String'
            }
          },
          managedBy: {
            required: false,
            serializedName: 'managedBy',
            type: {
              name: 'String'
            }
          },
          sku: {
            required: false,
            serializedName: 'sku',
            type: {
              name: 'Composite',
              className: 'Sku'
            }
          },
          identity: {
            required: false,
            serializedName: 'identity',
            type: {
              name: 'Composite',
              className: 'Identity'
            }
          }
        }
      }
    };
  }
}

module.exports = GenericResource;
