/*
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 * Changes may cause incorrect behavior and will be lost if the code is
 * regenerated.
 */

'use strict';

/**
 * External OAuth authorization server Update settings contract.
 *
 */
class AuthorizationServerContractBaseProperties {
  /**
   * Create a AuthorizationServerContractBaseProperties.
   * @property {string} [description] Description of the authorization server.
   * Can contain HTML formatting tags.
   * @property {array} [authorizationMethods] HTTP verbs supported by the
   * authorization endpoint. GET must be always present. POST is optional.
   * @property {array} [clientAuthenticationMethod] Method of authentication
   * supported by the token endpoint of this authorization server. Possible
   * values are Basic and/or Body. When Body is specified, client credentials
   * and other parameters are passed within the request body in the
   * application/x-www-form-urlencoded format.
   * @property {array} [tokenBodyParameters] Additional parameters required by
   * the token endpoint of this authorization server represented as an array of
   * JSON objects with name and value string properties, i.e. {"name" : "name
   * value", "value": "a value"}.
   * @property {string} [tokenEndpoint] OAuth token endpoint. Contains absolute
   * URI to entity being referenced.
   * @property {boolean} [supportState] If true, authorization server will
   * include state parameter from the authorization request to its response.
   * Client may use state parameter to raise protocol security.
   * @property {string} [defaultScope] Access token scope that is going to be
   * requested by default. Can be overridden at the API level. Should be
   * provided in the form of a string containing space-delimited values.
   * @property {array} [bearerTokenSendingMethods] Specifies the mechanism by
   * which access token is passed to the API.
   * @property {string} [resourceOwnerUsername] Can be optionally specified
   * when resource owner password grant type is supported by this authorization
   * server. Default resource owner username.
   * @property {string} [resourceOwnerPassword] Can be optionally specified
   * when resource owner password grant type is supported by this authorization
   * server. Default resource owner password.
   */
  constructor() {
  }

  /**
   * Defines the metadata of AuthorizationServerContractBaseProperties
   *
   * @returns {object} metadata of AuthorizationServerContractBaseProperties
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'AuthorizationServerContractBaseProperties',
      type: {
        name: 'Composite',
        className: 'AuthorizationServerContractBaseProperties',
        modelProperties: {
          description: {
            required: false,
            serializedName: 'description',
            type: {
              name: 'String'
            }
          },
          authorizationMethods: {
            required: false,
            serializedName: 'authorizationMethods',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'AuthorizationMethodElementType',
                  type: {
                    name: 'Enum',
                    allowedValues: [ 'HEAD', 'OPTIONS', 'TRACE', 'GET', 'POST', 'PUT', 'PATCH', 'DELETE' ]
                  }
              }
            }
          },
          clientAuthenticationMethod: {
            required: false,
            serializedName: 'clientAuthenticationMethod',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ClientAuthenticationMethodElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          tokenBodyParameters: {
            required: false,
            serializedName: 'tokenBodyParameters',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'TokenBodyParameterContractElementType',
                  type: {
                    name: 'Composite',
                    className: 'TokenBodyParameterContract'
                  }
              }
            }
          },
          tokenEndpoint: {
            required: false,
            serializedName: 'tokenEndpoint',
            type: {
              name: 'String'
            }
          },
          supportState: {
            required: false,
            serializedName: 'supportState',
            type: {
              name: 'Boolean'
            }
          },
          defaultScope: {
            required: false,
            serializedName: 'defaultScope',
            type: {
              name: 'String'
            }
          },
          bearerTokenSendingMethods: {
            required: false,
            serializedName: 'bearerTokenSendingMethods',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'BearerTokenSendingMethodElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          resourceOwnerUsername: {
            required: false,
            serializedName: 'resourceOwnerUsername',
            type: {
              name: 'String'
            }
          },
          resourceOwnerPassword: {
            required: false,
            serializedName: 'resourceOwnerPassword',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = AuthorizationServerContractBaseProperties;
