/*
 * 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.
 *
 * @extends models['ProxyOnlyResource']
 */
class CertificatePatchResource extends models['ProxyOnlyResource'] {
  /**
   * Create a CertificatePatchResource.
   * @member {string} [friendlyName] Friendly name of the certificate.
   * @member {string} [subjectName] Subject name of the certificate.
   * @member {array} [hostNames] Host names the certificate applies to.
   * @member {buffer} [pfxBlob] Pfx blob.
   * @member {string} [siteName] App name.
   * @member {string} [selfLink] Self link.
   * @member {string} [issuer] Certificate issuer.
   * @member {date} [issueDate] Certificate issue Date.
   * @member {date} [expirationDate] Certificate expriration date.
   * @member {string} password Certificate password.
   * @member {string} [thumbprint] Certificate thumbprint.
   * @member {boolean} [valid] Is the certificate valid?.
   * @member {buffer} [cerBlob] Raw bytes of .cer file
   * @member {string} [publicKeyHash] Public key hash.
   * @member {object} [hostingEnvironmentProfile] Specification for the App
   * Service Environment to use for the certificate.
   * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App
   * Service Environment.
   * @member {string} [hostingEnvironmentProfile.name] Name of the App Service
   * Environment.
   * @member {string} [hostingEnvironmentProfile.type] Resource type of the App
   * Service Environment.
   * @member {string} [keyVaultId] Key Vault Csm resource Id.
   * @member {string} [keyVaultSecretName] Key Vault secret name.
   * @member {string} [keyVaultSecretStatus] Status of the Key Vault secret.
   * Possible values include: 'Initialized', 'WaitingOnCertificateOrder',
   * 'Succeeded', 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault',
   * 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist',
   * 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey',
   * 'Unknown'
   * @member {string} [serverFarmId] Resource ID of the associated App Service
   * plan, formatted as:
   * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}".
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of CertificatePatchResource
   *
   * @returns {object} metadata of CertificatePatchResource
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'CertificatePatchResource',
      type: {
        name: 'Composite',
        className: 'CertificatePatchResource',
        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'
            }
          },
          friendlyName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.friendlyName',
            type: {
              name: 'String'
            }
          },
          subjectName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.subjectName',
            type: {
              name: 'String'
            }
          },
          hostNames: {
            required: false,
            serializedName: 'properties.hostNames',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          pfxBlob: {
            required: false,
            serializedName: 'properties.pfxBlob',
            type: {
              name: 'ByteArray'
            }
          },
          siteName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.siteName',
            type: {
              name: 'String'
            }
          },
          selfLink: {
            required: false,
            readOnly: true,
            serializedName: 'properties.selfLink',
            type: {
              name: 'String'
            }
          },
          issuer: {
            required: false,
            readOnly: true,
            serializedName: 'properties.issuer',
            type: {
              name: 'String'
            }
          },
          issueDate: {
            required: false,
            readOnly: true,
            serializedName: 'properties.issueDate',
            type: {
              name: 'DateTime'
            }
          },
          expirationDate: {
            required: false,
            readOnly: true,
            serializedName: 'properties.expirationDate',
            type: {
              name: 'DateTime'
            }
          },
          password: {
            required: true,
            serializedName: 'properties.password',
            type: {
              name: 'String'
            }
          },
          thumbprint: {
            required: false,
            readOnly: true,
            serializedName: 'properties.thumbprint',
            type: {
              name: 'String'
            }
          },
          valid: {
            required: false,
            readOnly: true,
            serializedName: 'properties.valid',
            type: {
              name: 'Boolean'
            }
          },
          cerBlob: {
            required: false,
            readOnly: true,
            serializedName: 'properties.cerBlob',
            type: {
              name: 'ByteArray'
            }
          },
          publicKeyHash: {
            required: false,
            readOnly: true,
            serializedName: 'properties.publicKeyHash',
            type: {
              name: 'String'
            }
          },
          hostingEnvironmentProfile: {
            required: false,
            readOnly: true,
            serializedName: 'properties.hostingEnvironmentProfile',
            type: {
              name: 'Composite',
              className: 'HostingEnvironmentProfile'
            }
          },
          keyVaultId: {
            required: false,
            serializedName: 'properties.keyVaultId',
            type: {
              name: 'String'
            }
          },
          keyVaultSecretName: {
            required: false,
            serializedName: 'properties.keyVaultSecretName',
            type: {
              name: 'String'
            }
          },
          keyVaultSecretStatus: {
            required: false,
            readOnly: true,
            serializedName: 'properties.keyVaultSecretStatus',
            type: {
              name: 'Enum',
              allowedValues: [ 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', 'Unknown' ]
            }
          },
          serverFarmId: {
            required: false,
            serializedName: 'properties.serverFarmId',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = CertificatePatchResource;
