internal AppServicePlanData(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, IDictionary <string, string> tags, AzureLocation location, string kind, SkuDescription sku, ExtendedLocation extendedLocation, string workerTierName, StatusOptions?status, string subscription, HostingEnvironmentProfile hostingEnvironmentProfile, int?maximumNumberOfWorkers, string geoRegion, bool?perSiteScaling, bool?elasticScaleEnabled, int?maximumElasticWorkerCount, int?numberOfSites, bool?isSpot, DateTimeOffset?spotExpirationTime, DateTimeOffset?freeOfferExpirationTime, string resourceGroup, bool?reserved, bool?isXenon, bool?hyperV, int?targetWorkerCount, int?targetWorkerSizeId, ProvisioningState?provisioningState, KubeEnvironmentProfile kubeEnvironmentProfile, bool?zoneRedundant) : base(id, name, type, systemData, tags, location, kind) { Sku = sku; ExtendedLocation = extendedLocation; WorkerTierName = workerTierName; Status = status; Subscription = subscription; HostingEnvironmentProfile = hostingEnvironmentProfile; MaximumNumberOfWorkers = maximumNumberOfWorkers; GeoRegion = geoRegion; PerSiteScaling = perSiteScaling; ElasticScaleEnabled = elasticScaleEnabled; MaximumElasticWorkerCount = maximumElasticWorkerCount; NumberOfSites = numberOfSites; IsSpot = isSpot; SpotExpirationTime = spotExpirationTime; FreeOfferExpirationTime = freeOfferExpirationTime; ResourceGroup = resourceGroup; Reserved = reserved; IsXenon = isXenon; HyperV = hyperV; TargetWorkerCount = targetWorkerCount; TargetWorkerSizeId = targetWorkerSizeId; ProvisioningState = provisioningState; KubeEnvironmentProfile = kubeEnvironmentProfile; ZoneRedundant = zoneRedundant; }
internal WebSiteData(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, IDictionary <string, string> tags, AzureLocation location, string kind, ManagedServiceIdentity identity, ExtendedLocation extendedLocation, string state, IReadOnlyList <string> hostNames, string repositorySiteName, UsageState?usageState, bool?enabled, IReadOnlyList <string> enabledHostNames, SiteAvailabilityState?availabilityState, IList <HostNameSslState> hostNameSslStates, string serverFarmId, bool?reserved, bool?isXenon, bool?hyperV, DateTimeOffset?lastModifiedTimeUtc, SiteConfigProperties siteConfig, IReadOnlyList <string> trafficManagerHostNames, bool?scmSiteAlsoStopped, string targetSwapSlot, HostingEnvironmentProfile hostingEnvironmentProfile, bool?clientAffinityEnabled, bool?clientCertEnabled, ClientCertMode?clientCertMode, string clientCertExclusionPaths, bool?hostNamesDisabled, string customDomainVerificationId, string outboundIpAddresses, string possibleOutboundIpAddresses, int?containerSize, int?dailyMemoryTimeQuota, DateTimeOffset?suspendedTill, int?maxNumberOfWorkers, CloningInfo cloningInfo, string resourceGroup, bool?isDefaultContainer, string defaultHostName, SlotSwapStatus slotSwapStatus, bool?httpsOnly, RedundancyMode?redundancyMode, Guid?inProgressOperationId, bool?storageAccountRequired, string keyVaultReferenceIdentity, string virtualNetworkSubnetId) : base(id, name, type, systemData, tags, location, kind) { Identity = identity; ExtendedLocation = extendedLocation; State = state; HostNames = hostNames; RepositorySiteName = repositorySiteName; UsageState = usageState; Enabled = enabled; EnabledHostNames = enabledHostNames; AvailabilityState = availabilityState; HostNameSslStates = hostNameSslStates; ServerFarmId = serverFarmId; Reserved = reserved; IsXenon = isXenon; HyperV = hyperV; LastModifiedTimeUtc = lastModifiedTimeUtc; SiteConfig = siteConfig; TrafficManagerHostNames = trafficManagerHostNames; ScmSiteAlsoStopped = scmSiteAlsoStopped; TargetSwapSlot = targetSwapSlot; HostingEnvironmentProfile = hostingEnvironmentProfile; ClientAffinityEnabled = clientAffinityEnabled; ClientCertEnabled = clientCertEnabled; ClientCertMode = clientCertMode; ClientCertExclusionPaths = clientCertExclusionPaths; HostNamesDisabled = hostNamesDisabled; CustomDomainVerificationId = customDomainVerificationId; OutboundIpAddresses = outboundIpAddresses; PossibleOutboundIpAddresses = possibleOutboundIpAddresses; ContainerSize = containerSize; DailyMemoryTimeQuota = dailyMemoryTimeQuota; SuspendedTill = suspendedTill; MaxNumberOfWorkers = maxNumberOfWorkers; CloningInfo = cloningInfo; ResourceGroup = resourceGroup; IsDefaultContainer = isDefaultContainer; DefaultHostName = defaultHostName; SlotSwapStatus = slotSwapStatus; HttpsOnly = httpsOnly; RedundancyMode = redundancyMode; InProgressOperationId = inProgressOperationId; StorageAccountRequired = storageAccountRequired; KeyVaultReferenceIdentity = keyVaultReferenceIdentity; VirtualNetworkSubnetId = virtualNetworkSubnetId; }
internal static string CreateSlotCloneDeploymentTemplate(string location, string serverFarmId, string destinationWebAppName, string sourceWebAppId, string[] slotNames, HostingEnvironmentProfile hostingProfile, string apiVersion) { var template = new DeploymentTemplate { ContentVersion = ContentVersion, Schema = "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", Variables = new Dictionary<string, object> { { "slotNames", slotNames }, { "webAppName", destinationWebAppName }, { "sourceWebAppId", sourceWebAppId } }, Resources = new WebAppResource[] { new WebAppResource { Type = WebAppSlotResourceType, ApiVersion = apiVersion, Location = location, Name = WebAppSlotName, Properties = new WebAppProperties { CloningInfo = new CloningInfo { SourceWebAppId = SourceWebAppSlotId }, ServerFarmId = serverFarmId, HostingEnvironmentProfile = hostingProfile }, Copy = new CopyFunction { Name = "SlotCopy", Count = WebAppSlotCount } } } }; return template.ToJsonString(); }
internal CertificateData(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, IDictionary <string, string> tags, AzureLocation location, string kind, string password, string friendlyName, string subjectName, IList <string> hostNames, byte[] pfxBlob, string siteName, string selfLink, string issuer, DateTimeOffset?issueDate, DateTimeOffset?expirationDate, string thumbprint, bool?valid, byte[] cerBlob, string publicKeyHash, HostingEnvironmentProfile hostingEnvironmentProfile, string keyVaultId, string keyVaultSecretName, KeyVaultSecretStatus?keyVaultSecretStatus, string serverFarmId, string canonicalName, string domainValidationMethod) : base(id, name, type, systemData, tags, location, kind) { Password = password; FriendlyName = friendlyName; SubjectName = subjectName; HostNames = hostNames; PfxBlob = pfxBlob; SiteName = siteName; SelfLink = selfLink; Issuer = issuer; IssueDate = issueDate; ExpirationDate = expirationDate; Thumbprint = thumbprint; Valid = valid; CerBlob = cerBlob; PublicKeyHash = publicKeyHash; HostingEnvironmentProfile = hostingEnvironmentProfile; KeyVaultId = keyVaultId; KeyVaultSecretName = keyVaultSecretName; KeyVaultSecretStatus = keyVaultSecretStatus; ServerFarmId = serverFarmId; CanonicalName = canonicalName; DomainValidationMethod = domainValidationMethod; }
internal static WebSiteData DeserializeWebSiteData(JsonElement element) { Optional <ManagedServiceIdentity> identity = default; Optional <ExtendedLocation> extendedLocation = default; Optional <string> kind = default; IDictionary <string, string> tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; Optional <string> state = default; Optional <IReadOnlyList <string> > hostNames = default; Optional <string> repositorySiteName = default; Optional <UsageState> usageState = default; Optional <bool> enabled = default; Optional <IReadOnlyList <string> > enabledHostNames = default; Optional <SiteAvailabilityState> availabilityState = default; Optional <IList <HostNameSslState> > hostNameSslStates = default; Optional <string> serverFarmId = default; Optional <bool> reserved = default; Optional <bool> isXenon = default; Optional <bool> hyperV = default; Optional <DateTimeOffset> lastModifiedTimeUtc = default; Optional <SiteConfigProperties> siteConfig = default; Optional <IReadOnlyList <string> > trafficManagerHostNames = default; Optional <bool> scmSiteAlsoStopped = default; Optional <string> targetSwapSlot = default; Optional <HostingEnvironmentProfile> hostingEnvironmentProfile = default; Optional <bool> clientAffinityEnabled = default; Optional <bool> clientCertEnabled = default; Optional <ClientCertMode> clientCertMode = default; Optional <string> clientCertExclusionPaths = default; Optional <bool> hostNamesDisabled = default; Optional <string> customDomainVerificationId = default; Optional <string> outboundIpAddresses = default; Optional <string> possibleOutboundIpAddresses = default; Optional <int> containerSize = default; Optional <int> dailyMemoryTimeQuota = default; Optional <DateTimeOffset?> suspendedTill = default; Optional <int?> maxNumberOfWorkers = default; Optional <CloningInfo> cloningInfo = default; Optional <string> resourceGroup = default; Optional <bool> isDefaultContainer = default; Optional <string> defaultHostName = default; Optional <SlotSwapStatus> slotSwapStatus = default; Optional <bool> httpsOnly = default; Optional <RedundancyMode> redundancyMode = default; Optional <Guid?> inProgressOperationId = default; Optional <bool> storageAccountRequired = default; Optional <string> keyVaultReferenceIdentity = default; Optional <string> virtualNetworkSubnetId = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("identity")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } identity = JsonSerializer.Deserialize <ManagedServiceIdentity>(property.Value.ToString()); continue; } if (property.NameEquals("extendedLocation")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } extendedLocation = ExtendedLocation.DeserializeExtendedLocation(property.Value); continue; } if (property.NameEquals("kind")) { kind = property.Value.GetString(); continue; } if (property.NameEquals("tags")) { Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { dictionary.Add(property0.Name, property0.Value.GetString()); } tags = dictionary; continue; } if (property.NameEquals("location")) { location = property.Value.GetString(); continue; } if (property.NameEquals("id")) { id = new ResourceIdentifier(property.Value.GetString()); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("type")) { type = property.Value.GetString(); continue; } if (property.NameEquals("systemData")) { systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString()); continue; } if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("state")) { state = property0.Value.GetString(); continue; } if (property0.NameEquals("hostNames")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } List <string> array = new List <string>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(item.GetString()); } hostNames = array; continue; } if (property0.NameEquals("repositorySiteName")) { repositorySiteName = property0.Value.GetString(); continue; } if (property0.NameEquals("usageState")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } usageState = property0.Value.GetString().ToUsageState(); continue; } if (property0.NameEquals("enabled")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } enabled = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("enabledHostNames")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } List <string> array = new List <string>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(item.GetString()); } enabledHostNames = array; continue; } if (property0.NameEquals("availabilityState")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } availabilityState = property0.Value.GetString().ToSiteAvailabilityState(); continue; } if (property0.NameEquals("hostNameSslStates")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } List <HostNameSslState> array = new List <HostNameSslState>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(HostNameSslState.DeserializeHostNameSslState(item)); } hostNameSslStates = array; continue; } if (property0.NameEquals("serverFarmId")) { serverFarmId = property0.Value.GetString(); continue; } if (property0.NameEquals("reserved")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } reserved = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("isXenon")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } isXenon = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("hyperV")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } hyperV = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("lastModifiedTimeUtc")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } lastModifiedTimeUtc = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("siteConfig")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } siteConfig = SiteConfigProperties.DeserializeSiteConfigProperties(property0.Value); continue; } if (property0.NameEquals("trafficManagerHostNames")) { if (property0.Value.ValueKind == JsonValueKind.Null) { trafficManagerHostNames = null; continue; } List <string> array = new List <string>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(item.GetString()); } trafficManagerHostNames = array; continue; } if (property0.NameEquals("scmSiteAlsoStopped")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } scmSiteAlsoStopped = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("targetSwapSlot")) { targetSwapSlot = property0.Value.GetString(); continue; } if (property0.NameEquals("hostingEnvironmentProfile")) { if (property0.Value.ValueKind == JsonValueKind.Null) { hostingEnvironmentProfile = null; continue; } hostingEnvironmentProfile = HostingEnvironmentProfile.DeserializeHostingEnvironmentProfile(property0.Value); continue; } if (property0.NameEquals("clientAffinityEnabled")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } clientAffinityEnabled = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("clientCertEnabled")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } clientCertEnabled = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("clientCertMode")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } clientCertMode = property0.Value.GetString().ToClientCertMode(); continue; } if (property0.NameEquals("clientCertExclusionPaths")) { clientCertExclusionPaths = property0.Value.GetString(); continue; } if (property0.NameEquals("hostNamesDisabled")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } hostNamesDisabled = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("customDomainVerificationId")) { customDomainVerificationId = property0.Value.GetString(); continue; } if (property0.NameEquals("outboundIpAddresses")) { outboundIpAddresses = property0.Value.GetString(); continue; } if (property0.NameEquals("possibleOutboundIpAddresses")) { possibleOutboundIpAddresses = property0.Value.GetString(); continue; } if (property0.NameEquals("containerSize")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } containerSize = property0.Value.GetInt32(); continue; } if (property0.NameEquals("dailyMemoryTimeQuota")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } dailyMemoryTimeQuota = property0.Value.GetInt32(); continue; } if (property0.NameEquals("suspendedTill")) { if (property0.Value.ValueKind == JsonValueKind.Null) { suspendedTill = null; continue; } suspendedTill = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("maxNumberOfWorkers")) { if (property0.Value.ValueKind == JsonValueKind.Null) { maxNumberOfWorkers = null; continue; } maxNumberOfWorkers = property0.Value.GetInt32(); continue; } if (property0.NameEquals("cloningInfo")) { if (property0.Value.ValueKind == JsonValueKind.Null) { cloningInfo = null; continue; } cloningInfo = CloningInfo.DeserializeCloningInfo(property0.Value); continue; } if (property0.NameEquals("resourceGroup")) { resourceGroup = property0.Value.GetString(); continue; } if (property0.NameEquals("isDefaultContainer")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } isDefaultContainer = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("defaultHostName")) { defaultHostName = property0.Value.GetString(); continue; } if (property0.NameEquals("slotSwapStatus")) { if (property0.Value.ValueKind == JsonValueKind.Null) { slotSwapStatus = null; continue; } slotSwapStatus = SlotSwapStatus.DeserializeSlotSwapStatus(property0.Value); continue; } if (property0.NameEquals("httpsOnly")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } httpsOnly = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("redundancyMode")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } redundancyMode = property0.Value.GetString().ToRedundancyMode(); continue; } if (property0.NameEquals("inProgressOperationId")) { if (property0.Value.ValueKind == JsonValueKind.Null) { inProgressOperationId = null; continue; } inProgressOperationId = property0.Value.GetGuid(); continue; } if (property0.NameEquals("storageAccountRequired")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } storageAccountRequired = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("keyVaultReferenceIdentity")) { keyVaultReferenceIdentity = property0.Value.GetString(); continue; } if (property0.NameEquals("virtualNetworkSubnetId")) { virtualNetworkSubnetId = property0.Value.GetString(); continue; } } continue; } } return(new WebSiteData(id, name, type, systemData, tags, location, kind.Value, identity, extendedLocation.Value, state.Value, Optional.ToList(hostNames), repositorySiteName.Value, Optional.ToNullable(usageState), Optional.ToNullable(enabled), Optional.ToList(enabledHostNames), Optional.ToNullable(availabilityState), Optional.ToList(hostNameSslStates), serverFarmId.Value, Optional.ToNullable(reserved), Optional.ToNullable(isXenon), Optional.ToNullable(hyperV), Optional.ToNullable(lastModifiedTimeUtc), siteConfig.Value, Optional.ToList(trafficManagerHostNames), Optional.ToNullable(scmSiteAlsoStopped), targetSwapSlot.Value, hostingEnvironmentProfile.Value, Optional.ToNullable(clientAffinityEnabled), Optional.ToNullable(clientCertEnabled), Optional.ToNullable(clientCertMode), clientCertExclusionPaths.Value, Optional.ToNullable(hostNamesDisabled), customDomainVerificationId.Value, outboundIpAddresses.Value, possibleOutboundIpAddresses.Value, Optional.ToNullable(containerSize), Optional.ToNullable(dailyMemoryTimeQuota), Optional.ToNullable(suspendedTill), Optional.ToNullable(maxNumberOfWorkers), cloningInfo.Value, resourceGroup.Value, Optional.ToNullable(isDefaultContainer), defaultHostName.Value, slotSwapStatus.Value, Optional.ToNullable(httpsOnly), Optional.ToNullable(redundancyMode), Optional.ToNullable(inProgressOperationId), Optional.ToNullable(storageAccountRequired), keyVaultReferenceIdentity.Value, virtualNetworkSubnetId.Value)); }
internal static CertificateData DeserializeCertificateData(JsonElement element) { Optional <string> kind = default; IDictionary <string, string> tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; Optional <string> password = default; Optional <string> friendlyName = default; Optional <string> subjectName = default; Optional <IList <string> > hostNames = default; Optional <byte[]> pfxBlob = default; Optional <string> siteName = default; Optional <string> selfLink = default; Optional <string> issuer = default; Optional <DateTimeOffset> issueDate = default; Optional <DateTimeOffset> expirationDate = default; Optional <string> thumbprint = default; Optional <bool> valid = default; Optional <byte[]> cerBlob = default; Optional <string> publicKeyHash = default; Optional <HostingEnvironmentProfile> hostingEnvironmentProfile = default; Optional <string> keyVaultId = default; Optional <string> keyVaultSecretName = default; Optional <KeyVaultSecretStatus> keyVaultSecretStatus = default; Optional <string> serverFarmId = default; Optional <string> canonicalName = default; Optional <string> domainValidationMethod = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("kind")) { kind = property.Value.GetString(); continue; } if (property.NameEquals("tags")) { Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { dictionary.Add(property0.Name, property0.Value.GetString()); } tags = dictionary; continue; } if (property.NameEquals("location")) { location = new AzureLocation(property.Value.GetString()); continue; } if (property.NameEquals("id")) { id = new ResourceIdentifier(property.Value.GetString()); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("type")) { type = new ResourceType(property.Value.GetString()); continue; } if (property.NameEquals("systemData")) { systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString()); continue; } if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("password")) { password = property0.Value.GetString(); continue; } if (property0.NameEquals("friendlyName")) { friendlyName = property0.Value.GetString(); continue; } if (property0.NameEquals("subjectName")) { subjectName = property0.Value.GetString(); continue; } if (property0.NameEquals("hostNames")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } List <string> array = new List <string>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(item.GetString()); } hostNames = array; continue; } if (property0.NameEquals("pfxBlob")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } pfxBlob = property0.Value.GetBytesFromBase64("D"); continue; } if (property0.NameEquals("siteName")) { siteName = property0.Value.GetString(); continue; } if (property0.NameEquals("selfLink")) { selfLink = property0.Value.GetString(); continue; } if (property0.NameEquals("issuer")) { issuer = property0.Value.GetString(); continue; } if (property0.NameEquals("issueDate")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } issueDate = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("expirationDate")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } expirationDate = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("thumbprint")) { thumbprint = property0.Value.GetString(); continue; } if (property0.NameEquals("valid")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } valid = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("cerBlob")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } cerBlob = property0.Value.GetBytesFromBase64("D"); continue; } if (property0.NameEquals("publicKeyHash")) { publicKeyHash = property0.Value.GetString(); continue; } if (property0.NameEquals("hostingEnvironmentProfile")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } hostingEnvironmentProfile = HostingEnvironmentProfile.DeserializeHostingEnvironmentProfile(property0.Value); continue; } if (property0.NameEquals("keyVaultId")) { keyVaultId = property0.Value.GetString(); continue; } if (property0.NameEquals("keyVaultSecretName")) { keyVaultSecretName = property0.Value.GetString(); continue; } if (property0.NameEquals("keyVaultSecretStatus")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } keyVaultSecretStatus = property0.Value.GetString().ToKeyVaultSecretStatus(); continue; } if (property0.NameEquals("serverFarmId")) { serverFarmId = property0.Value.GetString(); continue; } if (property0.NameEquals("canonicalName")) { canonicalName = property0.Value.GetString(); continue; } if (property0.NameEquals("domainValidationMethod")) { domainValidationMethod = property0.Value.GetString(); continue; } } continue; } } return(new CertificateData(id, name, type, systemData, tags, location, kind.Value, password.Value, friendlyName.Value, subjectName.Value, Optional.ToList(hostNames), pfxBlob.Value, siteName.Value, selfLink.Value, issuer.Value, Optional.ToNullable(issueDate), Optional.ToNullable(expirationDate), thumbprint.Value, Optional.ToNullable(valid), cerBlob.Value, publicKeyHash.Value, hostingEnvironmentProfile.Value, keyVaultId.Value, keyVaultSecretName.Value, Optional.ToNullable(keyVaultSecretStatus), serverFarmId.Value, canonicalName.Value, domainValidationMethod.Value)); }
internal static string CreateSlotCloneDeploymentTemplate(string location, string serverFarmId, string destinationWebAppName, string sourceWebAppId, string[] slotNames, HostingEnvironmentProfile hostingProfile, string apiVersion) { var template = new DeploymentTemplate { ContentVersion = ContentVersion, Schema = "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", Variables = new Dictionary <string, object> { { "slotNames", slotNames }, { "webAppName", destinationWebAppName }, { "sourceWebAppId", sourceWebAppId } }, Resources = new WebAppResource[] { new WebAppResource { Type = WebAppSlotResourceType, ApiVersion = apiVersion, Location = location, Name = WebAppSlotName, Properties = new WebAppProperties { CloningInfo = new CloningInfo { SourceWebAppId = SourceWebAppSlotId }, ServerFarmId = serverFarmId, HostingEnvironmentProfile = hostingProfile }, Copy = new CopyFunction { Name = "SlotCopy", Count = WebAppSlotCount } } } }; return(template.ToJsonString()); }
internal static AppServicePlanData DeserializeAppServicePlanData(JsonElement element) { Optional <SkuDescription> sku = default; Optional <ExtendedLocation> extendedLocation = default; Optional <string> kind = default; IDictionary <string, string> tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; Optional <string> workerTierName = default; Optional <StatusOptions> status = default; Optional <string> subscription = default; Optional <HostingEnvironmentProfile> hostingEnvironmentProfile = default; Optional <int> maximumNumberOfWorkers = default; Optional <string> geoRegion = default; Optional <bool> perSiteScaling = default; Optional <bool> elasticScaleEnabled = default; Optional <int> maximumElasticWorkerCount = default; Optional <int> numberOfSites = default; Optional <bool> isSpot = default; Optional <DateTimeOffset?> spotExpirationTime = default; Optional <DateTimeOffset?> freeOfferExpirationTime = default; Optional <string> resourceGroup = default; Optional <bool> reserved = default; Optional <bool> isXenon = default; Optional <bool> hyperV = default; Optional <int> targetWorkerCount = default; Optional <int> targetWorkerSizeId = default; Optional <ProvisioningState> provisioningState = default; Optional <KubeEnvironmentProfile> kubeEnvironmentProfile = default; Optional <bool> zoneRedundant = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("sku")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } sku = SkuDescription.DeserializeSkuDescription(property.Value); continue; } if (property.NameEquals("extendedLocation")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } extendedLocation = ExtendedLocation.DeserializeExtendedLocation(property.Value); continue; } if (property.NameEquals("kind")) { kind = property.Value.GetString(); continue; } if (property.NameEquals("tags")) { Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { dictionary.Add(property0.Name, property0.Value.GetString()); } tags = dictionary; continue; } if (property.NameEquals("location")) { location = property.Value.GetString(); continue; } if (property.NameEquals("id")) { id = new ResourceIdentifier(property.Value.GetString()); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("type")) { type = property.Value.GetString(); continue; } if (property.NameEquals("systemData")) { systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString()); continue; } if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("workerTierName")) { workerTierName = property0.Value.GetString(); continue; } if (property0.NameEquals("status")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } status = property0.Value.GetString().ToStatusOptions(); continue; } if (property0.NameEquals("subscription")) { subscription = property0.Value.GetString(); continue; } if (property0.NameEquals("hostingEnvironmentProfile")) { if (property0.Value.ValueKind == JsonValueKind.Null) { hostingEnvironmentProfile = null; continue; } hostingEnvironmentProfile = HostingEnvironmentProfile.DeserializeHostingEnvironmentProfile(property0.Value); continue; } if (property0.NameEquals("maximumNumberOfWorkers")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } maximumNumberOfWorkers = property0.Value.GetInt32(); continue; } if (property0.NameEquals("geoRegion")) { geoRegion = property0.Value.GetString(); continue; } if (property0.NameEquals("perSiteScaling")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } perSiteScaling = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("elasticScaleEnabled")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } elasticScaleEnabled = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("maximumElasticWorkerCount")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } maximumElasticWorkerCount = property0.Value.GetInt32(); continue; } if (property0.NameEquals("numberOfSites")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } numberOfSites = property0.Value.GetInt32(); continue; } if (property0.NameEquals("isSpot")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } isSpot = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("spotExpirationTime")) { if (property0.Value.ValueKind == JsonValueKind.Null) { spotExpirationTime = null; continue; } spotExpirationTime = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("freeOfferExpirationTime")) { if (property0.Value.ValueKind == JsonValueKind.Null) { freeOfferExpirationTime = null; continue; } freeOfferExpirationTime = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("resourceGroup")) { resourceGroup = property0.Value.GetString(); continue; } if (property0.NameEquals("reserved")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } reserved = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("isXenon")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } isXenon = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("hyperV")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } hyperV = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("targetWorkerCount")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } targetWorkerCount = property0.Value.GetInt32(); continue; } if (property0.NameEquals("targetWorkerSizeId")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } targetWorkerSizeId = property0.Value.GetInt32(); continue; } if (property0.NameEquals("provisioningState")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } provisioningState = property0.Value.GetString().ToProvisioningState(); continue; } if (property0.NameEquals("kubeEnvironmentProfile")) { if (property0.Value.ValueKind == JsonValueKind.Null) { kubeEnvironmentProfile = null; continue; } kubeEnvironmentProfile = KubeEnvironmentProfile.DeserializeKubeEnvironmentProfile(property0.Value); continue; } if (property0.NameEquals("zoneRedundant")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } zoneRedundant = property0.Value.GetBoolean(); continue; } } continue; } } return(new AppServicePlanData(id, name, type, systemData, tags, location, kind.Value, sku.Value, extendedLocation.Value, workerTierName.Value, Optional.ToNullable(status), subscription.Value, hostingEnvironmentProfile.Value, Optional.ToNullable(maximumNumberOfWorkers), geoRegion.Value, Optional.ToNullable(perSiteScaling), Optional.ToNullable(elasticScaleEnabled), Optional.ToNullable(maximumElasticWorkerCount), Optional.ToNullable(numberOfSites), Optional.ToNullable(isSpot), Optional.ToNullable(spotExpirationTime), Optional.ToNullable(freeOfferExpirationTime), resourceGroup.Value, Optional.ToNullable(reserved), Optional.ToNullable(isXenon), Optional.ToNullable(hyperV), Optional.ToNullable(targetWorkerCount), Optional.ToNullable(targetWorkerSizeId), Optional.ToNullable(provisioningState), kubeEnvironmentProfile.Value, Optional.ToNullable(zoneRedundant))); }
internal static object CreateSlotCloneDeploymentTemplate(string location, string serverFarmId, string destinationWebAppName, string sourceWebAppId, string[] slotNames, HostingEnvironmentProfile hostingProfile, string apiVersion) { var template = new DeploymentTemplate { ContentVersion = ContentVersion, Schema = "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", Parameters = new Dictionary <string, ParameterType> { { "time", new ParameterType { Type = "string", DefaultValue = "[utcNow()]" } } }, Variables = new Dictionary <string, object> { { "slotNames", slotNames }, { "webAppName", destinationWebAppName }, { "sourceWebAppId", sourceWebAppId } }, Resources = new WebAppResource[] { new WebAppResource { Type = WebAppSlotResourceType, ApiVersion = apiVersion, Location = location, Name = WebAppSlotName, Properties = new WebAppProperties { CloningInfo = new WebAppCloningInfo { SourceWebAppId = SourceWebAppSlotId, CorrelationId = "[guid(variables('slotNames')[copyIndex()], parameters('time'))]" }, ServerFarmId = serverFarmId, HostingEnvironmentProfile = hostingProfile }, Copy = new CopyFunction { Name = "SlotCopy", Count = WebAppSlotCount } } } }; return(template); }