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

/**
 * API contract properties for the Tag Resources.
 *
 * @extends models['ApiEntityBaseContract']
 */
class ApiTagResourceContractProperties extends models['ApiEntityBaseContract'] {
  /**
   * Create a ApiTagResourceContractProperties.
   * @property {string} [id] API identifier in the form /apis/{apiId}.
   * @property {string} [name] API name.
   * @property {string} [serviceUrl] Absolute URL of the backend service
   * implementing this API.
   * @property {string} [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} [protocols] Describes on which protocols the operations
   * in this API can be invoked.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ApiTagResourceContractProperties
   *
   * @returns {object} metadata of ApiTagResourceContractProperties
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ApiTagResourceContractProperties',
      type: {
        name: 'Composite',
        className: 'ApiTagResourceContractProperties',
        modelProperties: {
          description: {
            required: false,
            serializedName: 'description',
            type: {
              name: 'String'
            }
          },
          authenticationSettings: {
            required: false,
            serializedName: 'authenticationSettings',
            type: {
              name: 'Composite',
              className: 'AuthenticationSettingsContract'
            }
          },
          subscriptionKeyParameterNames: {
            required: false,
            serializedName: 'subscriptionKeyParameterNames',
            type: {
              name: 'Composite',
              className: 'SubscriptionKeyParameterNamesContract'
            }
          },
          apiType: {
            required: false,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          apiRevision: {
            required: false,
            serializedName: 'apiRevision',
            constraints: {
              MaxLength: 100,
              MinLength: 1
            },
            type: {
              name: 'String'
            }
          },
          apiVersion: {
            required: false,
            serializedName: 'apiVersion',
            constraints: {
              MaxLength: 100
            },
            type: {
              name: 'String'
            }
          },
          isCurrent: {
            required: false,
            serializedName: 'isCurrent',
            type: {
              name: 'Boolean'
            }
          },
          isOnline: {
            required: false,
            readOnly: true,
            serializedName: 'isOnline',
            type: {
              name: 'Boolean'
            }
          },
          apiRevisionDescription: {
            required: false,
            serializedName: 'apiRevisionDescription',
            constraints: {
              MaxLength: 256
            },
            type: {
              name: 'String'
            }
          },
          apiVersionDescription: {
            required: false,
            serializedName: 'apiVersionDescription',
            constraints: {
              MaxLength: 256
            },
            type: {
              name: 'String'
            }
          },
          apiVersionSetId: {
            required: false,
            serializedName: 'apiVersionSetId',
            type: {
              name: 'String'
            }
          },
          subscriptionRequired: {
            required: false,
            serializedName: 'subscriptionRequired',
            type: {
              name: 'Boolean'
            }
          },
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            serializedName: 'name',
            constraints: {
              MaxLength: 300,
              MinLength: 1
            },
            type: {
              name: 'String'
            }
          },
          serviceUrl: {
            required: false,
            serializedName: 'serviceUrl',
            constraints: {
              MaxLength: 2000,
              MinLength: 1
            },
            type: {
              name: 'String'
            }
          },
          path: {
            required: false,
            serializedName: 'path',
            constraints: {
              MaxLength: 400,
              MinLength: 0
            },
            type: {
              name: 'String'
            }
          },
          protocols: {
            required: false,
            serializedName: 'protocols',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ProtocolElementType',
                  type: {
                    name: 'Enum',
                    allowedValues: [ 'http', 'https' ]
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = ApiTagResourceContractProperties;
