Exemple #1
0
 protected void Initialize()
 {
     ResourcesManagementClient   = GetResourceManagementClient();
     ResourceGroupsOperations    = ResourcesManagementClient.ResourceGroups;
     DeploymentsOperations       = ResourcesManagementClient.Deployments;
     DeploymentScriptsOperations = ResourcesManagementClient.DeploymentScripts;
     DeploymentOperations        = ResourcesManagementClient.Deployment;
     ProvidersOperations         = ResourcesManagementClient.Providers;
     ResourcesOperations         = ResourcesManagementClient.Resources;
     TagsOperations                 = ResourcesManagementClient.Tags;
     SubscriptionsOperations        = ResourcesManagementClient.Subscriptions;
     TenantsOperations              = ResourcesManagementClient.Tenants;
     PolicyAssignmentsOperations    = ResourcesManagementClient.PolicyAssignments;
     PolicyDefinitionsOperations    = ResourcesManagementClient.PolicyDefinitions;
     PolicySetDefinitionsOperations = ResourcesManagementClient.PolicySetDefinitions;
 }
Exemple #2
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     DataPolicyManifests  = new DataPolicyManifestsOperations(this);
     PolicyAssignments    = new PolicyAssignmentsOperations(this);
     PolicyDefinitions    = new PolicyDefinitionsOperations(this);
     PolicySetDefinitions = new PolicySetDefinitionsOperations(this);
     PolicyExemptions     = new PolicyExemptionsOperations(this);
     BaseUri        = new System.Uri("https://management.azure.com");
     AcceptLanguage = "en-US";
     LongRunningOperationRetryTimeout = 30;
     GenerateClientRequestId          = true;
     SerializationSettings            = new JsonSerializerSettings
     {
         Formatting            = Newtonsoft.Json.Formatting.Indented,
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     SerializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings = new JsonSerializerSettings
     {
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     CustomInitialize();
     DeserializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }