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

/**
 * A single API Management service resource in List or Get response.
 *
 * @extends models['ApimResource']
 */
class ApiManagementServiceResource extends models['ApimResource'] {
  /**
   * Create a ApiManagementServiceResource.
   * @property {string} [notificationSenderEmail] Email address from which the
   * notification will be sent.
   * @property {string} [provisioningState] The current provisioning state of
   * the API Management service which can be one of the following:
   * Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted.
   * @property {string} [targetProvisioningState] The provisioning state of the
   * API Management service, which is targeted by the long running operation
   * started on the service.
   * @property {date} [createdAtUtc] Creation UTC date of the API Management
   * service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ`
   * as specified by the ISO 8601 standard.
   * @property {string} [gatewayUrl] Gateway URL of the API Management service.
   * @property {string} [gatewayRegionalUrl] Gateway URL of the API Management
   * service in the Default Region.
   * @property {string} [portalUrl] Publisher portal endpoint Url of the API
   * Management service.
   * @property {string} [managementApiUrl] Management API endpoint URL of the
   * API Management service.
   * @property {string} [scmUrl] SCM endpoint URL of the API Management
   * service.
   * @property {string} [developerPortalUrl] DEveloper Portal endpoint URL of
   * the API Management service.
   * @property {array} [hostnameConfigurations] Custom hostname configuration
   * of the API Management service.
   * @property {array} [publicIPAddresses] Public Static Load Balanced IP
   * addresses of the API Management service in Primary region. Available only
   * for Basic, Standard and Premium SKU.
   * @property {array} [privateIPAddresses] Private Static Load Balanced IP
   * addresses of the API Management service in Primary region which is
   * deployed in an Internal Virtual Network. Available only for Basic,
   * Standard and Premium SKU.
   * @property {object} [virtualNetworkConfiguration] Virtual network
   * configuration of the API Management service.
   * @property {string} [virtualNetworkConfiguration.vnetid] The virtual
   * network ID. This is typically a GUID. Expect a null GUID by default.
   * @property {string} [virtualNetworkConfiguration.subnetname] The name of
   * the subnet.
   * @property {string} [virtualNetworkConfiguration.subnetResourceId] The full
   * resource ID of a subnet in a virtual network to deploy the API Management
   * service in.
   * @property {array} [additionalLocations] Additional datacenter locations of
   * the API Management service.
   * @property {object} [customProperties] Custom properties of the API
   * Management service.</br>Setting
   * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168`
   * will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1
   * and 1.2).</br>Setting
   * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11`
   * can be used to disable just TLS 1.1.</br>Setting
   * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10`
   * can be used to disable TLS 1.0 on an API Management service.</br>Setting
   * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11`
   * can be used to disable just TLS 1.1 for communications with
   * backends.</br>Setting
   * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10`
   * can be used to disable TLS 1.0 for communications with
   * backends.</br>Setting
   * `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can
   * be used to enable HTTP2 protocol on an API Management service.</br>Not
   * specifying any of these properties on PATCH operation will reset omitted
   * properties' values to their defaults. For all the settings except Http2
   * the default value is `True` if the service was created on or before April
   * 1st 2018 and `False` otherwise. Http2 setting's default value is
   * `False`.</br></br>You can disable any of next ciphers by using settings
   * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`:
   * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
   * TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
   * TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256,
   * TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256,
   * TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example,
   * `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`.
   * The default value is `true` for them.  Note: next ciphers can't be
   * disabled since they are required by Azure CloudService internal
   * components:
   * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384
   * @property {array} [certificates] List of Certificates that need to be
   * installed in the API Management service. Max supported certificates that
   * can be installed is 10.
   * @property {boolean} [enableClientCertificate] Property only meant to be
   * used for Consumption SKU Service. This enforces a client certificate to be
   * presented on each request to the gateway. This also enables the ability to
   * authenticate the certificate in the policy on the gateway. Default value:
   * false .
   * @property {boolean} [disableGateway] Property only valid for an Api
   * Management service deployed in multiple locations. This can be used to
   * disable the gateway in master region. Default value: false .
   * @property {string} [virtualNetworkType] The type of VPN in which API
   * Management service needs to be configured in. None (Default Value) means
   * the API Management service is not part of any Virtual Network, External
   * means the API Management deployment is set up inside a Virtual Network
   * having an Internet Facing Endpoint, and Internal means that API Management
   * deployment is setup inside a Virtual Network having an Intranet Facing
   * Endpoint only. Possible values include: 'None', 'External', 'Internal'.
   * Default value: 'None' .
   * @property {object} [apiVersionConstraint] Control Plane Apis version
   * constraint for the API Management service.
   * @property {string} [apiVersionConstraint.minApiVersion] Limit control
   * plane API calls to API Management service with version equal to or newer
   * than this value.
   * @property {string} publisherEmail Publisher email.
   * @property {string} publisherName Publisher name.
   * @property {object} sku SKU properties of the API Management service.
   * @property {string} [sku.name] Name of the Sku. Possible values include:
   * 'Developer', 'Standard', 'Premium', 'Basic', 'Consumption'
   * @property {number} [sku.capacity] Capacity of the SKU (number of deployed
   * units of the SKU). For Consumption SKU capacity must be specified as 0.
   * @property {object} [identity] Managed service identity of the Api
   * Management service.
   * @property {string} [identity.type] The type of identity used for the
   * resource. The type 'SystemAssigned, UserAssigned' includes both an
   * implicitly created identity and a set of user assigned identities. The
   * type 'None' will remove any identities from the service. Possible values
   * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned',
   * 'None'
   * @property {uuid} [identity.principalId] The principal id of the identity.
   * @property {uuid} [identity.tenantId] The client tenant id of the identity.
   * @property {object} [identity.userAssignedIdentities] The list of user
   * identities associated with the resource. The user identity
   * dictionary key references will be ARM resource ids in the form:
   * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/
   * providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
   * @property {string} location Resource location.
   * @property {string} [etag] ETag of the resource.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ApiManagementServiceResource
   *
   * @returns {object} metadata of ApiManagementServiceResource
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ApiManagementServiceResource',
      type: {
        name: 'Composite',
        className: 'ApiManagementServiceResource',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            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'
                  }
              }
            }
          },
          notificationSenderEmail: {
            required: false,
            serializedName: 'properties.notificationSenderEmail',
            constraints: {
              MaxLength: 100
            },
            type: {
              name: 'String'
            }
          },
          provisioningState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          targetProvisioningState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.targetProvisioningState',
            type: {
              name: 'String'
            }
          },
          createdAtUtc: {
            required: false,
            readOnly: true,
            serializedName: 'properties.createdAtUtc',
            type: {
              name: 'DateTime'
            }
          },
          gatewayUrl: {
            required: false,
            readOnly: true,
            serializedName: 'properties.gatewayUrl',
            type: {
              name: 'String'
            }
          },
          gatewayRegionalUrl: {
            required: false,
            readOnly: true,
            serializedName: 'properties.gatewayRegionalUrl',
            type: {
              name: 'String'
            }
          },
          portalUrl: {
            required: false,
            readOnly: true,
            serializedName: 'properties.portalUrl',
            type: {
              name: 'String'
            }
          },
          managementApiUrl: {
            required: false,
            readOnly: true,
            serializedName: 'properties.managementApiUrl',
            type: {
              name: 'String'
            }
          },
          scmUrl: {
            required: false,
            readOnly: true,
            serializedName: 'properties.scmUrl',
            type: {
              name: 'String'
            }
          },
          developerPortalUrl: {
            required: false,
            readOnly: true,
            serializedName: 'properties.developerPortalUrl',
            type: {
              name: 'String'
            }
          },
          hostnameConfigurations: {
            required: false,
            serializedName: 'properties.hostnameConfigurations',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'HostnameConfigurationElementType',
                  type: {
                    name: 'Composite',
                    className: 'HostnameConfiguration'
                  }
              }
            }
          },
          publicIPAddresses: {
            required: false,
            readOnly: true,
            serializedName: 'properties.publicIPAddresses',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          privateIPAddresses: {
            required: false,
            readOnly: true,
            serializedName: 'properties.privateIPAddresses',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          virtualNetworkConfiguration: {
            required: false,
            serializedName: 'properties.virtualNetworkConfiguration',
            type: {
              name: 'Composite',
              className: 'VirtualNetworkConfiguration'
            }
          },
          additionalLocations: {
            required: false,
            serializedName: 'properties.additionalLocations',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'AdditionalLocationElementType',
                  type: {
                    name: 'Composite',
                    className: 'AdditionalLocation'
                  }
              }
            }
          },
          customProperties: {
            required: false,
            serializedName: 'properties.customProperties',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          certificates: {
            required: false,
            serializedName: 'properties.certificates',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'CertificateConfigurationElementType',
                  type: {
                    name: 'Composite',
                    className: 'CertificateConfiguration'
                  }
              }
            }
          },
          enableClientCertificate: {
            required: false,
            serializedName: 'properties.enableClientCertificate',
            defaultValue: false,
            type: {
              name: 'Boolean'
            }
          },
          disableGateway: {
            required: false,
            serializedName: 'properties.disableGateway',
            defaultValue: false,
            type: {
              name: 'Boolean'
            }
          },
          virtualNetworkType: {
            required: false,
            serializedName: 'properties.virtualNetworkType',
            defaultValue: 'None',
            type: {
              name: 'String'
            }
          },
          apiVersionConstraint: {
            required: false,
            serializedName: 'properties.apiVersionConstraint',
            type: {
              name: 'Composite',
              className: 'ApiVersionConstraint'
            }
          },
          publisherEmail: {
            required: true,
            serializedName: 'properties.publisherEmail',
            constraints: {
              MaxLength: 100
            },
            type: {
              name: 'String'
            }
          },
          publisherName: {
            required: true,
            serializedName: 'properties.publisherName',
            constraints: {
              MaxLength: 100
            },
            type: {
              name: 'String'
            }
          },
          sku: {
            required: true,
            serializedName: 'sku',
            type: {
              name: 'Composite',
              className: 'ApiManagementServiceSkuProperties'
            }
          },
          identity: {
            required: false,
            serializedName: 'identity',
            type: {
              name: 'Composite',
              className: 'ApiManagementServiceIdentity'
            }
          },
          location: {
            required: true,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          etag: {
            required: false,
            readOnly: true,
            serializedName: 'etag',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ApiManagementServiceResource;
