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

/**
 * Schema Contract details.
 *
 * @extends models['Resource']
 */
class SchemaCreateOrUpdateContract extends models['Resource'] {
  /**
   * Create a SchemaCreateOrUpdateContract.
   * @property {string} contentType Must be a valid a media type used in a
   * Content-Type header as defined in the RFC 2616. Media type of the schema
   * document (e.g. application/json, application/xml). </br> - `Swagger`
   * Schema use `application/vnd.ms-azure-apim.swagger.definitions+json` </br>
   * - `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml` </br> -
   * `OpenApi` Schema use `application/vnd.oai.openapi.components+json` </br> -
   * `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`.
   * @property {string} [value] Json escaped string defining the document
   * representing the Schema.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of SchemaCreateOrUpdateContract
   *
   * @returns {object} metadata of SchemaCreateOrUpdateContract
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'SchemaCreateOrUpdateContract',
      type: {
        name: 'Composite',
        className: 'SchemaCreateOrUpdateContract',
        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'
            }
          },
          contentType: {
            required: true,
            serializedName: 'properties.contentType',
            type: {
              name: 'String'
            }
          },
          value: {
            required: false,
            serializedName: 'properties.document.value',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = SchemaCreateOrUpdateContract;
