// 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.Resource;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** Registration information. */
@Fluent
public final class RegistrationInner extends Resource {
    /*
     * Registration resource.
     */
    @JsonProperty(value = "properties")
    private RegistrationProperties innerProperties;

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

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

    /**
     * Get the innerProperties property: Registration resource.
     *
     * @return the innerProperties value.
     */
    private RegistrationProperties 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 RegistrationInner object itself.
     */
    public RegistrationInner withEtag(String etag) {
        this.etag = etag;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public RegistrationInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public RegistrationInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * Get the objectId property: The object identifier associated with the Azure Stack connecting to Azure.
     *
     * @return the objectId value.
     */
    public String objectId() {
        return this.innerProperties() == null ? null : this.innerProperties().objectId();
    }

    /**
     * Set the objectId property: The object identifier associated with the Azure Stack connecting to Azure.
     *
     * @param objectId the objectId value to set.
     * @return the RegistrationInner object itself.
     */
    public RegistrationInner withObjectId(String objectId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RegistrationProperties();
        }
        this.innerProperties().withObjectId(objectId);
        return this;
    }

    /**
     * Get the cloudId property: The identifier of the registered Azure Stack.
     *
     * @return the cloudId value.
     */
    public String cloudId() {
        return this.innerProperties() == null ? null : this.innerProperties().cloudId();
    }

    /**
     * Set the cloudId property: The identifier of the registered Azure Stack.
     *
     * @param cloudId the cloudId value to set.
     * @return the RegistrationInner object itself.
     */
    public RegistrationInner withCloudId(String cloudId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RegistrationProperties();
        }
        this.innerProperties().withCloudId(cloudId);
        return this;
    }

    /**
     * Get the billingModel property: Specifies the billing mode for the Azure Stack registration.
     *
     * @return the billingModel value.
     */
    public String billingModel() {
        return this.innerProperties() == null ? null : this.innerProperties().billingModel();
    }

    /**
     * Set the billingModel property: Specifies the billing mode for the Azure Stack registration.
     *
     * @param billingModel the billingModel value to set.
     * @return the RegistrationInner object itself.
     */
    public RegistrationInner withBillingModel(String billingModel) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RegistrationProperties();
        }
        this.innerProperties().withBillingModel(billingModel);
        return this;
    }

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