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

package com.azure.resourcemanager.qumulo.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/** MarketplaceDetails of Qumulo FileSystem resource. */
@Fluent
public final class MarketplaceDetails {
    /*
     * Marketplace Subscription Id
     */
    @JsonProperty(value = "marketplaceSubscriptionId")
    private String marketplaceSubscriptionId;

    /*
     * Plan Id
     */
    @JsonProperty(value = "planId", required = true)
    private String planId;

    /*
     * Offer Id
     */
    @JsonProperty(value = "offerId", required = true)
    private String offerId;

    /*
     * Publisher Id
     */
    @JsonProperty(value = "publisherId", required = true)
    private String publisherId;

    /*
     * Marketplace subscription status
     */
    @JsonProperty(value = "marketplaceSubscriptionStatus", access = JsonProperty.Access.WRITE_ONLY)
    private MarketplaceSubscriptionStatus marketplaceSubscriptionStatus;

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

    /**
     * Get the marketplaceSubscriptionId property: Marketplace Subscription Id.
     *
     * @return the marketplaceSubscriptionId value.
     */
    public String marketplaceSubscriptionId() {
        return this.marketplaceSubscriptionId;
    }

    /**
     * Set the marketplaceSubscriptionId property: Marketplace Subscription Id.
     *
     * @param marketplaceSubscriptionId the marketplaceSubscriptionId value to set.
     * @return the MarketplaceDetails object itself.
     */
    public MarketplaceDetails withMarketplaceSubscriptionId(String marketplaceSubscriptionId) {
        this.marketplaceSubscriptionId = marketplaceSubscriptionId;
        return this;
    }

    /**
     * Get the planId property: Plan Id.
     *
     * @return the planId value.
     */
    public String planId() {
        return this.planId;
    }

    /**
     * Set the planId property: Plan Id.
     *
     * @param planId the planId value to set.
     * @return the MarketplaceDetails object itself.
     */
    public MarketplaceDetails withPlanId(String planId) {
        this.planId = planId;
        return this;
    }

    /**
     * Get the offerId property: Offer Id.
     *
     * @return the offerId value.
     */
    public String offerId() {
        return this.offerId;
    }

    /**
     * Set the offerId property: Offer Id.
     *
     * @param offerId the offerId value to set.
     * @return the MarketplaceDetails object itself.
     */
    public MarketplaceDetails withOfferId(String offerId) {
        this.offerId = offerId;
        return this;
    }

    /**
     * Get the publisherId property: Publisher Id.
     *
     * @return the publisherId value.
     */
    public String publisherId() {
        return this.publisherId;
    }

    /**
     * Set the publisherId property: Publisher Id.
     *
     * @param publisherId the publisherId value to set.
     * @return the MarketplaceDetails object itself.
     */
    public MarketplaceDetails withPublisherId(String publisherId) {
        this.publisherId = publisherId;
        return this;
    }

    /**
     * Get the marketplaceSubscriptionStatus property: Marketplace subscription status.
     *
     * @return the marketplaceSubscriptionStatus value.
     */
    public MarketplaceSubscriptionStatus marketplaceSubscriptionStatus() {
        return this.marketplaceSubscriptionStatus;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (planId() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property planId in model MarketplaceDetails"));
        }
        if (offerId() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property offerId in model MarketplaceDetails"));
        }
        if (publisherId() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property publisherId in model MarketplaceDetails"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(MarketplaceDetails.class);
}
