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

/**
 * Defines a webpage that is relevant to the query.
 *
 * @extends models['CreativeWork']
 */
class WebPage extends models['CreativeWork'] {
  /**
   * Create a WebPage.
   * @property {string} [displayUrl] The display URL of the webpage. The URL is
   * meant for display purposes only and is not well formed.
   * @property {string} [snippet] A snippet of text from the webpage that
   * describes its contents.
   * @property {array} [deepLinks] A list of links to related content that Bing
   * found in the website that contains this webpage. The Webpage object in
   * this context includes only the name, url, urlPingSuffix, and snippet
   * fields.
   * @property {string} [dateLastCrawled] The last time that Bing crawled the
   * webpage. The date is in the form, YYYY-MM-DDTHH:MM:SS. For example,
   * 2015-04-13T05:23:39.
   * @property {array} [searchTags] A list of search tags that the webpage
   * owner specified on the webpage. The API returns only indexed search tags.
   * The name field of the MetaTag object contains the indexed search tag.
   * Search tags begin with search.* (for example, search.assetId). The content
   * field contains the tag's value.
   * @property {object} [primaryImageOfPage]
   * @property {object} [primaryImageOfPage.thumbnail] The URL to a thumbnail
   * of the image
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of WebPage
   *
   * @returns {object} metadata of WebPage
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'WebPage',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: '_type',
          clientName: '_type'
        },
        uberParent: 'ResponseBase',
        className: 'WebPage',
        modelProperties: {
          _type: {
            required: true,
            serializedName: '_type',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          webSearchUrl: {
            required: false,
            readOnly: true,
            serializedName: 'webSearchUrl',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          url: {
            required: false,
            readOnly: true,
            serializedName: 'url',
            type: {
              name: 'String'
            }
          },
          image: {
            required: false,
            readOnly: true,
            serializedName: 'image',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: '_type',
                clientName: '_type'
              },
              uberParent: 'ResponseBase',
              className: 'ImageObject'
            }
          },
          description: {
            required: false,
            readOnly: true,
            serializedName: 'description',
            type: {
              name: 'String'
            }
          },
          bingId: {
            required: false,
            readOnly: true,
            serializedName: 'bingId',
            type: {
              name: 'String'
            }
          },
          thumbnailUrl: {
            required: false,
            readOnly: true,
            serializedName: 'thumbnailUrl',
            type: {
              name: 'String'
            }
          },
          provider: {
            required: false,
            readOnly: true,
            serializedName: 'provider',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ThingElementType',
                  type: {
                    name: 'Composite',
                    polymorphicDiscriminator: {
                      serializedName: '_type',
                      clientName: '_type'
                    },
                    uberParent: 'ResponseBase',
                    className: 'Thing'
                  }
              }
            }
          },
          text: {
            required: false,
            readOnly: true,
            serializedName: 'text',
            type: {
              name: 'String'
            }
          },
          displayUrl: {
            required: false,
            readOnly: true,
            serializedName: 'displayUrl',
            type: {
              name: 'String'
            }
          },
          snippet: {
            required: false,
            readOnly: true,
            serializedName: 'snippet',
            type: {
              name: 'String'
            }
          },
          deepLinks: {
            required: false,
            readOnly: true,
            serializedName: 'deepLinks',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'WebPageElementType',
                  type: {
                    name: 'Composite',
                    polymorphicDiscriminator: {
                      serializedName: '_type',
                      clientName: '_type'
                    },
                    uberParent: 'ResponseBase',
                    className: 'WebPage'
                  }
              }
            }
          },
          dateLastCrawled: {
            required: false,
            readOnly: true,
            serializedName: 'dateLastCrawled',
            type: {
              name: 'String'
            }
          },
          searchTags: {
            required: false,
            readOnly: true,
            serializedName: 'searchTags',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'WebMetaTagElementType',
                  type: {
                    name: 'Composite',
                    className: 'WebMetaTag'
                  }
              }
            }
          },
          primaryImageOfPage: {
            required: false,
            readOnly: true,
            serializedName: 'primaryImageOfPage',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: '_type',
                clientName: '_type'
              },
              uberParent: 'ResponseBase',
              className: 'ImageObject'
            }
          }
        }
      }
    };
  }
}

module.exports = WebPage;
