All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.security.fluent.models.PricingInner Maven / Gradle / Ivy

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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.security.models.Enforce;
import com.azure.resourcemanager.security.models.Extension;
import com.azure.resourcemanager.security.models.Inherited;
import com.azure.resourcemanager.security.models.PricingTier;
import com.azure.resourcemanager.security.models.ResourcesCoverageStatus;
import java.io.IOException;
import java.time.Duration;
import java.time.OffsetDateTime;
import java.util.List;

/**
 * Microsoft Defender for Cloud is provided in two pricing tiers: free and standard. The standard tier offers advanced
 * security capabilities, while the free tier offers basic security features.
 */
@Fluent
public final class PricingInner extends ProxyResource {
    /*
     * Pricing data
     */
    private PricingProperties innerProperties;

    /*
     * The type of the resource.
     */
    private String type;

    /*
     * The name of the resource.
     */
    private String name;

    /*
     * Fully qualified resource Id for the resource.
     */
    private String id;

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

    /**
     * Get the innerProperties property: Pricing data.
     * 
     * @return the innerProperties value.
     */
    private PricingProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the type property: The type of the resource.
     * 
     * @return the type value.
     */
    @Override
    public String type() {
        return this.type;
    }

    /**
     * Get the name property: The name of the resource.
     * 
     * @return the name value.
     */
    @Override
    public String name() {
        return this.name;
    }

    /**
     * Get the id property: Fully qualified resource Id for the resource.
     * 
     * @return the id value.
     */
    @Override
    public String id() {
        return this.id;
    }

    /**
     * Get the pricingTier property: Indicates whether the Defender plan is enabled on the selected scope. Microsoft
     * Defender for Cloud is provided in two pricing tiers: free and standard. The standard tier offers advanced
     * security capabilities, while the free tier offers basic security features.
     * 
     * @return the pricingTier value.
     */
    public PricingTier pricingTier() {
        return this.innerProperties() == null ? null : this.innerProperties().pricingTier();
    }

