/// <summary>
 /// Logs user into the system
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='username'>
 /// The user name for login
 /// </param>
 /// <param name='password'>
 /// The password for login in clear text
 /// </param>
 public static string LoginUser(this ISwaggerPetstoreV2 operations, string username, string password)
 {
     return(operations.LoginUserAsync(username, password).GetAwaiter().GetResult());
 }
Example #2
0
 /// <summary>
 /// Updates a pet in the store with form data
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='petId'>
 /// Id of pet that needs to be updated
 /// </param>
 /// <param name='fileContent'>
 /// File to upload.
 /// </param>
 /// <param name='fileName'>
 /// Updated name of the pet
 /// </param>
 /// <param name='status'>
 /// Updated status of the pet
 /// </param>
 public static void UpdatePetWithForm(this ISwaggerPetstoreV2 operations, long?petId, System.IO.Stream fileContent, string fileName = default(string), string status = default(string))
 {
     Task.Factory.StartNew(s => ((ISwaggerPetstoreV2)s).UpdatePetWithFormAsync(petId, fileContent, fileName, status), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
Example #3
0
 /// <summary>
 /// Deletes a pet
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='petId'>
 /// Pet id to delete
 /// </param>
 /// <param name='apiKey'>
 /// </param>
 public static void DeletePet(this ISwaggerPetstoreV2 operations, long?petId, string apiKey = "")
 {
     Task.Factory.StartNew(s => ((ISwaggerPetstoreV2)s).DeletePetAsync(petId, apiKey), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
 /// <summary>
 /// Get user by user name
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='username'>
 /// The name that needs to be fetched. Use user1 for testing.
 /// </param>
 /// <param name='customHeaders'>
 /// Headers that will be added to request.
 /// </param>
 public static HttpOperationResponse <User> GetUserByNameWithHttpMessages(this ISwaggerPetstoreV2 operations, string username, Dictionary <string, List <string> > customHeaders = null)
 {
     return(operations.GetUserByNameWithHttpMessagesAsync(username, customHeaders, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult());
 }
Example #5
0
 /// <summary>
 /// Finds Pets by tags
 /// </summary>
 /// Muliple tags can be provided with comma seperated strings. Use tag1, tag2,
 /// tag3 for testing.
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='tags'>
 /// Tags to filter by
 /// </param>
 public static IList <Pet> FindPetsByTags(this ISwaggerPetstoreV2 operations, IList <string> tags)
 {
     return(Task.Factory.StartNew(s => ((ISwaggerPetstoreV2)s).FindPetsByTagsAsync(tags), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Creates list of users with given input array
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// List of user object
 /// </param>
 /// <param name='customHeaders'>
 /// Headers that will be added to request.
 /// </param>
 public static HttpOperationResponse CreateUsersWithListInputWithHttpMessages(this ISwaggerPetstoreV2 operations, IList <User> body, Dictionary <string, List <string> > customHeaders = null)
 {
     return(operations.CreateUsersWithListInputWithHttpMessagesAsync(body, customHeaders, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Logs out current logged in user session
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task LogoutUserAsync(this ISwaggerPetstoreV2 operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.LogoutUserWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false);
 }
 /// <summary>
 /// Update an existing pet
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// Pet object that needs to be added to the store
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task UpdatePetAsync(this ISwaggerPetstoreV2 operations, Pet body, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.UpdatePetWithHttpMessagesAsync(body, null, cancellationToken).ConfigureAwait(false);
 }
 /// <summary>
 /// Finds Pets by tags
 /// </summary>
 /// <remarks>
 /// Muliple tags can be provided with comma seperated strings. Use tag1, tag2,
 /// tag3 for testing.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='tags'>
 /// Tags to filter by
 /// </param>
 /// <param name='customHeaders'>
 /// Headers that will be added to request.
 /// </param>
 public static HttpOperationResponse <IList <Pet> > FindPetsByTagsWithHttpMessages(this ISwaggerPetstoreV2 operations, IList <string> tags, Dictionary <string, List <string> > customHeaders = null)
 {
     return(operations.FindPetsByTagsWithHttpMessagesAsync(tags, customHeaders, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Updated user
 /// </summary>
 /// <remarks>
 /// This can only be done by the logged in user.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='username'>
 /// name that need to be deleted
 /// </param>
 /// <param name='body'>
 /// Updated user object
 /// </param>
 public static void UpdateUser(this ISwaggerPetstoreV2 operations, string username, User body)
 {
     operations.UpdateUserAsync(username, body).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Updated user
 /// </summary>
 /// <remarks>
 /// This can only be done by the logged in user.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='username'>
 /// name that need to be deleted
 /// </param>
 /// <param name='body'>
 /// Updated user object
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task UpdateUserAsync(this ISwaggerPetstoreV2 operations, string username, User body, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.UpdateUserWithHttpMessagesAsync(username, body, null, cancellationToken).ConfigureAwait(false);
 }
 /// <summary>
 /// Get user by user name
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='username'>
 /// The name that needs to be fetched. Use user1 for testing.
 /// </param>
 public static User GetUserByName(this ISwaggerPetstoreV2 operations, string username)
 {
     return(operations.GetUserByNameAsync(username).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Logs out current logged in user session
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static void LogoutUser(this ISwaggerPetstoreV2 operations)
 {
     operations.LogoutUserAsync().GetAwaiter().GetResult();
 }
 /// <summary>
 /// Update an existing pet
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// Pet object that needs to be added to the store
 /// </param>
 public static void UpdatePet(this ISwaggerPetstoreV2 operations, Pet body)
 {
     operations.UpdatePetAsync(body).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Creates list of users with given input array
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// List of user object
 /// </param>
 public static void CreateUsersWithListInput(this ISwaggerPetstoreV2 operations, IList <User> body)
 {
     Task.Factory.StartNew(s => ((ISwaggerPetstoreV2)s).CreateUsersWithListInputAsync(body), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
 /// <summary>
 /// Updates a pet in the store with form data
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='petId'>
 /// Id of pet that needs to be updated
 /// </param>
 /// <param name='fileContent'>
 /// File to upload.
 /// </param>
 /// <param name='fileName'>
 /// Updated name of the pet
 /// </param>
 /// <param name='status'>
 /// Updated status of the pet
 /// </param>
 /// <param name='customHeaders'>
 /// Headers that will be added to request.
 /// </param>
 public static HttpOperationResponse UpdatePetWithFormWithHttpMessages(this ISwaggerPetstoreV2 operations, long petId, Stream fileContent, string fileName = default(string), string status = default(string), Dictionary <string, List <string> > customHeaders = null)
 {
     return(operations.UpdatePetWithFormWithHttpMessagesAsync(petId, fileContent, fileName, status, customHeaders, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Creates list of users with given input array
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// List of user object
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task CreateUsersWithListInputAsync(this ISwaggerPetstoreV2 operations, IList <User> body, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.CreateUsersWithListInputWithHttpMessagesAsync(body, null, cancellationToken).ConfigureAwait(false);
 }
 /// <summary>
 /// Returns pet inventories by status
 /// </summary>
 /// <remarks>
 /// Returns a map of status codes to quantities
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static IDictionary <string, int?> GetInventory(this ISwaggerPetstoreV2 operations)
 {
     return(Task.Factory.StartNew(s => ((ISwaggerPetstoreV2)s).GetInventoryAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Logs out current logged in user session
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static void LogoutUser(this ISwaggerPetstoreV2 operations)
 {
     Task.Factory.StartNew(s => ((ISwaggerPetstoreV2)s).LogoutUserAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
 /// <summary>
 /// Returns pet inventories by status
 /// </summary>
 /// <remarks>
 /// Returns a map of status codes to quantities
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='customHeaders'>
 /// Headers that will be added to request.
 /// </param>
 public static HttpOperationResponse <IDictionary <string, int?> > GetInventoryWithHttpMessages(this ISwaggerPetstoreV2 operations, Dictionary <string, List <string> > customHeaders = null)
 {
     return(operations.GetInventoryWithHttpMessagesAsync(customHeaders, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Get user by user name
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='username'>
 /// The name that needs to be fetched. Use user1 for testing.
 /// </param>
 public static User GetUserByName(this ISwaggerPetstoreV2 operations, string username)
 {
     return(Task.Factory.StartNew(s => ((ISwaggerPetstoreV2)s).GetUserByNameAsync(username), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Place an order for a pet
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// order placed for purchasing the pet
 /// </param>
 public static Order PlaceOrder(this ISwaggerPetstoreV2 operations, Order body)
 {
     return(Task.Factory.StartNew(s => ((ISwaggerPetstoreV2)s).PlaceOrderAsync(body), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Updated user
 /// </summary>
 /// <remarks>
 /// This can only be done by the logged in user.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='username'>
 /// name that need to be deleted
 /// </param>
 /// <param name='body'>
 /// Updated user object
 /// </param>
 public static void UpdateUser(this ISwaggerPetstoreV2 operations, string username, User body)
 {
     Task.Factory.StartNew(s => ((ISwaggerPetstoreV2)s).UpdateUserAsync(username, body), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
 /// <summary>
 /// Delete purchase order by Id
 /// </summary>
 /// <remarks>
 /// For valid response try integer IDs with value &lt; 1000. Anything above
 /// 1000 or nonintegers will generate API errors
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='orderId'>
 /// Id of the order that needs to be deleted
 /// </param>
 public static void DeleteOrder(this ISwaggerPetstoreV2 operations, string orderId)
 {
     Task.Factory.StartNew(s => ((ISwaggerPetstoreV2)s).DeleteOrderAsync(orderId), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
Example #25
0
 /// <summary>
 /// Find pet by Id
 /// </summary>
 /// Returns a single pet
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='petId'>
 /// Id of pet to return
 /// </param>
 public static Pet GetPetById(this ISwaggerPetstoreV2 operations, long?petId)
 {
     return(Task.Factory.StartNew(s => ((ISwaggerPetstoreV2)s).GetPetByIdAsync(petId), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Delete purchase order by Id
 /// </summary>
 /// <remarks>
 /// For valid response try integer IDs with value &lt; 1000. Anything above
 /// 1000 or nonintegers will generate API errors
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='orderId'>
 /// Id of the order that needs to be deleted
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteOrderAsync(this ISwaggerPetstoreV2 operations, string orderId, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.DeleteOrderWithHttpMessagesAsync(orderId, null, cancellationToken).ConfigureAwait(false);
 }
Example #27
0
 /// <summary>
 /// Updates a pet in the store with form data
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='petId'>
 /// Id of pet that needs to be updated
 /// </param>
 /// <param name='fileContent'>
 /// File to upload.
 /// </param>
 /// <param name='fileName'>
 /// Updated name of the pet
 /// </param>
 /// <param name='status'>
 /// Updated status of the pet
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task UpdatePetWithFormAsync(this ISwaggerPetstoreV2 operations, long?petId, System.IO.Stream fileContent, string fileName = default(string), string status = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.UpdatePetWithFormWithHttpMessagesAsync(petId, fileContent, fileName, status, null, cancellationToken).ConfigureAwait(false);
 }
 /// <summary>
 /// Delete purchase order by Id
 /// </summary>
 /// <remarks>
 /// For valid response try integer IDs with value &lt; 1000. Anything above
 /// 1000 or nonintegers will generate API errors
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='orderId'>
 /// Id of the order that needs to be deleted
 /// </param>
 /// <param name='customHeaders'>
 /// Headers that will be added to request.
 /// </param>
 public static HttpOperationResponse DeleteOrderWithHttpMessages(this ISwaggerPetstoreV2 operations, string orderId, Dictionary <string, List <string> > customHeaders = null)
 {
     return(operations.DeleteOrderWithHttpMessagesAsync(orderId, customHeaders, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult());
 }
Example #29
0
 /// <summary>
 /// Deletes a pet
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='petId'>
 /// Pet id to delete
 /// </param>
 /// <param name='apiKey'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeletePetAsync(this ISwaggerPetstoreV2 operations, long?petId, string apiKey = "", CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.DeletePetWithHttpMessagesAsync(petId, apiKey, null, cancellationToken).ConfigureAwait(false);
 }
 /// <summary>
 /// Creates list of users with given input array
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// List of user object
 /// </param>
 public static void CreateUsersWithListInput(this ISwaggerPetstoreV2 operations, IList <User> body)
 {
     operations.CreateUsersWithListInputAsync(body).GetAwaiter().GetResult();
 }