コード例 #1
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Cowbell> GetAsync(this ICowbellOperations operations, string id = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(id, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #2
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Cowbell = new CowbellOperations(this);
     BaseUri = new System.Uri("https://localhost");
     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();
 }
コード例 #3
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// </param>
 public static Cowbell Get(this ICowbellOperations operations, string id = default(string))
 {
     return(operations.GetAsync(id).GetAwaiter().GetResult());
 }
コード例 #4
0
 /// <summary>
 /// A good description.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// </param>
 public static void Add(this ICowbellOperations operations, Cowbell body)
 {
     operations.AddAsync(body).GetAwaiter().GetResult();
 }
コード例 #5
0
 /// <summary>
 /// A good description.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task AddAsync(this ICowbellOperations operations, Cowbell body, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.AddWithHttpMessagesAsync(body, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='name'>
 /// </param>
 /// <param name='idx'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task GetForwardToCustomArgs4Async(this ICowbellOperations operations, string name, long idx, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.GetForwardToCustomArgs4WithHttpMessagesAsync(name, idx, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static void Empty(this ICowbellOperations operations)
 {
     operations.EmptyAsync().GetAwaiter().GetResult();
 }
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='name'>
 /// </param>
 /// <param name='idx'>
 /// </param>
 public static void GetForwardToCustomArgs4(this ICowbellOperations operations, string name, long idx)
 {
     operations.GetForwardToCustomArgs4Async(name, idx).GetAwaiter().GetResult();
 }
 /// <summary>
 /// A swell description.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// </param>
 public static Cowbell Get(this ICowbellOperations operations, long id)
 {
     return(operations.GetAsync(id).GetAwaiter().GetResult());
 }
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static void GetForwardToCustomArgs1(this ICowbellOperations operations)
 {
     operations.GetForwardToCustomArgs1Async().GetAwaiter().GetResult();
 }
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task GetForwardToAsync(this ICowbellOperations operations, long id, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.GetForwardToWithHttpMessagesAsync(id, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// </param>
 public static void GetForwardTo(this ICowbellOperations operations, long id)
 {
     operations.GetForwardToAsync(id).GetAwaiter().GetResult();
 }
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task GetImplementationSpecificAsync(this ICowbellOperations operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.GetImplementationSpecificWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static void GetImplementationSpecific(this ICowbellOperations operations)
 {
     operations.GetImplementationSpecificAsync().GetAwaiter().GetResult();
 }