    /**
     * Set the pricingTier property: Indicates whether the Defender plan is enabled on the selected scope. Microsoft
     * Defender for Cloud is provided in two pricing tiers: free and standard. The standard tier offers advanced
     * security capabilities, while the free tier offers basic security features.
     * 
     * @param pricingTier the pricingTier value to set.
     * @return the PricingInner object itself.
     */
    public PricingInner withPricingTier(PricingTier pricingTier) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PricingProperties();
        }
        this.innerProperties().withPricingTier(pricingTier);
        return this;
    }

    /**
     * Get the subPlan property: The sub-plan selected for a Standard pricing configuration, when more than one sub-plan
     * is available. Each sub-plan enables a set of security features. When not specified, full plan is applied. For
     * VirtualMachines plan, available sub plans are 'P1' & 'P2', where for resource level only 'P1' sub plan is
     * supported.
     * 
     * @return the subPlan value.
     */
    public String subPlan() {
        return this.innerProperties() == null ? null : this.innerProperties().subPlan();
    }

    /**
     * Set the subPlan property: The sub-plan selected for a Standard pricing configuration, when more than one sub-plan
     * is available. Each sub-plan enables a set of security features. When not specified, full plan is applied. For
     * VirtualMachines plan, available sub plans are 'P1' & 'P2', where for resource level only 'P1' sub plan is
     * supported.
     * 
     * @param subPlan the subPlan value to set.
     * @return the PricingInner object itself.
     */
    public PricingInner withSubPlan(String subPlan) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PricingProperties();
        }
        this.innerProperties().withSubPlan(subPlan);
        return this;
    }

    /**
     * Get the freeTrialRemainingTime property: The duration left for the subscriptions free trial period - in ISO 8601
     * format (e.g. P3Y6M4DT12H30M5S).
     * 
     * @return the freeTrialRemainingTime value.
     */
    public Duration freeTrialRemainingTime() {
        return this.innerProperties() == null ? null : this.innerProperties().freeTrialRemainingTime();
    }

    /**
     * Get the enablementTime property: Optional. If `pricingTier` is `Standard` then this property holds the date of
     * the last time the `pricingTier` was set to `Standard`, when available (e.g 2023-03-01T12:42:42.1921106Z).
     * 
     * @return the enablementTime value.
     */
    public OffsetDateTime enablementTime() {
        return this.innerProperties() == null ? null : this.innerProperties().enablementTime();
    }

    /**
     * Get the enforce property: If set to "False", it allows the descendants of this scope to override the pricing
     * configuration set on this scope (allows setting inherited="False"). If set to "True", it prevents overrides and
     * forces this pricing configuration on all the descendants of this scope. This field is only available for
     * subscription-level pricing.
     * 
     * @return the enforce value.
     */
    public Enforce enforce() {
        return this.innerProperties() == null ? null : this.innerProperties().enforce();
    }

    /**
     * Set the enforce property: If set to "False", it allows the descendants of this scope to override the pricing
     * configuration set on this scope (allows setting inherited="False"). If set to "True", it prevents overrides and
     * forces this pricing configuration on all the descendants of this scope. This field is only available for
     * subscription-level pricing.
     * 
     * @param enforce the enforce value to set.
     * @return the PricingInner object itself.
     */
    public PricingInner withEnforce(Enforce enforce) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PricingProperties();
        }
        this.innerProperties().withEnforce(enforce);
        return this;
    }

    /**
     * Get the inherited property: "inherited" = "True" indicates that the current scope inherits its pricing
     * configuration from its parent. The ID of the parent scope that provides the inherited configuration is displayed
     * in the "inheritedFrom" field. On the other hand, "inherited" = "False" indicates that the current scope has its
     * own pricing configuration explicitly set, and does not inherit from its parent. This field is read only and
     * available only for resource-level pricing.
     * 
     * @return the inherited value.
     */
    public Inherited inherited() {
        return this.innerProperties() == null ? null : this.innerProperties().inherited();
    }

    /**
     * Get the inheritedFrom property: The id of the scope inherited from. "Null" if not inherited. This field is only
     * available for resource-level pricing.
     * 
     * @return the inheritedFrom value.
     */
    public String inheritedFrom() {
        return this.innerProperties() == null ? null : this.innerProperties().inheritedFrom();
    }

    /**
     * Get the resourcesCoverageStatus property: This field is available for subscription-level only, and reflects the
     * coverage status of the resources under the subscription. Please note: The "pricingTier" field reflects the plan
     * status of the subscription. However, since the plan status can also be defined at the resource level, there might
     * be misalignment between the subscription's plan status and the resource status. This field helps indicate the
     * coverage status of the resources.
     * 
     * @return the resourcesCoverageStatus value.
     */
    public ResourcesCoverageStatus resourcesCoverageStatus() {
        return this.innerProperties() == null ? null : this.innerProperties().resourcesCoverageStatus();
    }

    /**
     * Get the extensions property: Optional. List of extensions offered under a plan.
     * 
     * @return the extensions value.
     */
    public List extensions() {
        return this.innerProperties() == null ? null : this.innerProperties().extensions();
    }

    /**
     * Set the extensions property: Optional. List of extensions offered under a plan.
     * 
     * @param extensions the extensions value to set.
     * @return the PricingInner object itself.
     */
    public PricingInner withExtensions(List extensions) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PricingProperties();
        }
        this.innerProperties().withExtensions(extensions);
        return this;
    }

    /**
     * Get the deprecated property: Optional. True if the plan is deprecated. If there are replacing plans they will
     * appear in `replacedBy` property.
     * 
     * @return the deprecated value.
     */
    public Boolean deprecated() {
        return this.innerProperties() == null ? null : this.innerProperties().deprecated();
    }

    /**
     * Get the replacedBy property: Optional. List of plans that replace this plan. This property exists only if this
     * plan is deprecated.
     * 
     * @return the replacedBy value.
     */
    public List replacedBy() {
        return this.innerProperties() == null ? null : this.innerProperties().replacedBy();
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeJsonField("properties", this.innerProperties);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of PricingInner from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of PricingInner if the JsonReader was pointing to an instance of it, or null if it was
     * pointing to JSON null.
     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
     * @throws IOException If an error occurs while reading the PricingInner.
     */
    public static PricingInner fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            PricingInner deserializedPricingInner = new PricingInner();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("id".equals(fieldName)) {
                    deserializedPricingInner.id = reader.getString();
                } else if ("name".equals(fieldName)) {
                    deserializedPricingInner.name = reader.getString();
                } else if ("type".equals(fieldName)) {
                    deserializedPricingInner.type = reader.getString();
                } else if ("properties".equals(fieldName)) {
                    deserializedPricingInner.innerProperties = PricingProperties.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedPricingInner;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy