Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Subscription"/> class.
 /// </summary>
 /// <param name="clientContext"></param>
 /// <param name="id"> The identifier of the resource that is the target of operations. </param>
 internal Subscription(ClientContext clientContext, ResourceIdentifier id)
     : base(clientContext, id)
 {
     _clientDiagnostics      = new ClientDiagnostics(ClientOptions);
     _restClient             = new SubscriptionsRestOperations(_clientDiagnostics, Pipeline, ClientOptions, BaseUri);
     _featuresRestOperations = new FeaturesRestOperations(_clientDiagnostics, Pipeline, ClientOptions, Id.SubscriptionId, BaseUri);
 }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Feature"/> class.
 /// </summary>
 /// <param name="operations"> The operations to copy the client options from. </param>
 /// <param name="resource"> The FeatureData to use in these operations. </param>
 internal Feature(ArmResource operations, FeatureData resource)
     : base(operations, resource.Id)
 {
     _data              = resource;
     HasData            = true;
     _clientDiagnostics = new ClientDiagnostics(ClientOptions);
     _restClient        = new FeaturesRestOperations(_clientDiagnostics, Pipeline, ClientOptions, Id.SubscriptionId, BaseUri);
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Subscription"/> class.
 /// </summary>
 /// <param name="operations"> The operations object to copy the client parameters from. </param>
 /// <param name="subscriptionData"> The data model representing the generic azure resource. </param>
 internal Subscription(ArmResource operations, SubscriptionData subscriptionData)
     : base(operations, subscriptionData.Id)
 {
     _data                   = subscriptionData;
     HasData                 = true;
     _clientDiagnostics      = new ClientDiagnostics(ClientOptions);
     _restClient             = new SubscriptionsRestOperations(_clientDiagnostics, Pipeline, ClientOptions, BaseUri);
     _featuresRestOperations = new FeaturesRestOperations(_clientDiagnostics, Pipeline, ClientOptions, Id.SubscriptionId, BaseUri);
 }
        internal FeatureResource(ArmClient client, ResourceIdentifier id) : base(client, id)
        {
            _featureClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", ResourceType.Namespace, Diagnostics);
            TryGetApiVersion(ResourceType, out string featureApiVersion);
            _featureRestClient = new FeaturesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, featureApiVersion);
#if DEBUG
            ValidateResourceId(Id);
#endif
        }
Exemple #5
0
        internal FeatureCollection(ArmResource parent) : base(parent)
        {
            _featureClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", Feature.ResourceType.Namespace, DiagnosticOptions);
            ArmClient.TryGetApiVersion(Feature.ResourceType, out string featureApiVersion);
            _featureRestClient = new FeaturesRestOperations(_featureClientDiagnostics, Pipeline, DiagnosticOptions.ApplicationId, BaseUri, featureApiVersion);
#if DEBUG
            ValidateResourceId(Id);
#endif
        }
Exemple #6
0
        internal Subscription(ArmClient armClient, ResourceIdentifier id) : base(armClient, id)
        {
            _subscriptionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", ResourceType.Namespace, DiagnosticOptions);
            ArmClient.TryGetApiVersion(ResourceType, out string subscriptionApiVersion);
            _subscriptionRestClient = new SubscriptionsRestOperations(_subscriptionClientDiagnostics, Pipeline, DiagnosticOptions.ApplicationId, BaseUri, subscriptionApiVersion);
            _subscriptionResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", ResourceType.Namespace, DiagnosticOptions);
            ArmClient.TryGetApiVersion(ResourceType, out string subscriptionResourcesApiVersion);
            _subscriptionResourcesRestClient   = new ResourcesRestOperations(_subscriptionResourcesClientDiagnostics, Pipeline, DiagnosticOptions.ApplicationId, BaseUri, subscriptionResourcesApiVersion);
            _subscriptionTagsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", ResourceType.Namespace, DiagnosticOptions);
            ArmClient.TryGetApiVersion(ResourceType, out string subscriptionTagsApiVersion);
            _subscriptionTagsRestClient    = new TagsRestOperations(_subscriptionTagsClientDiagnostics, Pipeline, DiagnosticOptions.ApplicationId, BaseUri, subscriptionTagsApiVersion);
            _resourceLinkClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", ResourceLink.ResourceType.Namespace, DiagnosticOptions);
            ArmClient.TryGetApiVersion(ResourceLink.ResourceType, out string resourceLinkApiVersion);
            _resourceLinkRestClient   = new ResourceLinksRestOperations(_resourceLinkClientDiagnostics, Pipeline, DiagnosticOptions.ApplicationId, BaseUri, resourceLinkApiVersion);
            _featureClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", Feature.ResourceType.Namespace, DiagnosticOptions);
            ArmClient.TryGetApiVersion(Feature.ResourceType, out string featureApiVersion);
            _featureRestClient = new FeaturesRestOperations(_featureClientDiagnostics, Pipeline, DiagnosticOptions.ApplicationId, BaseUri, featureApiVersion);
#if DEBUG
            ValidateResourceId(Id);
#endif
        }
Exemple #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FeatureContainer"/> class.
 /// </summary>
 /// <param name="parent"> The resource representing the parent resource. </param>
 internal FeatureContainer(ProviderOperations parent)
     : base(parent)
 {
     _clientDiagnostics = new ClientDiagnostics(ClientOptions);
     _restClient        = new FeaturesRestOperations(_clientDiagnostics, Pipeline, Id.SubscriptionId, BaseUri);
 }
 internal FeaturesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null)
 {
     RestClient         = new FeaturesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
     _clientDiagnostics = clientDiagnostics;
     _pipeline          = pipeline;
 }
Exemple #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FeatureOperations"/> class.
 /// </summary>
 /// <param name="options"> The client parameters to use in these operations. </param>
 /// <param name="id"> The id of the feature to use. </param>
 protected FeatureOperations(ResourceOperations options, ResourceIdentifier id)
     : base(options, id)
 {
     _clientDiagnostics = new ClientDiagnostics(ClientOptions);
     _restClient        = new FeaturesRestOperations(_clientDiagnostics, Pipeline, Id.SubscriptionId, BaseUri);
 }
Exemple #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ResourceGroupOperations"/> class.
 /// </summary>
 /// <param name="featureName"> The name of the feature to use. </param>
 /// <param name="options"> The client parameters to use in these operations. </param>
 internal FeatureOperations(string featureName, ProviderOperations options)
     : base(options, options.Id.Parent.AppendProviderResource(options.Id.Provider, ResourceType.Type, featureName))
 {
     _clientDiagnostics = new ClientDiagnostics(ClientOptions);
     _restClient        = new FeaturesRestOperations(_clientDiagnostics, Pipeline, Id.SubscriptionId, BaseUri);
 }