/// <summary> /// Put complex types that are polymorphic, omitting the discriminator /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='complexBody'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Salmon> PutMissingDiscriminatorAsync(this IPolymorphism operations, Salmon complexBody, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.PutMissingDiscriminatorWithHttpMessagesAsync(complexBody, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get complex types that are polymorphic /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Fish> GetValidAsync(this IPolymorphism operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetValidWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Put complex types that are polymorphic /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='complexBody'> /// Please put a salmon that looks like this: /// { /// 'fishtype':'Salmon', /// 'location':'alaska', /// 'iswild':true, /// 'species':'king', /// 'length':1.0, /// 'siblings':[ /// { /// 'fishtype':'Shark', /// 'age':6, /// 'birthday': '2012-01-05T01:00:00Z', /// 'length':20.0, /// 'species':'predator', /// }, /// { /// 'fishtype':'Sawshark', /// 'age':105, /// 'birthday': '1900-01-05T01:00:00Z', /// 'length':10.0, /// 'picture': new Buffer([255, 255, 255, 255, /// 254]).toString('base64'), /// 'species':'dangerous', /// }, /// { /// 'fishtype': 'goblin', /// 'age': 1, /// 'birthday': '2015-08-08T00:00:00Z', /// 'length': 30.0, /// 'species': 'scary', /// 'jawsize': 5 /// } /// ] /// }; /// </param> public static void PutValid(this IPolymorphism operations, Fish complexBody) { Task.Factory.StartNew(s => ((IPolymorphism)s).PutValidAsync(complexBody), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }
/// <summary> /// Get complex types that are polymorphic /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static Fish GetValid(this IPolymorphism operations) { return(Task.Factory.StartNew(s => ((IPolymorphism)s).GetValidAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Put complex types that are polymorphic, attempting to omit required /// 'birthday' field - the request should not be allowed from the client /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='complexBody'> /// Please attempt put a sawshark that looks like this, the client should not /// allow this data to be sent: /// { /// "fishtype": "sawshark", /// "species": "snaggle toothed", /// "length": 18.5, /// "age": 2, /// "birthday": "2013-06-01T01:00:00Z", /// "location": "alaska", /// "picture": base64(FF FF FF FF FE), /// "siblings": [ /// { /// "fishtype": "shark", /// "species": "predator", /// "birthday": "2012-01-05T01:00:00Z", /// "length": 20, /// "age": 6 /// }, /// { /// "fishtype": "sawshark", /// "species": "dangerous", /// "picture": base64(FF FF FF FF FE), /// "length": 10, /// "age": 105 /// } /// ] /// } /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task PutValidMissingRequiredAsync(this IPolymorphism operations, Fish complexBody, CancellationToken cancellationToken = default(CancellationToken)) { await operations.PutValidMissingRequiredWithHttpMessagesAsync(complexBody, null, cancellationToken).ConfigureAwait(false); }
/// <summary> /// Put complex types that are polymorphic /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='complexBody'> /// Please put a salmon that looks like this: /// { /// 'fishtype':'Salmon', /// 'location':'alaska', /// 'iswild':true, /// 'species':'king', /// 'length':1.0, /// 'siblings':[ /// { /// 'fishtype':'Shark', /// 'age':6, /// 'birthday': '2012-01-05T01:00:00Z', /// 'length':20.0, /// 'species':'predator', /// }, /// { /// 'fishtype':'Sawshark', /// 'age':105, /// 'birthday': '1900-01-05T01:00:00Z', /// 'length':10.0, /// 'picture': new Buffer([255, 255, 255, 255, 254]).toString('base64'), /// 'species':'dangerous', /// }, /// { /// 'fishtype': 'goblin', /// 'age': 1, /// 'birthday': '2015-08-08T00:00:00Z', /// 'length': 30.0, /// 'species': 'scary', /// 'jawsize': 5 /// } /// ] /// }; /// </param> public static void PutValid(this IPolymorphism operations, Fish complexBody) { operations.PutValidAsync(complexBody).GetAwaiter().GetResult(); }
/// <summary> /// Get complex types that are polymorphic /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static Fish GetValid(this IPolymorphism operations) { return(operations.GetValidAsync().GetAwaiter().GetResult()); }
/// <summary> /// Put complex types that are polymorphic, omitting the discriminator /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='complexBody'> /// </param> public static Salmon PutMissingDiscriminator(this IPolymorphism operations, Salmon complexBody) { return(operations.PutMissingDiscriminatorAsync(complexBody).GetAwaiter().GetResult()); }
/// <summary> /// Put complex types that are polymorphic, but not at the root of the /// hierarchy; also have additional properties /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='complexBody'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task PutComplicatedAsync(this IPolymorphism operations, Salmon complexBody, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.PutComplicatedWithHttpMessagesAsync(complexBody, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Put complex types that are polymorphic, but not at the root of the /// hierarchy; also have additional properties /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='complexBody'> /// </param> public static void PutComplicated(this IPolymorphism operations, Salmon complexBody) { operations.PutComplicatedAsync(complexBody).GetAwaiter().GetResult(); }
/// <summary> /// Get complex types that are polymorphic, but not at the root of the /// hierarchy; also have additional properties /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static Salmon GetComplicated(this IPolymorphism operations) { return(operations.GetComplicatedAsync().GetAwaiter().GetResult()); }
/// <summary> /// Put complex types that are polymorphic, attempting to omit required /// 'birthday' field - the request should not be allowed from the client /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='complexBody'> /// Please attempt put a sawshark that looks like this, the client should not /// allow this data to be sent: /// { /// "fishtype": "sawshark", /// "species": "snaggle toothed", /// "length": 18.5, /// "age": 2, /// "birthday": "2013-06-01T01:00:00Z", /// "location": "alaska", /// "picture": base64(FF FF FF FF FE), /// "siblings": [ /// { /// "fishtype": "shark", /// "species": "predator", /// "birthday": "2012-01-05T01:00:00Z", /// "length": 20, /// "age": 6 /// }, /// { /// "fishtype": "sawshark", /// "species": "dangerous", /// "picture": base64(FF FF FF FF FE), /// "length": 10, /// "age": 105 /// } /// ] /// } /// </param> public static void PutValidMissingRequired(this IPolymorphism operations, Fish complexBody) { System.Threading.Tasks.Task.Factory.StartNew(s => ((IPolymorphism)s).PutValidMissingRequiredAsync(complexBody), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }
/// <summary> /// Put complex types that are polymorphic /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='complexBody'> /// Please put a salmon that looks like this: /// { /// 'fishtype':'Salmon', /// 'location':'alaska', /// 'iswild':true, /// 'species':'king', /// 'length':1.0, /// 'siblings':[ /// { /// 'fishtype':'Shark', /// 'age':6, /// 'birthday': '2012-01-05T01:00:00Z', /// 'length':20.0, /// 'species':'predator', /// }, /// { /// 'fishtype':'Sawshark', /// 'age':105, /// 'birthday': '1900-01-05T01:00:00Z', /// 'length':10.0, /// 'picture': new Buffer([255, 255, 255, 255, /// 254]).toString('base64'), /// 'species':'dangerous', /// }, /// { /// 'fishtype': 'goblin', /// 'age': 1, /// 'birthday': '2015-08-08T00:00:00Z', /// 'length': 30.0, /// 'species': 'scary', /// 'jawsize': 5 /// } /// ] /// }; /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async System.Threading.Tasks.Task PutValidAsync(this IPolymorphism operations, Fish complexBody, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.PutValidWithHttpMessagesAsync(complexBody, null, cancellationToken).ConfigureAwait(false); }