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

/**
 * Information about a domain.
 *
 * @extends models['Resource']
 */
class Domain extends models['Resource'] {
  /**
   * Create a Domain.
   * @member {object} contactAdmin Administrative contact.
   * @member {object} [contactAdmin.addressMailing] Mailing address.
   * @member {string} [contactAdmin.addressMailing.address1] First line of an
   * Address.
   * @member {string} [contactAdmin.addressMailing.address2] The second line of
   * the Address. Optional.
   * @member {string} [contactAdmin.addressMailing.city] The city for the
   * address.
   * @member {string} [contactAdmin.addressMailing.country] The country for the
   * address.
   * @member {string} [contactAdmin.addressMailing.postalCode] The postal code
   * for the address.
   * @member {string} [contactAdmin.addressMailing.state] The state or province
   * for the address.
   * @member {string} [contactAdmin.email] Email address.
   * @member {string} [contactAdmin.fax] Fax number.
   * @member {string} [contactAdmin.jobTitle] Job title.
   * @member {string} [contactAdmin.nameFirst] First name.
   * @member {string} [contactAdmin.nameLast] Last name.
   * @member {string} [contactAdmin.nameMiddle] Middle name.
   * @member {string} [contactAdmin.organization] Organization contact belongs
   * to.
   * @member {string} [contactAdmin.phone] Phone number.
   * @member {object} contactBilling Billing contact.
   * @member {object} [contactBilling.addressMailing] Mailing address.
   * @member {string} [contactBilling.addressMailing.address1] First line of an
   * Address.
   * @member {string} [contactBilling.addressMailing.address2] The second line
   * of the Address. Optional.
   * @member {string} [contactBilling.addressMailing.city] The city for the
   * address.
   * @member {string} [contactBilling.addressMailing.country] The country for
   * the address.
   * @member {string} [contactBilling.addressMailing.postalCode] The postal
   * code for the address.
   * @member {string} [contactBilling.addressMailing.state] The state or
   * province for the address.
   * @member {string} [contactBilling.email] Email address.
   * @member {string} [contactBilling.fax] Fax number.
   * @member {string} [contactBilling.jobTitle] Job title.
   * @member {string} [contactBilling.nameFirst] First name.
   * @member {string} [contactBilling.nameLast] Last name.
   * @member {string} [contactBilling.nameMiddle] Middle name.
   * @member {string} [contactBilling.organization] Organization contact
   * belongs to.
   * @member {string} [contactBilling.phone] Phone number.
   * @member {object} contactRegistrant Registrant contact.
   * @member {object} [contactRegistrant.addressMailing] Mailing address.
   * @member {string} [contactRegistrant.addressMailing.address1] First line of
   * an Address.
   * @member {string} [contactRegistrant.addressMailing.address2] The second
   * line of the Address. Optional.
   * @member {string} [contactRegistrant.addressMailing.city] The city for the
   * address.
   * @member {string} [contactRegistrant.addressMailing.country] The country
   * for the address.
   * @member {string} [contactRegistrant.addressMailing.postalCode] The postal
   * code for the address.
   * @member {string} [contactRegistrant.addressMailing.state] The state or
   * province for the address.
   * @member {string} [contactRegistrant.email] Email address.
   * @member {string} [contactRegistrant.fax] Fax number.
   * @member {string} [contactRegistrant.jobTitle] Job title.
   * @member {string} [contactRegistrant.nameFirst] First name.
   * @member {string} [contactRegistrant.nameLast] Last name.
   * @member {string} [contactRegistrant.nameMiddle] Middle name.
   * @member {string} [contactRegistrant.organization] Organization contact
   * belongs to.
   * @member {string} [contactRegistrant.phone] Phone number.
   * @member {object} contactTech Technical contact.
   * @member {object} [contactTech.addressMailing] Mailing address.
   * @member {string} [contactTech.addressMailing.address1] First line of an
   * Address.
   * @member {string} [contactTech.addressMailing.address2] The second line of
   * the Address. Optional.
   * @member {string} [contactTech.addressMailing.city] The city for the
   * address.
   * @member {string} [contactTech.addressMailing.country] The country for the
   * address.
   * @member {string} [contactTech.addressMailing.postalCode] The postal code
   * for the address.
   * @member {string} [contactTech.addressMailing.state] The state or province
   * for the address.
   * @member {string} [contactTech.email] Email address.
   * @member {string} [contactTech.fax] Fax number.
   * @member {string} [contactTech.jobTitle] Job title.
   * @member {string} [contactTech.nameFirst] First name.
   * @member {string} [contactTech.nameLast] Last name.
   * @member {string} [contactTech.nameMiddle] Middle name.
   * @member {string} [contactTech.organization] Organization contact belongs
   * to.
   * @member {string} [contactTech.phone] Phone number.
   * @member {string} [registrationStatus] Domain registration status. Possible
   * values include: 'Active', 'Awaiting', 'Cancelled', 'Confiscated',
   * 'Disabled', 'Excluded', 'Expired', 'Failed', 'Held', 'Locked', 'Parked',
   * 'Pending', 'Reserved', 'Reverted', 'Suspended', 'Transferred', 'Unknown',
   * 'Unlocked', 'Unparked', 'Updated', 'JsonConverterFailed'
   * @member {string} [provisioningState] Domain provisioning state. Possible
   * values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress',
   * 'Deleting'
   * @member {array} [nameServers] Name servers.
   * @member {boolean} [privacy] <code>true</code> if domain privacy is enabled
   * for this domain; otherwise, <code>false</code>.
   * @member {date} [createdTime] Domain creation timestamp.
   * @member {date} [expirationTime] Domain expiration timestamp.
   * @member {date} [lastRenewedTime] Timestamp when the domain was renewed
   * last time.
   * @member {boolean} [autoRenew] <code>true</code> if the domain should be
   * automatically renewed; otherwise, <code>false</code>. Default value: true
   * .
   * @member {boolean} [readyForDnsRecordManagement] <code>true</code> if Azure
   * can assign this domain to App Service apps; otherwise, <code>false</code>.
   * This value will be <code>true</code> if domain registration status is
   * active and
   * it is hosted on name servers Azure has programmatic access to.
   * @member {array} [managedHostNames] All hostnames derived from the domain
   * and assigned to Azure resources.
   * @member {object} consent Legal agreement consent.
   * @member {array} [consent.agreementKeys] List of applicable legal agreement
   * keys. This list can be retrieved using ListLegalAgreements API under
   * <code>TopLevelDomain</code> resource.
   * @member {string} [consent.agreedBy] Client IP address.
   * @member {date} [consent.agreedAt] Timestamp when the agreements were
   * accepted.
   * @member {array} [domainNotRenewableReasons] Reasons why domain is not
   * renewable.
   * @member {string} [dnsType] Current DNS type. Possible values include:
   * 'AzureDns', 'DefaultDomainRegistrarDns'
   * @member {string} [dnsZoneId] Azure DNS Zone to use
   * @member {string} [targetDnsType] Target DNS type (would be used for
   * migration). Possible values include: 'AzureDns',
   * 'DefaultDomainRegistrarDns'
   * @member {string} [authCode]
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of Domain
   *
   * @returns {object} metadata of Domain
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Domain',
      type: {
        name: 'Composite',
        className: 'Domain',
        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'
            }
          },
          location: {
            required: true,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          contactAdmin: {
            required: true,
            serializedName: 'properties.contactAdmin',
            type: {
              name: 'Composite',
              className: 'Contact'
            }
          },
          contactBilling: {
            required: true,
            serializedName: 'properties.contactBilling',
            type: {
              name: 'Composite',
              className: 'Contact'
            }
          },
          contactRegistrant: {
            required: true,
            serializedName: 'properties.contactRegistrant',
            type: {
              name: 'Composite',
              className: 'Contact'
            }
          },
          contactTech: {
            required: true,
            serializedName: 'properties.contactTech',
            type: {
              name: 'Composite',
              className: 'Contact'
            }
          },
          registrationStatus: {
            required: false,
            readOnly: true,
            serializedName: 'properties.registrationStatus',
            type: {
              name: 'Enum',
              allowedValues: [ 'Active', 'Awaiting', 'Cancelled', 'Confiscated', 'Disabled', 'Excluded', 'Expired', 'Failed', 'Held', 'Locked', 'Parked', 'Pending', 'Reserved', 'Reverted', 'Suspended', 'Transferred', 'Unknown', 'Unlocked', 'Unparked', 'Updated', 'JsonConverterFailed' ]
            }
          },
          provisioningState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'Enum',
              allowedValues: [ 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' ]
            }
          },
          nameServers: {
            required: false,
            readOnly: true,
            serializedName: 'properties.nameServers',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          privacy: {
            required: false,
            serializedName: 'properties.privacy',
            type: {
              name: 'Boolean'
            }
          },
          createdTime: {
            required: false,
            readOnly: true,
            serializedName: 'properties.createdTime',
            type: {
              name: 'DateTime'
            }
          },
          expirationTime: {
            required: false,
            readOnly: true,
            serializedName: 'properties.expirationTime',
            type: {
              name: 'DateTime'
            }
          },
          lastRenewedTime: {
            required: false,
            readOnly: true,
            serializedName: 'properties.lastRenewedTime',
            type: {
              name: 'DateTime'
            }
          },
          autoRenew: {
            required: false,
            serializedName: 'properties.autoRenew',
            defaultValue: true,
            type: {
              name: 'Boolean'
            }
          },
          readyForDnsRecordManagement: {
            required: false,
            readOnly: true,
            serializedName: 'properties.readyForDnsRecordManagement',
            type: {
              name: 'Boolean'
            }
          },
          managedHostNames: {
            required: false,
            readOnly: true,
            serializedName: 'properties.managedHostNames',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'HostNameElementType',
                  type: {
                    name: 'Composite',
                    className: 'HostName'
                  }
              }
            }
          },
          consent: {
            required: true,
            serializedName: 'properties.consent',
            type: {
              name: 'Composite',
              className: 'DomainPurchaseConsent'
            }
          },
          domainNotRenewableReasons: {
            required: false,
            readOnly: true,
            serializedName: 'properties.domainNotRenewableReasons',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          dnsType: {
            required: false,
            serializedName: 'properties.dnsType',
            type: {
              name: 'Enum',
              allowedValues: [ 'AzureDns', 'DefaultDomainRegistrarDns' ]
            }
          },
          dnsZoneId: {
            required: false,
            serializedName: 'properties.dnsZoneId',
            type: {
              name: 'String'
            }
          },
          targetDnsType: {
            required: false,
            serializedName: 'properties.targetDnsType',
            type: {
              name: 'Enum',
              allowedValues: [ 'AzureDns', 'DefaultDomainRegistrarDns' ]
            }
          },
          authCode: {
            required: false,
            serializedName: 'properties.authCode',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = Domain;
