// 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.AuthorizationMethod;
import com.azure.resourcemanager.apimanagement.models.AuthorizationServerContractBaseProperties;
import com.azure.resourcemanager.apimanagement.models.BearerTokenSendingMethod;
import com.azure.resourcemanager.apimanagement.models.ClientAuthenticationMethod;
import com.azure.resourcemanager.apimanagement.models.GrantType;
import com.azure.resourcemanager.apimanagement.models.TokenBodyParameterContract;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** External OAuth authorization server Update settings contract. */
@Fluent
public final class AuthorizationServerUpdateContractProperties extends AuthorizationServerContractBaseProperties {
    /*
     * User-friendly authorization server name.
     */
    @JsonProperty(value = "displayName")
    private String displayName;

    /*
     * Optional reference to a page where client or app registration for this
     * authorization server is performed. Contains absolute URL to entity being
     * referenced.
     */
    @JsonProperty(value = "clientRegistrationEndpoint")
    private String clientRegistrationEndpoint;

    /*
     * OAuth authorization endpoint. See
     * http://tools.ietf.org/html/rfc6749#section-3.2.
     */
    @JsonProperty(value = "authorizationEndpoint")
    private String authorizationEndpoint;

    /*
     * Form of an authorization grant, which the client uses to request the
     * access token.
     */
    @JsonProperty(value = "grantTypes")
    private List<GrantType> grantTypes;

    /*
     * Client or app id registered with this authorization server.
     */
    @JsonProperty(value = "clientId")
    private String clientId;

    /*
     * Client or app secret registered with this authorization server. This
     * property will not be filled on 'GET' operations! Use '/listSecrets' POST
     * request to get the value.
     */
    @JsonProperty(value = "clientSecret")
    private String clientSecret;

    /**
     * Get the displayName property: User-friendly authorization server name.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.displayName;
    }

    /**
     * Set the displayName property: User-friendly authorization server name.
     *
     * @param displayName the displayName value to set.
     * @return the AuthorizationServerUpdateContractProperties object itself.
     */
    public AuthorizationServerUpdateContractProperties withDisplayName(String displayName) {
        this.displayName = displayName;
        return this;
    }

    /**
     * Get the clientRegistrationEndpoint property: Optional reference to a page where client or app registration for
     * this authorization server is performed. Contains absolute URL to entity being referenced.
     *
     * @return the clientRegistrationEndpoint value.
     */
    public String clientRegistrationEndpoint() {
        return this.clientRegistrationEndpoint;
    }

    /**
     * Set the clientRegistrationEndpoint property: Optional reference to a page where client or app registration for
     * this authorization server is performed. Contains absolute URL to entity being referenced.
     *
     * @param clientRegistrationEndpoint the clientRegistrationEndpoint value to set.
     * @return the AuthorizationServerUpdateContractProperties object itself.
     */
    public AuthorizationServerUpdateContractProperties withClientRegistrationEndpoint(
        String clientRegistrationEndpoint) {
        this.clientRegistrationEndpoint = clientRegistrationEndpoint;
        return this;
    }

    /**
     * Get the authorizationEndpoint property: OAuth authorization endpoint. See
     * http://tools.ietf.org/html/rfc6749#section-3.2.
     *
     * @return the authorizationEndpoint value.
     */
    public String authorizationEndpoint() {
        return this.authorizationEndpoint;
    }

    /**
     * Set the authorizationEndpoint property: OAuth authorization endpoint. See
     * http://tools.ietf.org/html/rfc6749#section-3.2.
     *
     * @param authorizationEndpoint the authorizationEndpoint value to set.
     * @return the AuthorizationServerUpdateContractProperties object itself.
     */
    public AuthorizationServerUpdateContractProperties withAuthorizationEndpoint(String authorizationEndpoint) {
        this.authorizationEndpoint = authorizationEndpoint;
        return this;
    }

    /**
     * Get the grantTypes property: Form of an authorization grant, which the client uses to request the access token.
     *
     * @return the grantTypes value.
     */
    public List<GrantType> grantTypes() {
        return this.grantTypes;
    }

    /**
     * Set the grantTypes property: Form of an authorization grant, which the client uses to request the access token.
     *
     * @param grantTypes the grantTypes value to set.
     * @return the AuthorizationServerUpdateContractProperties object itself.
     */
    public AuthorizationServerUpdateContractProperties withGrantTypes(List<GrantType> grantTypes) {
        this.grantTypes = grantTypes;
        return this;
    }

    /**
     * Get the clientId property: Client or app id registered with this authorization server.
     *
     * @return the clientId value.
     */
    public String clientId() {
        return this.clientId;
    }

    /**
     * Set the clientId property: Client or app id registered with this authorization server.
     *
     * @param clientId the clientId value to set.
     * @return the AuthorizationServerUpdateContractProperties object itself.
     */
    public AuthorizationServerUpdateContractProperties withClientId(String clientId) {
        this.clientId = clientId;
        return this;
    }

    /**
     * Get the clientSecret property: Client or app secret registered with this authorization server. This property will
     * not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
     *
     * @return the clientSecret value.
     */
    public String clientSecret() {
        return this.clientSecret;
    }

    /**
     * Set the clientSecret property: Client or app secret registered with this authorization server. This property will
     * not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
     *
     * @param clientSecret the clientSecret value to set.
     * @return the AuthorizationServerUpdateContractProperties object itself.
     */
    public AuthorizationServerUpdateContractProperties withClientSecret(String clientSecret) {
        this.clientSecret = clientSecret;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public AuthorizationServerUpdateContractProperties withDescription(String description) {
        super.withDescription(description);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public AuthorizationServerUpdateContractProperties withAuthorizationMethods(
        List<AuthorizationMethod> authorizationMethods) {
        super.withAuthorizationMethods(authorizationMethods);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public AuthorizationServerUpdateContractProperties withClientAuthenticationMethod(
        List<ClientAuthenticationMethod> clientAuthenticationMethod) {
        super.withClientAuthenticationMethod(clientAuthenticationMethod);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public AuthorizationServerUpdateContractProperties withTokenBodyParameters(
        List<TokenBodyParameterContract> tokenBodyParameters) {
        super.withTokenBodyParameters(tokenBodyParameters);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public AuthorizationServerUpdateContractProperties withTokenEndpoint(String tokenEndpoint) {
        super.withTokenEndpoint(tokenEndpoint);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public AuthorizationServerUpdateContractProperties withSupportState(Boolean supportState) {
        super.withSupportState(supportState);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public AuthorizationServerUpdateContractProperties withDefaultScope(String defaultScope) {
        super.withDefaultScope(defaultScope);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public AuthorizationServerUpdateContractProperties withBearerTokenSendingMethods(
        List<BearerTokenSendingMethod> bearerTokenSendingMethods) {
        super.withBearerTokenSendingMethods(bearerTokenSendingMethods);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public AuthorizationServerUpdateContractProperties withResourceOwnerUsername(String resourceOwnerUsername) {
        super.withResourceOwnerUsername(resourceOwnerUsername);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public AuthorizationServerUpdateContractProperties withResourceOwnerPassword(String resourceOwnerPassword) {
        super.withResourceOwnerPassword(resourceOwnerPassword);
        return this;
    }

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