Exemplo n.º 1
0
 public HelixApi(Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers)
     : base(handlers)
 {
     HttpClientHandler.SslProtocols = SslProtocols.Tls12;
     BaseUri            = baseUri ?? new Uri("https://helix.dot.net/");
     Credentials        = credentials;
     Aggregate          = new Aggregate(this);
     Analysis           = new Analysis(this);
     Information        = new Information(this);
     Job                = new Job(this);
     Machine            = new Machine(this);
     Repository         = new Repository(this);
     ScaleSets          = new ScaleSets(this);
     Storage            = new Storage(this);
     Telemetry          = new Telemetry(this);
     WorkItem           = new WorkItem(this);
     SerializerSettings = new JsonSerializerSettings
     {
         Converters =
         {
             new StringEnumConverter()
         },
         NullValueHandling = NullValueHandling.Ignore,
     };
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Aggregate             = new Aggregate(this);
     Analysis              = new Analysis(this);
     Information           = new Information(this);
     Job                   = new Job(this);
     Repository            = new Repository(this);
     ScaleSets             = new ScaleSets(this);
     Storage               = new Storage(this);
     Telemetry             = new Telemetry(this);
     WorkItem              = new WorkItem(this);
     BaseUri               = new System.Uri("https://helix.dot.net");
     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()
         }
     };
     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();
 }