Example #1
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Assets                = new Assets(this);
     Builds                = new Builds(this);
     Channels              = new Channels(this);
     DefaultChannels       = new DefaultChannels(this);
     Subscriptions         = new Subscriptions(this);
     BaseUri               = new System.Uri("https://localhost:4430");
     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();
 }
Example #2
0
 public MaestroApi(Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers)
     : base(handlers)
 {
     HttpClientHandler.SslProtocols = SslProtocols.Tls12;
     BaseUri            = baseUri ?? new Uri("https://localhost:4430/");
     Credentials        = credentials;
     Assets             = new Assets(this);
     Builds             = new Builds(this);
     Channels           = new Channels(this);
     DefaultChannels    = new DefaultChannels(this);
     Pipelines          = new Pipelines(this);
     Repository         = new Repository(this);
     Subscriptions      = new Subscriptions(this);
     SerializerSettings = new JsonSerializerSettings
     {
         Converters =
         {
             new StringEnumConverter()
         },
         NullValueHandling = NullValueHandling.Ignore,
     };
 }