Пример #1
0
 /// <summary>
 /// This will return the lowest total given products, specials and quantities.
 /// </summary>
 /// <remarks>
 /// This is not a test - it is a (optional) resource for exercise 3
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='token'>
 /// </param>
 /// <param name='request'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <int?> ApiResourceTrolleyCalculatorPostAsync(this IDevChallengeResourceClient operations, System.Guid token, DeveloperExerciseModelsTrolleyTrolley request = default(DeveloperExerciseModelsTrolleyTrolley), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ApiResourceTrolleyCalculatorPostWithHttpMessagesAsync(token, request, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Пример #2
0
 /// <summary>
 /// Exercise 2 - This will test your sorting endpoint.
 /// </summary>
 /// <remarks>
 /// This will call your api looking for a range of different sorting options at
 /// your base url /sort
 ///
 /// Your Api needs to call the "products" resource to get a list of available
 /// products
 ///
 /// This endpoint will need to accept a query string parameter called
 /// "sortOption" which will take in the following strings
 ///
 /// - "Low" - Low to High Price
 /// - "High" - High to Low Price
 /// - "Ascending" - A - Z sort on the Name
 /// - "Descending" - Z - A sort on the Name
 /// - "Recommended" - this will call the "shopperHistory" resource to get a
 /// list of customers orders and needs to return based on popularity,
 ///
 /// Your response will be in the same data structure as the "products" response
 /// (only sorted correctly)
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='request'>
 /// </param>
 public static IList <DeveloperExerciseServicesExerciseResult> ApiExerciseExercise2Post(this IDevChallengeResourceClient operations, DeveloperExerciseApiModelsTrolleyExerciseRequest request = default(DeveloperExerciseApiModelsTrolleyExerciseRequest))
 {
     return(operations.ApiExerciseExercise2PostAsync(request).GetAwaiter().GetResult());
 }
Пример #3
0
 /// <summary>
 /// Exercise 1 - Basic response (token and name).
 /// </summary>
 /// <remarks>
 /// This will call your api looking for a resource available at your base url
 /// /user.
 ///
 /// For example, if the url you request is "http://localhost:5001/api/answers"
 /// this will make a GET request to "http://localhost:5001/api/answers/user"
 ///
 /// The result will be a JSON object in the format {"name": "test", "token" :
 /// "1234-455662-22233333-3333"}
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='request'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IList <DeveloperExerciseServicesExerciseResult> > ApiExerciseExercise1PostAsync(this IDevChallengeResourceClient operations, DeveloperExerciseApiModelsTrolleyExerciseRequest request = default(DeveloperExerciseApiModelsTrolleyExerciseRequest), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ApiExerciseExercise1PostWithHttpMessagesAsync(request, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Пример #4
0
 /// <summary>
 /// This will return the lowest total given products, specials and quantities.
 /// </summary>
 /// <remarks>
 /// This is not a test - it is a (optional) resource for exercise 3
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='token'>
 /// </param>
 /// <param name='request'>
 /// </param>
 public static int?ApiResourceTrolleyCalculatorPost(this IDevChallengeResourceClient operations, System.Guid token, DeveloperExerciseModelsTrolleyTrolley request = default(DeveloperExerciseModelsTrolleyTrolley))
 {
     return(operations.ApiResourceTrolleyCalculatorPostAsync(token, request).GetAwaiter().GetResult());
 }
Пример #5
0
 /// <summary>
 /// This will return all customers buying habits for a range of products
 /// </summary>
 /// <remarks>
 /// This is not a test - it is a resource for exercise 2
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='token'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IList <DeveloperExerciseModelsSortProduct> > ApiResourceProductsGetAsync(this IDevChallengeResourceClient operations, System.Guid token, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ApiResourceProductsGetWithHttpMessagesAsync(token, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Пример #6
0
 /// <summary>
 /// This will return all customers buying habits for a range of products
 /// </summary>
 /// <remarks>
 /// This is not a test - it is a resource for exercise 2
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='token'>
 /// </param>
 public static IList <DeveloperExerciseModelsSortProduct> ApiResourceProductsGet(this IDevChallengeResourceClient operations, System.Guid token)
 {
     return(operations.ApiResourceProductsGetAsync(token).GetAwaiter().GetResult());
 }
Пример #7
0
 /// <summary>
 /// This will return all customers buying habits for a range of products
 /// </summary>
 /// <remarks>
 /// This is not a test - it is a resource for exercise 2
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='token'>
 /// </param>
 public static IList <DeveloperExerciseModelsSortShopperOrders> ApiResourceShopperHistoryGet(this IDevChallengeResourceClient operations, System.Guid token)
 {
     return(operations.ApiResourceShopperHistoryGetAsync(token).GetAwaiter().GetResult());
 }
Пример #8
0
 public DevChallengeResourceProxy(IDevChallengeResourceClient devChallengeResourceClient)
 {
     _devChallengeResourceClient = devChallengeResourceClient;
 }