Пример #1
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Sets                  = new Sets(this);
     Cards                 = new Cards(this);
     Rulings               = new Rulings(this);
     Symbology             = new Symbology(this);
     Catalog               = new CatalogOperations(this);
     BaseUri               = new System.Uri("https://api.scryfall.com");
     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();
 }
Пример #2
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Catalog> GetPlaneswalkerTypesAsync(this ICatalogOperations operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetPlaneswalkerTypesWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the ScryfallClient.
        /// </summary>
        public ScryfallClient() : base("https://api.scryfall.com")
        {
            Sets      = new Sets(this);
            Cards     = new Cards(this);
            Rulings   = new Rulings(this);
            Symbology = new Symbology(this);
            Catalog   = new CatalogOperations(this);

            SerializationSettings = new JsonSerializerSettings {
                Formatting            = Formatting.Indented,
                DateFormatHandling    = DateFormatHandling.IsoDateFormat,
                DateTimeZoneHandling  = DateTimeZoneHandling.Utc,
                NullValueHandling     = NullValueHandling.Ignore,
                ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
                ContractResolver      = new ReadOnlyJsonContractResolver(),
                Converters            = new List <JsonConverter> {
                    new Iso8601TimeSpanConverter()
                }
            };
            DeserializationSettings = new JsonSerializerSettings {
                DateFormatHandling    = DateFormatHandling.IsoDateFormat,
                DateTimeZoneHandling  = DateTimeZoneHandling.Utc,
                NullValueHandling     = NullValueHandling.Ignore,
                ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
                ContractResolver      = new ReadOnlyJsonContractResolver(),
                Converters            = new List <JsonConverter> {
                    new Iso8601TimeSpanConverter()
                }
            };
        }
Пример #4
0
    public static async Task <Page <Catalog> > GetAsync(this ICatalogOperations operations, int?count = null,
                                                        CancellationToken cancellationToken           = default)
    {
        using HttpOperationResponse <Page <Catalog> >?response =
                  await operations.GetWithHttpMessagesAsync(count, cancellationToken).ConfigureAwait(false);

        return(response.Body);
    }
Пример #5
0
    public static async Task <Page <Catalog> > GetNextAsync
        (this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default)
    {
        using HttpOperationResponse <Page <Catalog> > response =
                  await operations.GetNextWithHttpMessagesAsync(nextPageLink, cancellationToken).ConfigureAwait(false);

        return(response.Body);
    }
Пример #6
0
 /// <summary>
 /// Initializes a new instance of the
 /// DataLakeAnalyticsCatalogManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public DataLakeAnalyticsCatalogManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._catalog         = new CatalogOperations(this);
     this._userAgentSuffix = "";
     this._apiVersion      = "2015-10-01-preview";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
Пример #7
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Catalog                          = new CatalogOperations(this);
     BaseUri                          = "https://{accountName}.{adlaCatalogDnsSuffix}";
     ApiVersion                       = "2016-11-01";
     AdlaCatalogDnsSuffix             = "azuredatalakeanalytics.net";
     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()
         }
     };
     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 CloudErrorJsonConverter());
 }
Пример #8
0
 public CatalogController(ICatalogOperations operation, UserManager <User> userManager)
 {
     _operation   = operation;
     _userManager = userManager;
 }
Пример #9
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static Catalog GetPlaneswalkerTypes(this ICatalogOperations operations)
 {
     return(operations.GetPlaneswalkerTypesAsync().GetAwaiter().GetResult());
 }
Пример #10
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static Catalog GetCreatureTypes(this ICatalogOperations operations)
 {
     return(operations.GetCreatureTypesAsync().GetAwaiter().GetResult());
 }
Пример #11
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static Catalog GetWordBank(this ICatalogOperations operations)
 {
     return(operations.GetWordBankAsync().GetAwaiter().GetResult());
 }
Пример #12
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static Catalog GetWatermarks(this ICatalogOperations operations)
 {
     return(operations.GetWatermarksAsync().GetAwaiter().GetResult());
 }
Пример #13
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static Catalog GetLoyalties(this ICatalogOperations operations)
 {
     return(operations.GetLoyaltiesAsync().GetAwaiter().GetResult());
 }
Пример #14
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static Catalog GetEnchantmentTypes(this ICatalogOperations operations)
 {
     return(operations.GetEnchantmentTypesAsync().GetAwaiter().GetResult());
 }