internal ConfigurationStore(ArmResource options, ConfigurationStoreData resource) : base(options, resource.Id)
 {
     HasData                        = true;
     _data                          = resource;
     _clientDiagnostics             = new ClientDiagnostics(ClientOptions);
     _configurationStoresRestClient = new ConfigurationStoresRestOperations(_clientDiagnostics, Pipeline, ClientOptions, BaseUri);
 }
        internal ConfigurationStoreCollection(ArmResource parent) : base(parent)
        {
            _clientDiagnostics             = new ClientDiagnostics(ClientOptions);
            _configurationStoresRestClient = new ConfigurationStoresRestOperations(_clientDiagnostics, Pipeline, ClientOptions, BaseUri);
#if DEBUG
            ValidateResourceId(Id);
#endif
        }
        internal ConfigurationStore(ArmClientOptions clientOptions, TokenCredential credential, Uri uri, HttpPipeline pipeline, ResourceIdentifier id) : base(clientOptions, credential, uri, pipeline, id)
        {
            _clientDiagnostics             = new ClientDiagnostics(ClientOptions);
            _configurationStoresRestClient = new ConfigurationStoresRestOperations(_clientDiagnostics, Pipeline, ClientOptions, BaseUri);
#if DEBUG
            ValidateResourceId(Id);
#endif
        }
        internal ConfigurationStore(ArmResource options, ResourceIdentifier id) : base(options, id)
        {
            _clientDiagnostics             = new ClientDiagnostics(ClientOptions);
            _configurationStoresRestClient = new ConfigurationStoresRestOperations(_clientDiagnostics, Pipeline, ClientOptions, BaseUri);
#if DEBUG
            ValidateResourceId(Id);
#endif
        }
示例#5
0
        internal ConfigurationStore(ArmClient client, ResourceIdentifier id) : base(client, id)
        {
            _configurationStoreClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppConfiguration", ResourceType.Namespace, DiagnosticOptions);
            TryGetApiVersion(ResourceType, out string configurationStoreApiVersion);
            _configurationStoreRestClient = new ConfigurationStoresRestOperations(Pipeline, DiagnosticOptions.ApplicationId, BaseUri, configurationStoreApiVersion);
#if DEBUG
            ValidateResourceId(Id);
#endif
        }
        internal ConfigurationStore(ArmResource options, ResourceIdentifier id) : base(options, id)
        {
            _clientDiagnostics = new ClientDiagnostics(ClientOptions);
            ClientOptions.TryGetApiVersion(ResourceType, out string apiVersion);
            _configurationStoresRestClient = new ConfigurationStoresRestOperations(_clientDiagnostics, Pipeline, ClientOptions, BaseUri, apiVersion);
#if DEBUG
            ValidateResourceId(Id);
#endif
        }
        internal ConfigurationStoreCollection(ArmResource parent) : base(parent)
        {
            _clientDiagnostics = new ClientDiagnostics(ClientOptions);
            ClientOptions.TryGetApiVersion(ConfigurationStore.ResourceType, out string apiVersion);
            _configurationStoresRestClient = new ConfigurationStoresRestOperations(_clientDiagnostics, Pipeline, ClientOptions, BaseUri, apiVersion);
#if DEBUG
            ValidateResourceId(Id);
#endif
        }
示例#8
0
        internal DeletedConfigurationStoreResource(ArmClient client, ResourceIdentifier id) : base(client, id)
        {
            _deletedConfigurationStoreConfigurationStoresClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppConfiguration", ResourceType.Namespace, Diagnostics);
            TryGetApiVersion(ResourceType, out string deletedConfigurationStoreConfigurationStoresApiVersion);
            _deletedConfigurationStoreConfigurationStoresRestClient = new ConfigurationStoresRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deletedConfigurationStoreConfigurationStoresApiVersion);
#if DEBUG
            ValidateResourceId(Id);
#endif
        }
        internal ConfigurationStoreCollection(ArmResource parent) : base(parent)
        {
            _configurationStoreClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppConfiguration", ConfigurationStore.ResourceType.Namespace, DiagnosticOptions);
            ArmClient.TryGetApiVersion(ConfigurationStore.ResourceType, out string configurationStoreApiVersion);
            _configurationStoreRestClient = new ConfigurationStoresRestOperations(_configurationStoreClientDiagnostics, Pipeline, DiagnosticOptions.ApplicationId, BaseUri, configurationStoreApiVersion);
#if DEBUG
            ValidateResourceId(Id);
#endif
        }
示例#10
0
        internal ConfigurationStore(ArmResource options, ConfigurationStoreData data) : base(options, data.Id)
        {
            HasData                        = true;
            _data                          = data;
            _clientDiagnostics             = new ClientDiagnostics(ClientOptions);
            _configurationStoresRestClient = new ConfigurationStoresRestOperations(_clientDiagnostics, Pipeline, ClientOptions, BaseUri);
#if DEBUG
            ValidateResourceId(Id);
#endif
        }
示例#11
0
 public static Pageable <ConfigurationStore> GetConfigurationStores(this Subscription subscription, string skipToken = null, CancellationToken cancellationToken = default)
 {
     return(subscription.UseClientContext((baseUri, credential, options, pipeline) =>
     {
         var clientDiagnostics = new ClientDiagnostics(options);
         options.TryGetApiVersion(ConfigurationStore.ResourceType, out string apiVersion);
         ConfigurationStoresRestOperations restOperations = GetConfigurationStoresRestOperations(clientDiagnostics, pipeline, options, baseUri, apiVersion);
         Page <ConfigurationStore> FirstPageFunc(int?pageSizeHint)
         {
             using var scope = clientDiagnostics.CreateScope("SubscriptionExtensions.GetConfigurationStores");
             scope.Start();
             try
             {
                 var response = restOperations.List(subscription.Id.SubscriptionId, skipToken, cancellationToken: cancellationToken);
                 return Page.FromValues(response.Value.Value.Select(value => new ConfigurationStore(subscription, value)), response.Value.NextLink, response.GetRawResponse());
             }
             catch (Exception e)
             {
                 scope.Failed(e);
                 throw;
             }
         }
         Page <ConfigurationStore> NextPageFunc(string nextLink, int?pageSizeHint)
         {
             using var scope = clientDiagnostics.CreateScope("SubscriptionExtensions.GetConfigurationStores");
             scope.Start();
             try
             {
                 var response = restOperations.ListNextPage(nextLink, subscription.Id.SubscriptionId, skipToken, cancellationToken: cancellationToken);
                 return Page.FromValues(response.Value.Value.Select(value => new ConfigurationStore(subscription, value)), response.Value.NextLink, response.GetRawResponse());
             }
             catch (Exception e)
             {
                 scope.Failed(e);
                 throw;
             }
         }
         return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
     }
                                          ));
 }
示例#12
0
 internal ConfigurationStoresOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2019-11-01-preview")
 {
     RestClient         = new ConfigurationStoresRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion);
     _clientDiagnostics = clientDiagnostics;
     _pipeline          = pipeline;
 }