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

/**
 * Product information.
 *
 * @extends models['Resource']
 */
class Product extends models['Resource'] {
  /**
   * Create a Product.
   * @member {string} [displayName] The display name of the product.
   * @member {string} [description] The description of the product.
   * @member {string} [publisherDisplayName] The user-friendly name of the
   * product publisher.
   * @member {string} [publisherIdentifier] Publisher identifier.
   * @member {string} [offer] The offer representing the product.
   * @member {string} [offerVersion] The version of the product offer.
   * @member {string} [sku] The product SKU.
   * @member {string} [billingPartNumber] The part number used for billing
   * purposes.
   * @member {string} [vmExtensionType] The type of the Virtual Machine
   * Extension.
   * @member {string} [galleryItemIdentity] The identifier of the gallery item
   * corresponding to the product.
   * @member {object} [iconUris] Additional links available for this product.
   * @member {string} [iconUris.large] URI to large icon.
   * @member {string} [iconUris.wide] URI to wide icon.
   * @member {string} [iconUris.medium] URI to medium icon.
   * @member {string} [iconUris.small] URI to small icon.
   * @member {string} [iconUris.hero] URI to hero icon.
   * @member {array} [links] Additional links available for this product.
   * @member {string} [legalTerms] The legal terms.
   * @member {string} [privacyPolicy] The privacy policy.
   * @member {number} [payloadLength] The length of product content.
   * @member {string} [productKind] The kind of the product (virtualMachine or
   * virtualMachineExtension)
   * @member {object} [productProperties] Additional properties for the
   * product.
   * @member {string} [productProperties.version] The version.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of Product
   *
   * @returns {object} metadata of Product
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Product',
      type: {
        name: 'Composite',
        className: 'Product',
        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: true,
            isConstant: true,
            serializedName: 'location',
            defaultValue: 'global',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          etag: {
            required: false,
            serializedName: 'etag',
            type: {
              name: 'String'
            }
          },
          displayName: {
            required: false,
            serializedName: 'properties.displayName',
            type: {
              name: 'String'
            }
          },
          description: {
            required: false,
            serializedName: 'properties.description',
            type: {
              name: 'String'
            }
          },
          publisherDisplayName: {
            required: false,
            serializedName: 'properties.publisherDisplayName',
            type: {
              name: 'String'
            }
          },
          publisherIdentifier: {
            required: false,
            serializedName: 'properties.publisherIdentifier',
            type: {
              name: 'String'
            }
          },
          offer: {
            required: false,
            serializedName: 'properties.offer',
            type: {
              name: 'String'
            }
          },
          offerVersion: {
            required: false,
            serializedName: 'properties.offerVersion',
            type: {
              name: 'String'
            }
          },
          sku: {
            required: false,
            serializedName: 'properties.sku',
            type: {
              name: 'String'
            }
          },
          billingPartNumber: {
            required: false,
            serializedName: 'properties.billingPartNumber',
            type: {
              name: 'String'
            }
          },
          vmExtensionType: {
            required: false,
            serializedName: 'properties.vmExtensionType',
            type: {
              name: 'String'
            }
          },
          galleryItemIdentity: {
            required: false,
            serializedName: 'properties.galleryItemIdentity',
            type: {
              name: 'String'
            }
          },
          iconUris: {
            required: false,
            serializedName: 'properties.iconUris',
            type: {
              name: 'Composite',
              className: 'IconUris'
            }
          },
          links: {
            required: false,
            serializedName: 'properties.links',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ProductLinkElementType',
                  type: {
                    name: 'Composite',
                    className: 'ProductLink'
                  }
              }
            }
          },
          legalTerms: {
            required: false,
            serializedName: 'properties.legalTerms',
            type: {
              name: 'String'
            }
          },
          privacyPolicy: {
            required: false,
            serializedName: 'properties.privacyPolicy',
            type: {
              name: 'String'
            }
          },
          payloadLength: {
            required: false,
            serializedName: 'properties.payloadLength',
            type: {
              name: 'Number'
            }
          },
          productKind: {
            required: false,
            serializedName: 'properties.productKind',
            type: {
              name: 'String'
            }
          },
          productProperties: {
            required: false,
            serializedName: 'properties.productProperties',
            type: {
              name: 'Composite',
              className: 'ProductProperties'
            }
          }
        }
      }
    };
  }
}

module.exports = Product;
