// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.azurestack.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.resourcemanager.azurestack.models.Compatibility;
import com.azure.resourcemanager.azurestack.models.IconUris;
import com.azure.resourcemanager.azurestack.models.ProductLink;
import com.azure.resourcemanager.azurestack.models.ProductProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Product information. */
@Fluent
public final class ProductInner extends ProxyResource {
    /*
     * Properties of the product resource.
     */
    @JsonProperty(value = "properties")
    private ProductNestedProperties innerProperties;

    /*
     * The entity tag used for optimistic concurrency when modifying the resource.
     */
    @JsonProperty(value = "etag")
    private String etag;

    /** Creates an instance of ProductInner class. */
    public ProductInner() {
    }

    /**
     * Get the innerProperties property: Properties of the product resource.
     *
     * @return the innerProperties value.
     */
    private ProductNestedProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the etag property: The entity tag used for optimistic concurrency when modifying the resource.
     *
     * @return the etag value.
     */
    public String etag() {
        return this.etag;
    }

    /**
     * Set the etag property: The entity tag used for optimistic concurrency when modifying the resource.
     *
     * @param etag the etag value to set.
     * @return the ProductInner object itself.
     */
    public ProductInner withEtag(String etag) {
        this.etag = etag;
        return this;
    }

    /**
     * Get the displayName property: The display name of the product.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.innerProperties() == null ? null : this.innerProperties().displayName();
    }

    /**
     * Set the displayName property: The display name of the product.
     *
     * @param displayName the displayName value to set.
     * @return the ProductInner object itself.
     */
    public ProductInner withDisplayName(String displayName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProductNestedProperties();
        }
        this.innerProperties().withDisplayName(displayName);
        return this;
    }

    /**
     * Get the description property: The description of the product.
     *
     * @return the description value.
     */
    public String description() {
        return this.innerProperties() == null ? null : this.innerProperties().description();
    }

    /**
     * Set the description property: The description of the product.
     *
     * @param description the description value to set.
     * @return the ProductInner object itself.
     */
    public ProductInner withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProductNestedProperties();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

    /**
     * Get the publisherDisplayName property: The user-friendly name of the product publisher.
     *
     * @return the publisherDisplayName value.
     */
    public String publisherDisplayName() {
        return this.innerProperties() == null ? null : this.innerProperties().publisherDisplayName();
    }

    /**
     * Set the publisherDisplayName property: The user-friendly name of the product publisher.
     *
     * @param publisherDisplayName the publisherDisplayName value to set.
     * @return the ProductInner object itself.
     */
    public ProductInner withPublisherDisplayName(String publisherDisplayName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProductNestedProperties();
        }
        this.innerProperties().withPublisherDisplayName(publisherDisplayName);
        return this;
    }

    /**
     * Get the publisherIdentifier property: Publisher identifier.
     *
     * @return the publisherIdentifier value.
     */
    public String publisherIdentifier() {
        return this.innerProperties() == null ? null : this.innerProperties().publisherIdentifier();
    }

    /**
     * Set the publisherIdentifier property: Publisher identifier.
     *
     * @param publisherIdentifier the publisherIdentifier value to set.
     * @return the ProductInner object itself.
     */
    public ProductInner withPublisherIdentifier(String publisherIdentifier) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProductNestedProperties();
        }
        this.innerProperties().withPublisherIdentifier(publisherIdentifier);
        return this;
    }

    /**
     * Get the offer property: The offer representing the product.
     *
     * @return the offer value.
     */
    public String offer() {
        return this.innerProperties() == null ? null : this.innerProperties().offer();
    }

    /**
     * Set the offer property: The offer representing the product.
     *
     * @param offer the offer value to set.
     * @return the ProductInner object itself.
     */
    public ProductInner withOffer(String offer) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProductNestedProperties();
        }
        this.innerProperties().withOffer(offer);
        return this;
    }

    /**
     * Get the offerVersion property: The version of the product offer.
     *
     * @return the offerVersion value.
     */
    public String offerVersion() {
        return this.innerProperties() == null ? null : this.innerProperties().offerVersion();
    }

    /**
     * Set the offerVersion property: The version of the product offer.
     *
     * @param offerVersion the offerVersion value to set.
     * @return the ProductInner object itself.
     */
    public ProductInner withOfferVersion(String offerVersion) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProductNestedProperties();
        }
        this.innerProperties().withOfferVersion(offerVersion);
        return this;
    }

    /**
     * Get the sku property: The product SKU.
     *
     * @return the sku value.
     */
    public String sku() {
        return this.innerProperties() == null ? null : this.innerProperties().sku();
    }

    /**
     * Set the sku property: The product SKU.
     *
     * @param sku the sku value to set.
     * @return the ProductInner object itself.
     */
    public ProductInner withSku(String sku) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProductNestedProperties();
        }
        this.innerProperties().withSku(sku);
        return this;
    }

    /**
     * Get the billingPartNumber property: The part number used for billing purposes.
     *
     * @return the billingPartNumber value.
     */
    public String billingPartNumber() {
        return this.innerProperties() == null ? null : this.innerProperties().billingPartNumber();
    }

    /**
     * Set the billingPartNumber property: The part number used for billing purposes.
     *
     * @param billingPartNumber the billingPartNumber value to set.
     * @return the ProductInner object itself.
     */
    public ProductInner withBillingPartNumber(String billingPartNumber) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProductNestedProperties();
        }
        this.innerProperties().withBillingPartNumber(billingPartNumber);
        return this;
    }

    /**
     * Get the vmExtensionType property: The type of the Virtual Machine Extension.
     *
     * @return the vmExtensionType value.
     */
    public String vmExtensionType() {
        return this.innerProperties() == null ? null : this.innerProperties().vmExtensionType();
    }

    /**
     * Set the vmExtensionType property: The type of the Virtual Machine Extension.
     *
     * @param vmExtensionType the vmExtensionType value to set.
     * @return the ProductInner object itself.
     */
    public ProductInner withVmExtensionType(String vmExtensionType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProductNestedProperties();
        }
        this.innerProperties().withVmExtensionType(vmExtensionType);
        return this;
    }

    /**
     * Get the galleryItemIdentity property: The identifier of the gallery item corresponding to the product.
     *
     * @return the galleryItemIdentity value.
     */
    public String galleryItemIdentity() {
        return this.innerProperties() == null ? null : this.innerProperties().galleryItemIdentity();
    }

    /**
     * Set the galleryItemIdentity property: The identifier of the gallery item corresponding to the product.
     *
     * @param galleryItemIdentity the galleryItemIdentity value to set.
     * @return the ProductInner object itself.
     */
    public ProductInner withGalleryItemIdentity(String galleryItemIdentity) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProductNestedProperties();
        }
        this.innerProperties().withGalleryItemIdentity(galleryItemIdentity);
        return this;
    }

    /**
     * Get the iconUris property: Additional links available for this product.
     *
     * @return the iconUris value.
     */
    public IconUris iconUris() {
        return this.innerProperties() == null ? null : this.innerProperties().iconUris();
    }

    /**
     * Set the iconUris property: Additional links available for this product.
     *
     * @param iconUris the iconUris value to set.
     * @return the ProductInner object itself.
     */
    public ProductInner withIconUris(IconUris iconUris) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProductNestedProperties();
        }
        this.innerProperties().withIconUris(iconUris);
        return this;
    }

    /**
     * Get the links property: Additional links available for this product.
     *
     * @return the links value.
     */
    public List<ProductLink> links() {
        return this.innerProperties() == null ? null : this.innerProperties().links();
    }

    /**
     * Set the links property: Additional links available for this product.
     *
     * @param links the links value to set.
     * @return the ProductInner object itself.
     */
    public ProductInner withLinks(List<ProductLink> links) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProductNestedProperties();
        }
        this.innerProperties().withLinks(links);
        return this;
    }

    /**
     * Get the legalTerms property: The legal terms.
     *
     * @return the legalTerms value.
     */
    public String legalTerms() {
        return this.innerProperties() == null ? null : this.innerProperties().legalTerms();
    }

    /**
     * Set the legalTerms property: The legal terms.
     *
     * @param legalTerms the legalTerms value to set.
     * @return the ProductInner object itself.
     */
    public ProductInner withLegalTerms(String legalTerms) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProductNestedProperties();
        }
        this.innerProperties().withLegalTerms(legalTerms);
        return this;
    }

    /**
     * Get the privacyPolicy property: The privacy policy.
     *
     * @return the privacyPolicy value.
     */
    public String privacyPolicy() {
        return this.innerProperties() == null ? null : this.innerProperties().privacyPolicy();
    }

    /**
     * Set the privacyPolicy property: The privacy policy.
     *
     * @param privacyPolicy the privacyPolicy value to set.
     * @return the ProductInner object itself.
     */
    public ProductInner withPrivacyPolicy(String privacyPolicy) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProductNestedProperties();
        }
        this.innerProperties().withPrivacyPolicy(privacyPolicy);
        return this;
    }

    /**
     * Get the payloadLength property: The length of product content.
     *
     * @return the payloadLength value.
     */
    public Long payloadLength() {
        return this.innerProperties() == null ? null : this.innerProperties().payloadLength();
    }

    /**
     * Set the payloadLength property: The length of product content.
     *
     * @param payloadLength the payloadLength value to set.
     * @return the ProductInner object itself.
     */
    public ProductInner withPayloadLength(Long payloadLength) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProductNestedProperties();
        }
        this.innerProperties().withPayloadLength(payloadLength);
        return this;
    }

    /**
     * Get the productKind property: The kind of the product (virtualMachine or virtualMachineExtension).
     *
     * @return the productKind value.
     */
    public String productKind() {
        return this.innerProperties() == null ? null : this.innerProperties().productKind();
    }

    /**
     * Set the productKind property: The kind of the product (virtualMachine or virtualMachineExtension).
     *
     * @param productKind the productKind value to set.
     * @return the ProductInner object itself.
     */
    public ProductInner withProductKind(String productKind) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProductNestedProperties();
        }
        this.innerProperties().withProductKind(productKind);
        return this;
    }

    /**
     * Get the productProperties property: Additional properties for the product.
     *
     * @return the productProperties value.
     */
    public ProductProperties productProperties() {
        return this.innerProperties() == null ? null : this.innerProperties().productProperties();
    }

    /**
     * Set the productProperties property: Additional properties for the product.
     *
     * @param productProperties the productProperties value to set.
     * @return the ProductInner object itself.
     */
    public ProductInner withProductProperties(ProductProperties productProperties) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProductNestedProperties();
        }
        this.innerProperties().withProductProperties(productProperties);
        return this;
    }

    /**
     * Get the compatibility property: Product compatibility with current device.
     *
     * @return the compatibility value.
     */
    public Compatibility compatibility() {
        return this.innerProperties() == null ? null : this.innerProperties().compatibility();
    }

    /**
     * Set the compatibility property: Product compatibility with current device.
     *
     * @param compatibility the compatibility value to set.
     * @return the ProductInner object itself.
     */
    public ProductInner withCompatibility(Compatibility compatibility) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ProductNestedProperties();
        }
        this.innerProperties().withCompatibility(compatibility);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }
}
