/// <summary>
 /// Test explicitly required integer. Please put a valid int-wrapper with
 /// 'value' = null and the client library should throw before the request is
 /// sent.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='value'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Error> PostRequiredIntegerPropertyAsync(this IExplicitModel operations, int value, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.PostRequiredIntegerPropertyWithHttpMessagesAsync(value, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Test explicitly required string. Please put a header 'headerParameter'
 /// =&gt; null and the client library should throw before the request is sent.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='headerParameter'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Error> PostRequiredStringHeaderAsync(this IExplicitModel operations, string headerParameter, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.PostRequiredStringHeaderWithHttpMessagesAsync(headerParameter, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     ImplicitModel         = new ImplicitModel(this);
     ExplicitModel         = new ExplicitModel(this);
     BaseUri               = new System.Uri("http://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();
 }
Esempio n. 4
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     this.ImplicitModel    = new ImplicitModel(this);
     this.ExplicitModel    = new ExplicitModel(this);
     this.BaseUri          = new Uri("http://localhost");
     SerializationSettings = new JsonSerializerSettings
     {
         Formatting            = Formatting.Indented,
         DateFormatHandling    = DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = DateTimeZoneHandling.Utc,
         NullValueHandling     = NullValueHandling.Ignore,
         ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver()
     };
     DeserializationSettings = new JsonSerializerSettings {
         DateFormatHandling    = DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = DateTimeZoneHandling.Utc,
         NullValueHandling     = NullValueHandling.Ignore,
         ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver()
     };
 }
 /// <summary>
 /// Test explicitly optional integer. Please put null.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='bodyParameter'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task PostOptionalIntegerParameterAsync(this IExplicitModel operations, int?bodyParameter = default(int?), CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.PostOptionalIntegerParameterWithHttpMessagesAsync(bodyParameter, null, cancellationToken).ConfigureAwait(false);
 }
 /// <summary>
 /// Test explicitly optional integer. Please put a header 'headerParameter'
 /// =&gt; null.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='headerParameter'>
 /// </param>
 public static void PostOptionalArrayHeader(this IExplicitModel operations, IList <string> headerParameter = default(IList <string>))
 {
     Task.Factory.StartNew(s => ((IExplicitModel)s).PostOptionalArrayHeaderAsync(headerParameter), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
 /// <summary>
 /// Test explicitly required array. Please put a header 'headerParameter'
 /// =&gt; null and the client library should throw before the request is sent.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='headerParameter'>
 /// </param>
 public static Error PostRequiredArrayHeader(this IExplicitModel operations, IList <string> headerParameter)
 {
     return(Task.Factory.StartNew(s => ((IExplicitModel)s).PostRequiredArrayHeaderAsync(headerParameter), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Test explicitly optional array. Please put a valid array-wrapper with
 /// 'value' = null.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='bodyParameter'>
 /// </param>
 public static void PostOptionalArrayProperty(this IExplicitModel operations, ArrayOptionalWrapper bodyParameter = default(ArrayOptionalWrapper))
 {
     Task.Factory.StartNew(s => ((IExplicitModel)s).PostOptionalArrayPropertyAsync(bodyParameter), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
 /// <summary>
 /// Test explicitly optional integer. Please put null.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='bodyParameter'>
 /// </param>
 public static void PostOptionalIntegerParameter(this IExplicitModel operations, int?bodyParameter = default(int?))
 {
     Task.Factory.StartNew(s => ((IExplicitModel)s).PostOptionalIntegerParameterAsync(bodyParameter), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
 /// <summary>
 /// Test explicitly optional integer. Please put a header 'headerParameter'
 /// =&gt; null.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='headerParameter'>
 /// </param>
 public static void PostOptionalArrayHeader(this IExplicitModel operations, IList <string> headerParameter = default(IList <string>))
 {
     operations.PostOptionalArrayHeaderAsync(headerParameter).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Test explicitly optional string. Please put a header 'headerParameter'
 /// =&gt; null.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='bodyParameter'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task PostOptionalStringHeaderAsync(this IExplicitModel operations, string bodyParameter = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.PostOptionalStringHeaderWithHttpMessagesAsync(bodyParameter, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Test explicitly optional string. Please put a header 'headerParameter'
 /// =&gt; null.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='bodyParameter'>
 /// </param>
 public static void PostOptionalStringHeader(this IExplicitModel operations, string bodyParameter = default(string))
 {
     operations.PostOptionalStringHeaderAsync(bodyParameter).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Test explicitly optional integer. Please put a valid string-wrapper with
 /// 'value' = null.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='value'>
 /// </param>
 public static void PostOptionalStringProperty(this IExplicitModel operations, string value = default(string))
 {
     operations.PostOptionalStringPropertyAsync(value).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Test explicitly required integer. Please put null and the client library
 /// should throw before the request is sent.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='bodyParameter'>
 /// </param>
 public static Error PostRequiredIntegerParameter(this IExplicitModel operations, int bodyParameter)
 {
     return(operations.PostRequiredIntegerParameterAsync(bodyParameter).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Test explicitly optional integer. Please put a valid int-wrapper with
 /// 'value' = null.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='value'>
 /// </param>
 public static void PostOptionalIntegerProperty(this IExplicitModel operations, int?value = default(int?))
 {
     operations.PostOptionalIntegerPropertyAsync(value).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Test explicitly optional array. Please put a valid array-wrapper with
 /// 'value' = null.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='value'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task PostOptionalArrayPropertyAsync(this IExplicitModel operations, IList <string> value = default(IList <string>), CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.PostOptionalArrayPropertyWithHttpMessagesAsync(value, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Test explicitly required array. Please put a header 'headerParameter' =&gt;
 /// null and the client library should throw before the request is sent.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='headerParameter'>
 /// </param>
 public static Error PostRequiredArrayHeader(this IExplicitModel operations, IList <string> headerParameter)
 {
     return(operations.PostRequiredArrayHeaderAsync(headerParameter).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Test explicitly required complex object. Please put null and the client
 /// library should throw before the request is sent.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='bodyParameter'>
 /// </param>
 public static Error PostRequiredClassParameter(this IExplicitModel operations, Product bodyParameter)
 {
     return(operations.PostRequiredClassParameterAsync(bodyParameter).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Test explicitly required integer. Please put a valid int-wrapper with
 /// 'value' = null and the client library should throw before the request is
 /// sent.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='value'>
 /// </param>
 public static Error PostRequiredIntegerProperty(this IExplicitModel operations, int value)
 {
     return(operations.PostRequiredIntegerPropertyAsync(value).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Test explicitly optional complex object. Please put null.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='bodyParameter'>
 /// </param>
 public static void PostOptionalClassParameter(this IExplicitModel operations, Product bodyParameter = default(Product))
 {
     operations.PostOptionalClassParameterAsync(bodyParameter).GetAwaiter().GetResult();
 }
        /// <summary>
        /// Test explicitly required array. Please put a valid array-wrapper with
        /// 'value' = null and the client library should throw before the request is
        /// sent.
        /// </summary>
        /// <param name='operations'>
        /// The operations group for this extension method.
        /// </param>
        /// <param name='bodyParameter'>
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        public static async Task <Error> PostRequiredArrayPropertyAsync(this IExplicitModel operations, ArrayWrapper bodyParameter, CancellationToken cancellationToken = default(CancellationToken))
        {
            HttpOperationResponse <Error> result = await operations.PostRequiredArrayPropertyWithHttpMessagesAsync(bodyParameter, null, cancellationToken).ConfigureAwait(false);

            return(result.Body);
        }
 /// <summary>
 /// Test explicitly optional complex object. Please put a valid class-wrapper
 /// with 'value' = null.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='value'>
 /// </param>
 public static void PostOptionalClassProperty(this IExplicitModel operations, Product value = default(Product))
 {
     operations.PostOptionalClassPropertyAsync(value).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Test explicitly optional array. Please put a valid array-wrapper with
 /// 'value' = null.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='bodyParameter'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task PostOptionalArrayPropertyAsync(this IExplicitModel operations, ArrayOptionalWrapper bodyParameter = default(ArrayOptionalWrapper), CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.PostOptionalArrayPropertyWithHttpMessagesAsync(bodyParameter, null, cancellationToken).ConfigureAwait(false);
 }
 /// <summary>
 /// Test explicitly optional complex object. Please put a valid class-wrapper
 /// with 'value' = null.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='value'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task PostOptionalClassPropertyAsync(this IExplicitModel operations, Product value = default(Product), CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.PostOptionalClassPropertyWithHttpMessagesAsync(value, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
        /// <summary>
        /// Test explicitly required array. Please put a header 'headerParameter'
        /// =&gt; null and the client library should throw before the request is sent.
        /// </summary>
        /// <param name='operations'>
        /// The operations group for this extension method.
        /// </param>
        /// <param name='headerParameter'>
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        public static async Task <Error> PostRequiredArrayHeaderAsync(this IExplicitModel operations, IList <string> headerParameter, CancellationToken cancellationToken = default(CancellationToken))
        {
            HttpOperationResponse <Error> result = await operations.PostRequiredArrayHeaderWithHttpMessagesAsync(headerParameter, null, cancellationToken).ConfigureAwait(false);

            return(result.Body);
        }
 /// <summary>
 /// Test explicitly required array. Please put a valid array-wrapper with
 /// 'value' = null and the client library should throw before the request is
 /// sent.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='value'>
 /// </param>
 public static Error PostRequiredArrayProperty(this IExplicitModel operations, IList <string> value)
 {
     return(operations.PostRequiredArrayPropertyAsync(value).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Test explicitly optional integer. Please put a header 'headerParameter'
 /// =&gt; null.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='headerParameter'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task PostOptionalArrayHeaderAsync(this IExplicitModel operations, IList <string> headerParameter = default(IList <string>), CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.PostOptionalArrayHeaderWithHttpMessagesAsync(headerParameter, null, cancellationToken).ConfigureAwait(false);
 }
 /// <summary>
 /// Test explicitly optional integer. Please put null.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='bodyParameter'>
 /// </param>
 public static void PostOptionalIntegerParameter(this IExplicitModel operations, int?bodyParameter = default(int?))
 {
     operations.PostOptionalIntegerParameterAsync(bodyParameter).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Test explicitly required integer. Please put a valid int-wrapper with
 /// 'value' = null and the client library should throw before the request is
 /// sent.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='bodyParameter'>
 /// </param>
 public static Error PostRequiredIntegerProperty(this IExplicitModel operations, IntWrapper bodyParameter)
 {
     return(Task.Factory.StartNew(s => ((IExplicitModel)s).PostRequiredIntegerPropertyAsync(bodyParameter), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Test explicitly optional array. Please put a valid array-wrapper with
 /// 'value' = null.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='value'>
 /// </param>
 public static void PostOptionalArrayProperty(this IExplicitModel operations, IList <string> value = default(IList <string>))
 {
     operations.PostOptionalArrayPropertyAsync(value).GetAwaiter().GetResult();
 }