/*
 * 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';

const models = require('./index');

/**
 * ARM resource for a certificate order that is purchased through Azure.
 *
 * @extends models['ProxyOnlyResource']
 */
class AppServiceCertificateOrderPatchResource extends models['ProxyOnlyResource'] {
  /**
   * Create a AppServiceCertificateOrderPatchResource.
   * @member {object} [certificates] State of the Key Vault secret.
   * @member {string} [distinguishedName] Certificate distinguished name.
   * @member {string} [domainVerificationToken] Domain verification token.
   * @member {number} [validityInYears] Duration in years (must be between 1
   * and 3). Default value: 1 .
   * @member {number} [keySize] Certificate key size. Default value: 2048 .
   * @member {string} productType Certificate product type. Possible values
   * include: 'StandardDomainValidatedSsl',
   * 'StandardDomainValidatedWildCardSsl'
   * @member {boolean} [autoRenew] <code>true</code> if the certificate should
   * be automatically renewed when it expires; otherwise, <code>false</code>.
   * Default value: true .
   * @member {string} [provisioningState] Status of certificate order. Possible
   * values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress',
   * 'Deleting'
   * @member {string} [status] Current order status. Possible values include:
   * 'Pendingissuance', 'Issued', 'Revoked', 'Canceled', 'Denied',
   * 'Pendingrevocation', 'PendingRekey', 'Unused', 'Expired', 'NotSubmitted'
   * @member {object} [signedCertificate] Signed certificate.
   * @member {number} [signedCertificate.version] Certificate Version.
   * @member {string} [signedCertificate.serialNumber] Certificate Serial
   * Number.
   * @member {string} [signedCertificate.thumbprint] Certificate Thumbprint.
   * @member {string} [signedCertificate.subject] Certificate Subject.
   * @member {date} [signedCertificate.notBefore] Date Certificate is valid
   * from.
   * @member {date} [signedCertificate.notAfter] Date Certificate is valid to.
   * @member {string} [signedCertificate.signatureAlgorithm] Certificate
   * Signature algorithm.
   * @member {string} [signedCertificate.issuer] Certificate Issuer.
   * @member {string} [signedCertificate.rawData] Raw certificate data.
   * @member {string} [csr] Last CSR that was created for this order.
   * @member {object} [intermediate] Intermediate certificate.
   * @member {number} [intermediate.version] Certificate Version.
   * @member {string} [intermediate.serialNumber] Certificate Serial Number.
   * @member {string} [intermediate.thumbprint] Certificate Thumbprint.
   * @member {string} [intermediate.subject] Certificate Subject.
   * @member {date} [intermediate.notBefore] Date Certificate is valid from.
   * @member {date} [intermediate.notAfter] Date Certificate is valid to.
   * @member {string} [intermediate.signatureAlgorithm] Certificate Signature
   * algorithm.
   * @member {string} [intermediate.issuer] Certificate Issuer.
   * @member {string} [intermediate.rawData] Raw certificate data.
   * @member {object} [root] Root certificate.
   * @member {number} [root.version] Certificate Version.
   * @member {string} [root.serialNumber] Certificate Serial Number.
   * @member {string} [root.thumbprint] Certificate Thumbprint.
   * @member {string} [root.subject] Certificate Subject.
   * @member {date} [root.notBefore] Date Certificate is valid from.
   * @member {date} [root.notAfter] Date Certificate is valid to.
   * @member {string} [root.signatureAlgorithm] Certificate Signature
   * algorithm.
   * @member {string} [root.issuer] Certificate Issuer.
   * @member {string} [root.rawData] Raw certificate data.
   * @member {string} [serialNumber] Current serial number of the certificate.
   * @member {date} [lastCertificateIssuanceTime] Certificate last issuance
   * time.
   * @member {date} [expirationTime] Certificate expiration time.
   * @member {boolean} [isPrivateKeyExternal] <code>true</code> if private key
   * is external; otherwise, <code>false</code>.
   * @member {array} [appServiceCertificateNotRenewableReasons] Reasons why App
   * Service Certificate is not renewable at the current moment.
   * @member {date} [nextAutoRenewalTimeStamp] Time stamp when the certificate
   * would be auto renewed next
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of AppServiceCertificateOrderPatchResource
   *
   * @returns {object} metadata of AppServiceCertificateOrderPatchResource
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'AppServiceCertificateOrderPatchResource',
      type: {
        name: 'Composite',
        className: 'AppServiceCertificateOrderPatchResource',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          kind: {
            required: false,
            serializedName: 'kind',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          certificates: {
            required: false,
            serializedName: 'properties.certificates',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'AppServiceCertificateElementType',
                  type: {
                    name: 'Composite',
                    className: 'AppServiceCertificate'
                  }
              }
            }
          },
          distinguishedName: {
            required: false,
            serializedName: 'properties.distinguishedName',
            type: {
              name: 'String'
            }
          },
          domainVerificationToken: {
            required: false,
            readOnly: true,
            serializedName: 'properties.domainVerificationToken',
            type: {
              name: 'String'
            }
          },
          validityInYears: {
            required: false,
            serializedName: 'properties.validityInYears',
            defaultValue: 1,
            constraints: {
              InclusiveMaximum: 3,
              InclusiveMinimum: 1
            },
            type: {
              name: 'Number'
            }
          },
          keySize: {
            required: false,
            serializedName: 'properties.keySize',
            defaultValue: 2048,
            type: {
              name: 'Number'
            }
          },
          productType: {
            required: true,
            serializedName: 'properties.productType',
            type: {
              name: 'Enum',
              allowedValues: [ 'StandardDomainValidatedSsl', 'StandardDomainValidatedWildCardSsl' ]
            }
          },
          autoRenew: {
            required: false,
            serializedName: 'properties.autoRenew',
            defaultValue: true,
            type: {
              name: 'Boolean'
            }
          },
          provisioningState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'Enum',
              allowedValues: [ 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' ]
            }
          },
          status: {
            required: false,
            readOnly: true,
            serializedName: 'properties.status',
            type: {
              name: 'Enum',
              allowedValues: [ 'Pendingissuance', 'Issued', 'Revoked', 'Canceled', 'Denied', 'Pendingrevocation', 'PendingRekey', 'Unused', 'Expired', 'NotSubmitted' ]
            }
          },
          signedCertificate: {
            required: false,
            readOnly: true,
            serializedName: 'properties.signedCertificate',
            type: {
              name: 'Composite',
              className: 'CertificateDetails'
            }
          },
          csr: {
            required: false,
            serializedName: 'properties.csr',
            type: {
              name: 'String'
            }
          },
          intermediate: {
            required: false,
            readOnly: true,
            serializedName: 'properties.intermediate',
            type: {
              name: 'Composite',
              className: 'CertificateDetails'
            }
          },
          root: {
            required: false,
            readOnly: true,
            serializedName: 'properties.root',
            type: {
              name: 'Composite',
              className: 'CertificateDetails'
            }
          },
          serialNumber: {
            required: false,
            readOnly: true,
            serializedName: 'properties.serialNumber',
            type: {
              name: 'String'
            }
          },
          lastCertificateIssuanceTime: {
            required: false,
            readOnly: true,
            serializedName: 'properties.lastCertificateIssuanceTime',
            type: {
              name: 'DateTime'
            }
          },
          expirationTime: {
            required: false,
            readOnly: true,
            serializedName: 'properties.expirationTime',
            type: {
              name: 'DateTime'
            }
          },
          isPrivateKeyExternal: {
            required: false,
            readOnly: true,
            serializedName: 'properties.isPrivateKeyExternal',
            type: {
              name: 'Boolean'
            }
          },
          appServiceCertificateNotRenewableReasons: {
            required: false,
            readOnly: true,
            serializedName: 'properties.appServiceCertificateNotRenewableReasons',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          nextAutoRenewalTimeStamp: {
            required: false,
            readOnly: true,
            serializedName: 'properties.nextAutoRenewalTimeStamp',
            type: {
              name: 'DateTime'
            }
          }
        }
      }
    };
  }
}

module.exports = AppServiceCertificateOrderPatchResource;
