|  |  | 1 |  | // <auto-generated> | 
|  |  | 2 |  | // Copyright (c) Microsoft Corporation. All rights reserved. | 
|  |  | 3 |  | // Licensed under the MIT License. See License.txt in the project root for | 
|  |  | 4 |  | // license information. | 
|  |  | 5 |  | // | 
|  |  | 6 |  | // Code generated by Microsoft (R) AutoRest Code Generator. | 
|  |  | 7 |  | // Changes may cause incorrect behavior and will be lost if the code is | 
|  |  | 8 |  | // regenerated. | 
|  |  | 9 |  | // </auto-generated> | 
|  |  | 10 |  |  | 
|  |  | 11 |  | namespace Microsoft.Azure.Management.Search.Models | 
|  |  | 12 |  | { | 
|  |  | 13 |  |     using Microsoft.Rest; | 
|  |  | 14 |  |     using Microsoft.Rest.Serialization; | 
|  |  | 15 |  |     using Newtonsoft.Json; | 
|  |  | 16 |  |     using System.Collections; | 
|  |  | 17 |  |     using System.Collections.Generic; | 
|  |  | 18 |  |     using System.Linq; | 
|  |  | 19 |  |  | 
|  |  | 20 |  |     /// <summary> | 
|  |  | 21 |  |     /// Describes an Azure Cognitive Search service and its current state. | 
|  |  | 22 |  |     /// </summary> | 
|  |  | 23 |  |     [Rest.Serialization.JsonTransformation] | 
|  |  | 24 |  |     public partial class SearchService : Resource | 
|  |  | 25 |  |     { | 
|  |  | 26 |  |         /// <summary> | 
|  |  | 27 |  |         /// Initializes a new instance of the SearchService class. | 
|  |  | 28 |  |         /// </summary> | 
|  | 1204 | 29 |  |         public SearchService() | 
|  |  | 30 |  |         { | 
|  |  | 31 |  |             CustomInit(); | 
|  | 1204 | 32 |  |         } | 
|  |  | 33 |  |  | 
|  |  | 34 |  |         /// <summary> | 
|  |  | 35 |  |         /// Initializes a new instance of the SearchService class. | 
|  |  | 36 |  |         /// </summary> | 
|  |  | 37 |  |         /// <param name="id">The ID of the resource. This can be used with the | 
|  |  | 38 |  |         /// Azure Resource Manager to link resources together.</param> | 
|  |  | 39 |  |         /// <param name="name">The name of the resource.</param> | 
|  |  | 40 |  |         /// <param name="type">The resource type.</param> | 
|  |  | 41 |  |         /// <param name="location">The geographic location of the resource. | 
|  |  | 42 |  |         /// This must be one of the supported and registered Azure Geo Regions | 
|  |  | 43 |  |         /// (for example, West US, East US, Southeast Asia, and so forth). This | 
|  |  | 44 |  |         /// property is required when creating a new resource.</param> | 
|  |  | 45 |  |         /// <param name="tags">Tags to help categorize the resource in the | 
|  |  | 46 |  |         /// Azure portal.</param> | 
|  |  | 47 |  |         /// <param name="identity">The identity of the resource.</param> | 
|  |  | 48 |  |         /// <param name="replicaCount">The number of replicas in the Search | 
|  |  | 49 |  |         /// service. If specified, it must be a value between 1 and 12 | 
|  |  | 50 |  |         /// inclusive for standard SKUs or between 1 and 3 inclusive for basic | 
|  |  | 51 |  |         /// SKU.</param> | 
|  |  | 52 |  |         /// <param name="partitionCount">The number of partitions in the Search | 
|  |  | 53 |  |         /// service; if specified, it can be 1, 2, 3, 4, 6, or 12. Values | 
|  |  | 54 |  |         /// greater than 1 are only valid for standard SKUs. For 'standard3' | 
|  |  | 55 |  |         /// services with hostingMode set to 'highDensity', the allowed values | 
|  |  | 56 |  |         /// are between 1 and 3.</param> | 
|  |  | 57 |  |         /// <param name="hostingMode">Applicable only for the standard3 SKU. | 
|  |  | 58 |  |         /// You can set this property to enable up to 3 high density partitions | 
|  |  | 59 |  |         /// that allow up to 1000 indexes, which is much higher than the | 
|  |  | 60 |  |         /// maximum indexes allowed for any other SKU. For the standard3 SKU, | 
|  |  | 61 |  |         /// the value is either 'default' or 'highDensity'. For all other SKUs, | 
|  |  | 62 |  |         /// this value must be 'default'. Possible values include: 'default', | 
|  |  | 63 |  |         /// 'highDensity'</param> | 
|  |  | 64 |  |         /// <param name="publicNetworkAccess">This value can be set to | 
|  |  | 65 |  |         /// 'enabled' to avoid breaking changes on existing customer resources | 
|  |  | 66 |  |         /// and templates. If set to 'disabled', traffic over public interface | 
|  |  | 67 |  |         /// is not allowed, and private endpoint connections would be the | 
|  |  | 68 |  |         /// exclusive access method. Possible values include: 'enabled', | 
|  |  | 69 |  |         /// 'disabled'</param> | 
|  |  | 70 |  |         /// <param name="status">The status of the Search service. Possible | 
|  |  | 71 |  |         /// values include: 'running': The Search service is running and no | 
|  |  | 72 |  |         /// provisioning operations are underway. 'provisioning': The Search | 
|  |  | 73 |  |         /// service is being provisioned or scaled up or down. 'deleting': The | 
|  |  | 74 |  |         /// Search service is being deleted. 'degraded': The Search service is | 
|  |  | 75 |  |         /// degraded. This can occur when the underlying search units are not | 
|  |  | 76 |  |         /// healthy. The Search service is most likely operational, but | 
|  |  | 77 |  |         /// performance might be slow and some requests might be dropped. | 
|  |  | 78 |  |         /// 'disabled': The Search service is disabled. In this state, the | 
|  |  | 79 |  |         /// service will reject all API requests. 'error': The Search service | 
|  |  | 80 |  |         /// is in an error state. If your service is in the degraded, disabled, | 
|  |  | 81 |  |         /// or error states, it means the Azure Cognitive Search team is | 
|  |  | 82 |  |         /// actively investigating the underlying issue. Dedicated services in | 
|  |  | 83 |  |         /// these states are still chargeable based on the number of search | 
|  |  | 84 |  |         /// units provisioned. Possible values include: 'running', | 
|  |  | 85 |  |         /// 'provisioning', 'deleting', 'degraded', 'disabled', 'error'</param> | 
|  |  | 86 |  |         /// <param name="statusDetails">The details of the Search service | 
|  |  | 87 |  |         /// status.</param> | 
|  |  | 88 |  |         /// <param name="provisioningState">The state of the last provisioning | 
|  |  | 89 |  |         /// operation performed on the Search service. Provisioning is an | 
|  |  | 90 |  |         /// intermediate state that occurs while service capacity is being | 
|  |  | 91 |  |         /// established. After capacity is set up, provisioningState changes to | 
|  |  | 92 |  |         /// either 'succeeded' or 'failed'. Client applications can poll | 
|  |  | 93 |  |         /// provisioning status (the recommended polling interval is from 30 | 
|  |  | 94 |  |         /// seconds to one minute) by using the Get Search Service operation to | 
|  |  | 95 |  |         /// see when an operation is completed. If you are using the free | 
|  |  | 96 |  |         /// service, this value tends to come back as 'succeeded' directly in | 
|  |  | 97 |  |         /// the call to Create Search service. This is because the free service | 
|  |  | 98 |  |         /// uses capacity that is already set up. Possible values include: | 
|  |  | 99 |  |         /// 'succeeded', 'provisioning', 'failed'</param> | 
|  |  | 100 |  |         /// <param name="networkRuleSet">Network specific rules that determine | 
|  |  | 101 |  |         /// how the Azure Cognitive Search service may be reached.</param> | 
|  |  | 102 |  |         /// <param name="privateEndpointConnections">The list of private | 
|  |  | 103 |  |         /// endpoint connections to the Azure Cognitive Search service.</param> | 
|  |  | 104 |  |         /// <param name="sharedPrivateLinkResources">The list of shared private | 
|  |  | 105 |  |         /// link resources managed by the Azure Cognitive Search | 
|  |  | 106 |  |         /// service.</param> | 
|  |  | 107 |  |         /// <param name="sku">The SKU of the Search Service, which determines | 
|  |  | 108 |  |         /// price tier and capacity limits. This property is required when | 
|  |  | 109 |  |         /// creating a new Search Service.</param> | 
|  |  | 110 |  |         public SearchService(string id = default(string), string name = default(string), string type = default(string),  | 
|  | 0 | 111 |  |             : base(id, name, type, location, tags, identity) | 
|  |  | 112 |  |         { | 
|  | 0 | 113 |  |             ReplicaCount = replicaCount; | 
|  | 0 | 114 |  |             PartitionCount = partitionCount; | 
|  | 0 | 115 |  |             HostingMode = hostingMode; | 
|  | 0 | 116 |  |             PublicNetworkAccess = publicNetworkAccess; | 
|  | 0 | 117 |  |             Status = status; | 
|  | 0 | 118 |  |             StatusDetails = statusDetails; | 
|  | 0 | 119 |  |             ProvisioningState = provisioningState; | 
|  | 0 | 120 |  |             NetworkRuleSet = networkRuleSet; | 
|  | 0 | 121 |  |             PrivateEndpointConnections = privateEndpointConnections; | 
|  | 0 | 122 |  |             SharedPrivateLinkResources = sharedPrivateLinkResources; | 
|  | 0 | 123 |  |             Sku = sku; | 
|  |  | 124 |  |             CustomInit(); | 
|  | 0 | 125 |  |         } | 
|  |  | 126 |  |  | 
|  |  | 127 |  |         /// <summary> | 
|  |  | 128 |  |         /// An initialization method that performs custom operations like setting defaults | 
|  |  | 129 |  |         /// </summary> | 
|  |  | 130 |  |         partial void CustomInit(); | 
|  |  | 131 |  |  | 
|  |  | 132 |  |         /// <summary> | 
|  |  | 133 |  |         /// Gets or sets the number of replicas in the Search service. If | 
|  |  | 134 |  |         /// specified, it must be a value between 1 and 12 inclusive for | 
|  |  | 135 |  |         /// standard SKUs or between 1 and 3 inclusive for basic SKU. | 
|  |  | 136 |  |         /// </summary> | 
|  |  | 137 |  |         [JsonProperty(PropertyName = "properties.replicaCount")] | 
|  | 2408 | 138 |  |         public int? ReplicaCount { get; set; } | 
|  |  | 139 |  |  | 
|  |  | 140 |  |         /// <summary> | 
|  |  | 141 |  |         /// Gets or sets the number of partitions in the Search service; if | 
|  |  | 142 |  |         /// specified, it can be 1, 2, 3, 4, 6, or 12. Values greater than 1 | 
|  |  | 143 |  |         /// are only valid for standard SKUs. For 'standard3' services with | 
|  |  | 144 |  |         /// hostingMode set to 'highDensity', the allowed values are between 1 | 
|  |  | 145 |  |         /// and 3. | 
|  |  | 146 |  |         /// </summary> | 
|  |  | 147 |  |         [JsonProperty(PropertyName = "properties.partitionCount")] | 
|  | 2408 | 148 |  |         public int? PartitionCount { get; set; } | 
|  |  | 149 |  |  | 
|  |  | 150 |  |         /// <summary> | 
|  |  | 151 |  |         /// Gets or sets applicable only for the standard3 SKU. You can set | 
|  |  | 152 |  |         /// this property to enable up to 3 high density partitions that allow | 
|  |  | 153 |  |         /// up to 1000 indexes, which is much higher than the maximum indexes | 
|  |  | 154 |  |         /// allowed for any other SKU. For the standard3 SKU, the value is | 
|  |  | 155 |  |         /// either 'default' or 'highDensity'. For all other SKUs, this value | 
|  |  | 156 |  |         /// must be 'default'. Possible values include: 'default', | 
|  |  | 157 |  |         /// 'highDensity' | 
|  |  | 158 |  |         /// </summary> | 
|  |  | 159 |  |         [JsonProperty(PropertyName = "properties.hostingMode")] | 
|  | 1204 | 160 |  |         public HostingMode? HostingMode { get; set; } | 
|  |  | 161 |  |  | 
|  |  | 162 |  |         /// <summary> | 
|  |  | 163 |  |         /// Gets or sets this value can be set to 'enabled' to avoid breaking | 
|  |  | 164 |  |         /// changes on existing customer resources and templates. If set to | 
|  |  | 165 |  |         /// 'disabled', traffic over public interface is not allowed, and | 
|  |  | 166 |  |         /// private endpoint connections would be the exclusive access method. | 
|  |  | 167 |  |         /// Possible values include: 'enabled', 'disabled' | 
|  |  | 168 |  |         /// </summary> | 
|  |  | 169 |  |         [JsonProperty(PropertyName = "properties.publicNetworkAccess")] | 
|  | 1204 | 170 |  |         public PublicNetworkAccess? PublicNetworkAccess { get; set; } | 
|  |  | 171 |  |  | 
|  |  | 172 |  |         /// <summary> | 
|  |  | 173 |  |         /// Gets the status of the Search service. Possible values include: | 
|  |  | 174 |  |         /// 'running': The Search service is running and no provisioning | 
|  |  | 175 |  |         /// operations are underway. 'provisioning': The Search service is | 
|  |  | 176 |  |         /// being provisioned or scaled up or down. 'deleting': The Search | 
|  |  | 177 |  |         /// service is being deleted. 'degraded': The Search service is | 
|  |  | 178 |  |         /// degraded. This can occur when the underlying search units are not | 
|  |  | 179 |  |         /// healthy. The Search service is most likely operational, but | 
|  |  | 180 |  |         /// performance might be slow and some requests might be dropped. | 
|  |  | 181 |  |         /// 'disabled': The Search service is disabled. In this state, the | 
|  |  | 182 |  |         /// service will reject all API requests. 'error': The Search service | 
|  |  | 183 |  |         /// is in an error state. If your service is in the degraded, disabled, | 
|  |  | 184 |  |         /// or error states, it means the Azure Cognitive Search team is | 
|  |  | 185 |  |         /// actively investigating the underlying issue. Dedicated services in | 
|  |  | 186 |  |         /// these states are still chargeable based on the number of search | 
|  |  | 187 |  |         /// units provisioned. Possible values include: 'running', | 
|  |  | 188 |  |         /// 'provisioning', 'deleting', 'degraded', 'disabled', 'error' | 
|  |  | 189 |  |         /// </summary> | 
|  |  | 190 |  |         [JsonProperty(PropertyName = "properties.status")] | 
|  | 1204 | 191 |  |         public SearchServiceStatus? Status { get; private set; } | 
|  |  | 192 |  |  | 
|  |  | 193 |  |         /// <summary> | 
|  |  | 194 |  |         /// Gets the details of the Search service status. | 
|  |  | 195 |  |         /// </summary> | 
|  |  | 196 |  |         [JsonProperty(PropertyName = "properties.statusDetails")] | 
|  | 1204 | 197 |  |         public string StatusDetails { get; private set; } | 
|  |  | 198 |  |  | 
|  |  | 199 |  |         /// <summary> | 
|  |  | 200 |  |         /// Gets the state of the last provisioning operation performed on the | 
|  |  | 201 |  |         /// Search service. Provisioning is an intermediate state that occurs | 
|  |  | 202 |  |         /// while service capacity is being established. After capacity is set | 
|  |  | 203 |  |         /// up, provisioningState changes to either 'succeeded' or 'failed'. | 
|  |  | 204 |  |         /// Client applications can poll provisioning status (the recommended | 
|  |  | 205 |  |         /// polling interval is from 30 seconds to one minute) by using the Get | 
|  |  | 206 |  |         /// Search Service operation to see when an operation is completed. If | 
|  |  | 207 |  |         /// you are using the free service, this value tends to come back as | 
|  |  | 208 |  |         /// 'succeeded' directly in the call to Create Search service. This is | 
|  |  | 209 |  |         /// because the free service uses capacity that is already set up. | 
|  |  | 210 |  |         /// Possible values include: 'succeeded', 'provisioning', 'failed' | 
|  |  | 211 |  |         /// </summary> | 
|  |  | 212 |  |         [JsonProperty(PropertyName = "properties.provisioningState")] | 
|  | 1204 | 213 |  |         public ProvisioningState? ProvisioningState { get; private set; } | 
|  |  | 214 |  |  | 
|  |  | 215 |  |         /// <summary> | 
|  |  | 216 |  |         /// Gets or sets network specific rules that determine how the Azure | 
|  |  | 217 |  |         /// Cognitive Search service may be reached. | 
|  |  | 218 |  |         /// </summary> | 
|  |  | 219 |  |         [JsonProperty(PropertyName = "properties.networkRuleSet")] | 
|  | 1204 | 220 |  |         public NetworkRuleSet NetworkRuleSet { get; set; } | 
|  |  | 221 |  |  | 
|  |  | 222 |  |         /// <summary> | 
|  |  | 223 |  |         /// Gets the list of private endpoint connections to the Azure | 
|  |  | 224 |  |         /// Cognitive Search service. | 
|  |  | 225 |  |         /// </summary> | 
|  |  | 226 |  |         [JsonProperty(PropertyName = "properties.privateEndpointConnections")] | 
|  | 1204 | 227 |  |         public IList<PrivateEndpointConnection> PrivateEndpointConnections { get; private set; } | 
|  |  | 228 |  |  | 
|  |  | 229 |  |         /// <summary> | 
|  |  | 230 |  |         /// Gets the list of shared private link resources managed by the Azure | 
|  |  | 231 |  |         /// Cognitive Search service. | 
|  |  | 232 |  |         /// </summary> | 
|  |  | 233 |  |         [JsonProperty(PropertyName = "properties.sharedPrivateLinkResources")] | 
|  | 1204 | 234 |  |         public IList<SharedPrivateLinkResource> SharedPrivateLinkResources { get; private set; } | 
|  |  | 235 |  |  | 
|  |  | 236 |  |         /// <summary> | 
|  |  | 237 |  |         /// Gets or sets the SKU of the Search Service, which determines price | 
|  |  | 238 |  |         /// tier and capacity limits. This property is required when creating a | 
|  |  | 239 |  |         /// new Search Service. | 
|  |  | 240 |  |         /// </summary> | 
|  |  | 241 |  |         [JsonProperty(PropertyName = "sku")] | 
|  | 1806 | 242 |  |         public Sku Sku { get; set; } | 
|  |  | 243 |  |  | 
|  |  | 244 |  |         /// <summary> | 
|  |  | 245 |  |         /// Validate the object. | 
|  |  | 246 |  |         /// </summary> | 
|  |  | 247 |  |         /// <exception cref="ValidationException"> | 
|  |  | 248 |  |         /// Thrown if validation fails | 
|  |  | 249 |  |         /// </exception> | 
|  |  | 250 |  |         public override void Validate() | 
|  |  | 251 |  |         { | 
|  | 602 | 252 |  |             base.Validate(); | 
|  | 602 | 253 |  |             if (ReplicaCount > 12) | 
|  |  | 254 |  |             { | 
|  | 0 | 255 |  |                 throw new ValidationException(ValidationRules.InclusiveMaximum, "ReplicaCount", 12); | 
|  |  | 256 |  |             } | 
|  | 602 | 257 |  |             if (ReplicaCount < 1) | 
|  |  | 258 |  |             { | 
|  | 0 | 259 |  |                 throw new ValidationException(ValidationRules.InclusiveMinimum, "ReplicaCount", 1); | 
|  |  | 260 |  |             } | 
|  | 602 | 261 |  |             if (PartitionCount > 12) | 
|  |  | 262 |  |             { | 
|  | 0 | 263 |  |                 throw new ValidationException(ValidationRules.InclusiveMaximum, "PartitionCount", 12); | 
|  |  | 264 |  |             } | 
|  | 602 | 265 |  |             if (PartitionCount < 1) | 
|  |  | 266 |  |             { | 
|  | 0 | 267 |  |                 throw new ValidationException(ValidationRules.InclusiveMinimum, "PartitionCount", 1); | 
|  |  | 268 |  |             } | 
|  | 602 | 269 |  |         } | 
|  |  | 270 |  |     } | 
|  |  | 271 |  | } |