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);
            }
        }
 protected void WriteCognitiveServicesAccount(
     CognitiveServicesModels.CognitiveServicesAccount cognitiveServicesAccount)
 {
     if (cognitiveServicesAccount != null)
     {
         WriteObject(PSCognitiveServicesAccount.Create(cognitiveServicesAccount));
     }
 }
 public PSCognitiveServicesAccount(CognitiveServicesModels.CognitiveServicesAccount cognitiveServicesAccount)
 {
     this.ResourceGroupName = ParseResourceGroupFromId(cognitiveServicesAccount.Id);
     this.AccountName       = cognitiveServicesAccount.Name;
     this.Id                = cognitiveServicesAccount.Id;
     this.Endpoint          = cognitiveServicesAccount.Endpoint;
     this.Location          = cognitiveServicesAccount.Location;
     this.Sku               = cognitiveServicesAccount.Sku;
     this.AccountType       = cognitiveServicesAccount.Kind;
     this.Etag              = cognitiveServicesAccount.Etag;
     this.ResourceType      = cognitiveServicesAccount.Type;
     this.ProvisioningState = cognitiveServicesAccount.ProvisioningState;
     this.Tags              = cognitiveServicesAccount.Tags;
 }
Example #4
0
        public PSCognitiveServicesAccount(CognitiveServicesModels.CognitiveServicesAccount cognitiveServicesAccount)
        {
            this.ResourceGroupName = ParseResourceGroupFromId(cognitiveServicesAccount.Id);
            this.AccountName       = cognitiveServicesAccount.Name;
            this.Id           = cognitiveServicesAccount.Id;
            this.Endpoint     = cognitiveServicesAccount.Endpoint;
            this.Location     = cognitiveServicesAccount.Location;
            this.Sku          = cognitiveServicesAccount.Sku;
            this.AccountType  = cognitiveServicesAccount.Kind;
            this.Etag         = cognitiveServicesAccount.Etag;
            this.ResourceType = cognitiveServicesAccount.Type;
#pragma warning disable CS0436 // Type conflicts with imported type
#pragma warning disable CS0618 // Type or member is obsolete
            this.ProvisioningState = (ProvisioningState)Enum.Parse(typeof(ProvisioningState), cognitiveServicesAccount.ProvisioningState);
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CS0436 // Type conflicts with imported type
            this.Tags = cognitiveServicesAccount.Tags;
        }
        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 static PSCognitiveServicesAccount Create(CognitiveServicesModels.CognitiveServicesAccount cognitiveServicesAccount)
        {
            var result = new PSCognitiveServicesAccount(cognitiveServicesAccount);

            return(result);
        }