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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.mobilenetwork.models.KeyVaultKey;
import com.azure.resourcemanager.mobilenetwork.models.MobileNetworkResourceId;
import com.azure.resourcemanager.mobilenetwork.models.ProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;

/** SIM group properties. */
@Fluent
public final class SimGroupPropertiesFormat {
    /*
     * The provisioning state of the SIM group resource.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

    /*
     * A key to encrypt the SIM data that belongs to this SIM group.
     */
    @JsonProperty(value = "encryptionKey")
    private KeyVaultKey encryptionKey;

    /*
     * Mobile network that this SIM group belongs to. The mobile network must be in the same location as the SIM group.
     */
    @JsonProperty(value = "mobileNetwork")
    private MobileNetworkResourceId mobileNetwork;

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

    /**
     * Get the provisioningState property: The provisioning state of the SIM group resource.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the encryptionKey property: A key to encrypt the SIM data that belongs to this SIM group.
     *
     * @return the encryptionKey value.
     */
    public KeyVaultKey encryptionKey() {
        return this.encryptionKey;
    }

    /**
     * Set the encryptionKey property: A key to encrypt the SIM data that belongs to this SIM group.
     *
     * @param encryptionKey the encryptionKey value to set.
     * @return the SimGroupPropertiesFormat object itself.
     */
    public SimGroupPropertiesFormat withEncryptionKey(KeyVaultKey encryptionKey) {
        this.encryptionKey = encryptionKey;
        return this;
    }

    /**
     * Get the mobileNetwork property: Mobile network that this SIM group belongs to. The mobile network must be in the
     * same location as the SIM group.
     *
     * @return the mobileNetwork value.
     */
    public MobileNetworkResourceId mobileNetwork() {
        return this.mobileNetwork;
    }

    /**
     * Set the mobileNetwork property: Mobile network that this SIM group belongs to. The mobile network must be in the
     * same location as the SIM group.
     *
     * @param mobileNetwork the mobileNetwork value to set.
     * @return the SimGroupPropertiesFormat object itself.
     */
    public SimGroupPropertiesFormat withMobileNetwork(MobileNetworkResourceId mobileNetwork) {
        this.mobileNetwork = mobileNetwork;
        return this;
    }

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