// 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.resourcemanager.apimanagement.models.SubscriptionState;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** Parameters supplied to the Update subscription operation. */
@Fluent
public final class SubscriptionUpdateParameterProperties {
    /*
     * User identifier path: /users/{userId}
     */
    @JsonProperty(value = "ownerId")
    private String ownerId;

    /*
     * Scope like /products/{productId} or /apis or /apis/{apiId}
     */
    @JsonProperty(value = "scope")
    private String scope;

    /*
     * Subscription expiration date. The setting is for audit purposes only and
     * the subscription is not automatically expired. The subscription
     * lifecycle can be managed by using the `state` property. The date
     * conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by
     * the ISO 8601 standard.
     */
    @JsonProperty(value = "expirationDate")
    private OffsetDateTime expirationDate;

    /*
     * Subscription name.
     */
    @JsonProperty(value = "displayName")
    private String displayName;

    /*
     * Primary subscription key.
     */
    @JsonProperty(value = "primaryKey")
    private String primaryKey;

    /*
     * Secondary subscription key.
     */
    @JsonProperty(value = "secondaryKey")
    private String secondaryKey;

    /*
     * Subscription state. Possible states are * active – the subscription is
     * active, * suspended – the subscription is blocked, and the subscriber
     * cannot call any APIs of the product, * submitted – the subscription
     * request has been made by the developer, but has not yet been approved or
     * rejected, * rejected – the subscription request has been denied by an
     * administrator, * cancelled – the subscription has been cancelled by the
     * developer or administrator, * expired – the subscription reached its
     * expiration date and was deactivated.
     */
    @JsonProperty(value = "state")
    private SubscriptionState state;

    /*
     * Comments describing subscription state change by the administrator when
     * the state is changed to the 'rejected'.
     */
    @JsonProperty(value = "stateComment")
    private String stateComment;

    /*
     * Determines whether tracing can be enabled
     */
    @JsonProperty(value = "allowTracing")
    private Boolean allowTracing;

    /**
     * Get the ownerId property: User identifier path: /users/{userId}.
     *
     * @return the ownerId value.
     */
    public String ownerId() {
        return this.ownerId;
    }

    /**
     * Set the ownerId property: User identifier path: /users/{userId}.
     *
     * @param ownerId the ownerId value to set.
     * @return the SubscriptionUpdateParameterProperties object itself.
     */
    public SubscriptionUpdateParameterProperties withOwnerId(String ownerId) {
        this.ownerId = ownerId;
        return this;
    }

    /**
     * Get the scope property: Scope like /products/{productId} or /apis or /apis/{apiId}.
     *
     * @return the scope value.
     */
    public String scope() {
        return this.scope;
    }

    /**
     * Set the scope property: Scope like /products/{productId} or /apis or /apis/{apiId}.
     *
     * @param scope the scope value to set.
     * @return the SubscriptionUpdateParameterProperties object itself.
     */
    public SubscriptionUpdateParameterProperties withScope(String scope) {
        this.scope = scope;
        return this;
    }

    /**
     * Get the expirationDate property: Subscription expiration date. The setting is for audit purposes only and the
     * subscription is not automatically expired. The subscription lifecycle can be managed by using the `state`
     * property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601
     * standard.
     *
     * @return the expirationDate value.
     */
    public OffsetDateTime expirationDate() {
        return this.expirationDate;
    }

    /**
     * Set the expirationDate property: Subscription expiration date. The setting is for audit purposes only and the
     * subscription is not automatically expired. The subscription lifecycle can be managed by using the `state`
     * property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601
     * standard.
     *
     * @param expirationDate the expirationDate value to set.
     * @return the SubscriptionUpdateParameterProperties object itself.
     */
    public SubscriptionUpdateParameterProperties withExpirationDate(OffsetDateTime expirationDate) {
        this.expirationDate = expirationDate;
        return this;
    }

    /**
     * Get the displayName property: Subscription name.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.displayName;
    }

    /**
     * Set the displayName property: Subscription name.
     *
     * @param displayName the displayName value to set.
     * @return the SubscriptionUpdateParameterProperties object itself.
     */
    public SubscriptionUpdateParameterProperties withDisplayName(String displayName) {
        this.displayName = displayName;
        return this;
    }

    /**
     * Get the primaryKey property: Primary subscription key.
     *
     * @return the primaryKey value.
     */
    public String primaryKey() {
        return this.primaryKey;
    }

    /**
     * Set the primaryKey property: Primary subscription key.
     *
     * @param primaryKey the primaryKey value to set.
     * @return the SubscriptionUpdateParameterProperties object itself.
     */
    public SubscriptionUpdateParameterProperties withPrimaryKey(String primaryKey) {
        this.primaryKey = primaryKey;
        return this;
    }

    /**
     * Get the secondaryKey property: Secondary subscription key.
     *
     * @return the secondaryKey value.
     */
    public String secondaryKey() {
        return this.secondaryKey;
    }

    /**
     * Set the secondaryKey property: Secondary subscription key.
     *
     * @param secondaryKey the secondaryKey value to set.
     * @return the SubscriptionUpdateParameterProperties object itself.
     */
    public SubscriptionUpdateParameterProperties withSecondaryKey(String secondaryKey) {
        this.secondaryKey = secondaryKey;
        return this;
    }

    /**
     * Get the state property: Subscription state. Possible states are * active – the subscription is active, *
     * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted –
     * the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected –
     * the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled
     * by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated.
     *
     * @return the state value.
     */
    public SubscriptionState state() {
        return this.state;
    }

    /**
     * Set the state property: Subscription state. Possible states are * active – the subscription is active, *
     * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted –
     * the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected –
     * the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled
     * by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated.
     *
     * @param state the state value to set.
     * @return the SubscriptionUpdateParameterProperties object itself.
     */
    public SubscriptionUpdateParameterProperties withState(SubscriptionState state) {
        this.state = state;
        return this;
    }

    /**
     * Get the stateComment property: Comments describing subscription state change by the administrator when the state
     * is changed to the 'rejected'.
     *
     * @return the stateComment value.
     */
    public String stateComment() {
        return this.stateComment;
    }

    /**
     * Set the stateComment property: Comments describing subscription state change by the administrator when the state
     * is changed to the 'rejected'.
     *
     * @param stateComment the stateComment value to set.
     * @return the SubscriptionUpdateParameterProperties object itself.
     */
    public SubscriptionUpdateParameterProperties withStateComment(String stateComment) {
        this.stateComment = stateComment;
        return this;
    }

    /**
     * Get the allowTracing property: Determines whether tracing can be enabled.
     *
     * @return the allowTracing value.
     */
    public Boolean allowTracing() {
        return this.allowTracing;
    }

    /**
     * Set the allowTracing property: Determines whether tracing can be enabled.
     *
     * @param allowTracing the allowTracing value to set.
     * @return the SubscriptionUpdateParameterProperties object itself.
     */
    public SubscriptionUpdateParameterProperties withAllowTracing(Boolean allowTracing) {
        this.allowTracing = allowTracing;
        return this;
    }

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