public PSCognitiveServicesAccount(CognitiveServicesModels.CognitiveServicesAccount cognitiveServicesAccount) { this.ResourceGroupName = ParseResourceGroupFromId(cognitiveServicesAccount.Id); this.AccountName = cognitiveServicesAccount.Name; this.Id = cognitiveServicesAccount.Id; this.Location = cognitiveServicesAccount.Location; this.Sku = cognitiveServicesAccount.Sku; this.AccountType = cognitiveServicesAccount.Kind; this.Etag = cognitiveServicesAccount.Etag; this.ResourceType = cognitiveServicesAccount.Type; this.Tags = cognitiveServicesAccount.Tags; this.Endpoint = cognitiveServicesAccount.Properties.Endpoint; this.ProvisioningState = cognitiveServicesAccount.Properties.ProvisioningState; this.CustomSubDomainName = cognitiveServicesAccount.Properties.CustomSubDomainName; this.Identity = cognitiveServicesAccount.Identity; this.UserOwnedStorage = cognitiveServicesAccount.Properties.UserOwnedStorage; this.Encryption = cognitiveServicesAccount.Properties.Encryption; this.ApiProperties = cognitiveServicesAccount.Properties.ApiProperties; this.PublicNetworkAccess = cognitiveServicesAccount.Properties.PublicNetworkAccess; this.PrivateEndpointConnections = cognitiveServicesAccount.Properties.PrivateEndpointConnections; if (cognitiveServicesAccount.Properties.NetworkAcls != null) { this.NetworkRuleSet = PSNetworkRuleSet.Create(cognitiveServicesAccount.Properties.NetworkAcls); } }
public PSCognitiveServicesAccount(CognitiveServicesModels.CognitiveServicesAccount cognitiveServicesAccount) { this.ResourceGroupName = ParseResourceGroupFromId(cognitiveServicesAccount.Id); this.AccountName = cognitiveServicesAccount.Name; this.Id = cognitiveServicesAccount.Id; this.Endpoint = cognitiveServicesAccount.Properties.Endpoint; this.Location = cognitiveServicesAccount.Location; this.Sku = cognitiveServicesAccount.Sku; this.AccountType = cognitiveServicesAccount.Kind; this.Etag = cognitiveServicesAccount.Etag; this.ResourceType = cognitiveServicesAccount.Type; this.ProvisioningState = cognitiveServicesAccount.Properties.ProvisioningState; this.Tags = cognitiveServicesAccount.Tags; this.CustomSubDomainName = cognitiveServicesAccount.Properties.CustomSubDomainName; if (cognitiveServicesAccount.Properties.NetworkAcls != null) { this.NetworkRuleSet = PSNetworkRuleSet.Create(cognitiveServicesAccount.Properties.NetworkAcls); } }
public PSCognitiveServicesAccount(Account cognitiveServicesAccount) { this.ResourceGroupName = ParseResourceGroupFromId(cognitiveServicesAccount.Id); this.AccountName = cognitiveServicesAccount.Name; this.Id = cognitiveServicesAccount.Id; this.Location = cognitiveServicesAccount.Location; this.Sku = cognitiveServicesAccount.Sku; this.AccountType = cognitiveServicesAccount.Kind; this.Etag = cognitiveServicesAccount.Etag; this.ResourceType = cognitiveServicesAccount.Type; this.Tags = cognitiveServicesAccount.Tags; // Properties aliases this.CustomSubDomainName = cognitiveServicesAccount.Properties.CustomSubDomainName; this.Identity = cognitiveServicesAccount.Identity; this.UserOwnedStorage = cognitiveServicesAccount.Properties.UserOwnedStorage; this.Encryption = cognitiveServicesAccount.Properties.Encryption; this.ApiProperties = CognitiveServicesAccountApiProperties.Parse(cognitiveServicesAccount.Properties.ApiProperties); this.PublicNetworkAccess = cognitiveServicesAccount.Properties.PublicNetworkAccess; this.DisableLocalAuth = cognitiveServicesAccount.Properties.DisableLocalAuth; this.RestrictOutboundNetworkAccess = cognitiveServicesAccount.Properties.RestrictOutboundNetworkAccess; this.AllowedFqdnList = cognitiveServicesAccount.Properties.AllowedFqdnList; // other properties this.Properties = cognitiveServicesAccount.Properties; // Read-only properties, should not add more as they can be retrived from properties this.PrivateEndpointConnections = cognitiveServicesAccount.Properties.PrivateEndpointConnections; this.Capabilities = cognitiveServicesAccount.Properties.Capabilities; this.Endpoint = cognitiveServicesAccount.Properties.Endpoint; this.ProvisioningState = cognitiveServicesAccount.Properties.ProvisioningState; if (cognitiveServicesAccount.Properties.NetworkAcls != null) { this.NetworkRuleSet = PSNetworkRuleSet.Create(cognitiveServicesAccount.Properties.NetworkAcls); } }