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

/**
 * TagResource contract properties.
 *
 */
class TagResourceContract {
  /**
   * Create a TagResourceContract.
   * @property {object} tag Tag associated with the resource.
   * @property {string} [tag.id] Tag identifier
   * @property {string} [tag.name] Tag Name
   * @property {object} [api] Api associated with the tag.
   * @property {string} [api.id] API identifier in the form /apis/{apiId}.
   * @property {string} [api.name] API name.
   * @property {string} [api.serviceUrl] Absolute URL of the backend service
   * implementing this API.
   * @property {string} [api.path] Relative URL uniquely identifying this API
   * and all of its resource paths within the API Management service instance.
   * It is appended to the API endpoint base URL specified during the service
   * instance creation to form a public URL for this API.
   * @property {array} [api.protocols] Describes on which protocols the
   * operations in this API can be invoked.
   * @property {object} [operation] Operation associated with the tag.
   * @property {string} [operation.id] Identifier of the operation in form
   * /operations/{operationId}.
   * @property {string} [operation.name] Operation name.
   * @property {string} [operation.apiName] Api Name.
   * @property {string} [operation.apiRevision] Api Revision.
   * @property {string} [operation.apiVersion] Api Version.
   * @property {string} [operation.description] Operation Description.
   * @property {string} [operation.method] A Valid HTTP Operation Method.
   * Typical Http Methods like GET, PUT, POST but not limited by only them.
   * @property {string} [operation.urlTemplate] Relative URL template
   * identifying the target resource for this operation. May include
   * parameters. Example: /customers/{cid}/orders/{oid}/?date={date}
   * @property {object} [product] Product associated with the tag.
   * @property {string} [product.id] Identifier of the product in the form of
   * /products/{productId}
   * @property {string} [product.name] Product name.
   */
  constructor() {
  }

  /**
   * Defines the metadata of TagResourceContract
   *
   * @returns {object} metadata of TagResourceContract
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'TagResourceContract',
      type: {
        name: 'Composite',
        className: 'TagResourceContract',
        modelProperties: {
          tag: {
            required: true,
            serializedName: 'tag',
            type: {
              name: 'Composite',
              className: 'TagTagResourceContractProperties'
            }
          },
          api: {
            required: false,
            serializedName: 'api',
            type: {
              name: 'Composite',
              className: 'ApiTagResourceContractProperties'
            }
          },
          operation: {
            required: false,
            serializedName: 'operation',
            type: {
              name: 'Composite',
              className: 'OperationTagResourceContractProperties'
            }
          },
          product: {
            required: false,
            serializedName: 'product',
            type: {
              name: 'Composite',
              className: 'ProductTagResourceContractProperties'
            }
          }
        }
      }
    };
  }
}

module.exports = TagResourceContract;
