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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Content type contract details. */
@Fluent
public final class ContentTypeContractInner extends ProxyResource {
    /*
     * Properties of the content type.
     */
    @JsonProperty(value = "properties")
    private ContentTypeContractProperties innerProperties;

    /**
     * Get the innerProperties property: Properties of the content type.
     *
     * @return the innerProperties value.
     */
    private ContentTypeContractProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the id property: Content type identifier.
     *
     * @return the id value.
     */
    public String idPropertiesId() {
        return this.innerProperties() == null ? null : this.innerProperties().id();
    }

    /**
     * Set the id property: Content type identifier.
     *
     * @param id the id value to set.
     * @return the ContentTypeContractInner object itself.
     */
    public ContentTypeContractInner withIdPropertiesId(String id) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ContentTypeContractProperties();
        }
        this.innerProperties().withId(id);
        return this;
    }

    /**
     * Get the name property: Content type name. Must be 1 to 250 characters long.
     *
     * @return the name value.
     */
    public String namePropertiesName() {
        return this.innerProperties() == null ? null : this.innerProperties().name();
    }

    /**
     * Set the name property: Content type name. Must be 1 to 250 characters long.
     *
     * @param name the name value to set.
     * @return the ContentTypeContractInner object itself.
     */
    public ContentTypeContractInner withNamePropertiesName(String name) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ContentTypeContractProperties();
        }
        this.innerProperties().withName(name);
        return this;
    }

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

    /**
     * Set the description property: Content type description.
     *
     * @param description the description value to set.
     * @return the ContentTypeContractInner object itself.
     */
    public ContentTypeContractInner withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ContentTypeContractProperties();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

    /**
     * Get the schema property: Content type schema.
     *
     * @return the schema value.
     */
    public Object schema() {
        return this.innerProperties() == null ? null : this.innerProperties().schema();
    }

    /**
     * Set the schema property: Content type schema.
     *
     * @param schema the schema value to set.
     * @return the ContentTypeContractInner object itself.
     */
    public ContentTypeContractInner withSchema(Object schema) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ContentTypeContractProperties();
        }
        this.innerProperties().withSchema(schema);
        return this;
    }

    /**
     * Get the version property: Content type version.
     *
     * @return the version value.
     */
    public String version() {
        return this.innerProperties() == null ? null : this.innerProperties().version();
    }

    /**
     * Set the version property: Content type version.
     *
     * @param version the version value to set.
     * @return the ContentTypeContractInner object itself.
     */
    public ContentTypeContractInner withVersion(String version) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ContentTypeContractProperties();
        }
        this.innerProperties().withVersion(version);
        return this;
    }

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