Skip to content

Commit

Permalink
Merge pull request #796 from dmelendez35/feature
Browse files Browse the repository at this point in the history
Fix for #795
  • Loading branch information
abuzuhri authored Dec 4, 2024
2 parents 014cc0e + 5dcd1bc commit 0388197
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void GetFulFillmentInboundLabelsFromWebCreationSample(string shipmentId,i
var labelParams = new ParameterGetLabels()
{
PageType = PageType.PackageLabel_Letter_6,
shipmentId = shipmentId,
ShipmentId = shipmentId,
LabelType = LabelType.SELLER_LABEL,
PageSize = boxCount
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace FikaAmazonAPI.Parameter.FulFillmentInbound
public class ParameterGetLabels : ParameterBased
{
public string MarketplaceId { get; set; }
public string shipmentId { get; set; }
public string ShipmentId { get; set; }
public PageType PageType { get; set; }
public LabelType LabelType { get; set; }
public int? NumberOfPackages { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ namespace FikaAmazonAPI.Parameter.FulFillmentInbound.v20240320
{
public class ParameterListPrepDetails : ParameterBased
{
public string marketplaceId { get; set; }
public string MarketplaceId { get; set; }

public ICollection<string> mskus { get; set; }
public ICollection<string> Mskus { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ public class ParameterListShipmentBase : PaginationParameter
{
public string InboundPlanId { get; set; }
public string ShipmentId { get; set; }
public string paginationToken { get; set; }
public string PaginationToken { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
{
public class ParameterListTransportationOptions : PaginationParameter
{
public string placementOptionId { get; set; }
public string shipmentId { get; set; }
public string paginationToken { get; set; }
public string PlacementOptionId { get; set; }
public string ShipmentId { get; set; }
public string PaginationToken { get; set; }
}
}
4 changes: 2 additions & 2 deletions Source/FikaAmazonAPI/Parameter/ParameterBased.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public virtual List<KeyValuePair<string, string>> getParameters()
output = JsonConvert.SerializeObject(value, settings);
}


var propName = p.Name;
// Convert to cammelCase to avoid issues with properties not being properly mapped
var propName = char.ToLowerInvariant(p.Name[0]) + p.Name.Substring(1);

queryParameters.Add(new KeyValuePair<string, string>(propName, output));
}
Expand Down
2 changes: 1 addition & 1 deletion Source/FikaAmazonAPI/Services/FulFillmentInboundService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public LabelDownloadURL GetLabels(ParameterGetLabels parameterGetLabels) =>
public async Task<LabelDownloadURL> GetLabelsAsync(ParameterGetLabels parameterGetLabels, CancellationToken cancellationToken = default)
{
var parameter = parameterGetLabels.getParameters();
await CreateAuthorizedRequestAsync(FulFillmentInboundApiUrls.GetLabels(parameterGetLabels.shipmentId), RestSharp.Method.Get, parameter, cancellationToken: cancellationToken);
await CreateAuthorizedRequestAsync(FulFillmentInboundApiUrls.GetLabels(parameterGetLabels.ShipmentId), RestSharp.Method.Get, parameter, cancellationToken: cancellationToken);

var response = await ExecuteRequestAsync<GetLabelsResponse>(RateLimitType.FulFillmentInbound_GetLabels, cancellationToken);
if (response != null && response.Payload != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ public async Task<List<Box>> ListShipmentBoxesAsync(ParameterListShipmentBase pa
var nextToken = response.Pagination.NextToken;
while (!string.IsNullOrEmpty(nextToken) && (!parameterListShipmentBase.maxPages.HasValue || totalPages < parameterListShipmentBase.maxPages.Value))
{
parameterListShipmentBase.paginationToken = nextToken;
parameterListShipmentBase.PaginationToken = nextToken;
var getItemNextPage = await ListShipmentBoxesByNextTokenAsync(parameterListShipmentBase, cancellationToken);
list.AddRange(getItemNextPage.Boxes);
nextToken = getItemNextPage.Pagination?.NextToken;
Expand Down Expand Up @@ -513,7 +513,7 @@ public async Task<List<ContentUpdatePreview>> ListShipmentContentUpdatePreviewsA
var nextToken = response.Pagination.NextToken;
while (!string.IsNullOrEmpty(nextToken) && (!parameterListShipmentBase.maxPages.HasValue || totalPages < parameterListShipmentBase.maxPages.Value))
{
parameterListShipmentBase.paginationToken = nextToken;
parameterListShipmentBase.PaginationToken = nextToken;
var getItemNextPage = await ListShipmentContentUpdatePreviewsByNextTokenAsync(parameterListShipmentBase, cancellationToken);
list.AddRange(getItemNextPage.ContentUpdatePreviews);
nextToken = getItemNextPage.Pagination?.NextToken;
Expand Down Expand Up @@ -596,7 +596,7 @@ public async Task<List<DeliveryWindowOption>> ListDeliveryWindowOptionsAsync(Par
var nextToken = response.Pagination.NextToken;
while (!string.IsNullOrEmpty(nextToken) && (!parameterListShipmentBase.maxPages.HasValue || totalPages < parameterListShipmentBase.maxPages.Value))
{
parameterListShipmentBase.paginationToken = nextToken;
parameterListShipmentBase.PaginationToken = nextToken;
var getItemNextPage = await ListDeliveryWindowOptionsByNextTokenAsync(parameterListShipmentBase, cancellationToken);
list.AddRange(getItemNextPage.DeliveryWindowOptions);
nextToken = getItemNextPage.Pagination?.NextToken;
Expand Down Expand Up @@ -646,7 +646,7 @@ public async Task<List<Item>> ListShipmentItemsAsync(ParameterListShipmentBase p
var nextToken = response.Pagination.NextToken;
while (!string.IsNullOrEmpty(nextToken) && (!parameterListShipmentBase.maxPages.HasValue || totalPages < parameterListShipmentBase.maxPages.Value))
{
parameterListShipmentBase.paginationToken = nextToken;
parameterListShipmentBase.PaginationToken = nextToken;
var getItemNextPage = await ListShipmentItemsByNextTokenAsync(parameterListShipmentBase, cancellationToken);
list.AddRange(getItemNextPage.Items);
nextToken = getItemNextPage.Pagination?.NextToken;
Expand Down Expand Up @@ -700,7 +700,7 @@ public async Task<List<Pallet>> ListShipmentPalletsAsync(ParameterListShipmentBa
var nextToken = response.Pagination.NextToken;
while (!string.IsNullOrEmpty(nextToken) && (!parameterListShipmentBase.maxPages.HasValue || totalPages < parameterListShipmentBase.maxPages.Value))
{
parameterListShipmentBase.paginationToken = nextToken;
parameterListShipmentBase.PaginationToken = nextToken;
var getItemNextPage = await ListShipmentPalletsByNextTokenAsync(parameterListShipmentBase, cancellationToken);
list.AddRange(getItemNextPage.Pallets);
nextToken = getItemNextPage.Pagination?.NextToken;
Expand Down Expand Up @@ -751,7 +751,7 @@ public async Task<List<SelfShipAppointmentSlotsAvailability>> GetSelfShipAppoint
var nextToken = response.Pagination.NextToken;
while (!string.IsNullOrEmpty(nextToken) && (!parameterListShipmentBase.maxPages.HasValue || totalPages < parameterListShipmentBase.maxPages.Value))
{
parameterListShipmentBase.paginationToken = nextToken;
parameterListShipmentBase.PaginationToken = nextToken;
var getItemNextPage = await GetSelfShipAppointmentSlotsByNextTokenAsync(parameterListShipmentBase, cancellationToken);
list.Add(getItemNextPage.SelfShipAppointmentSlotsAvailability);
nextToken = getItemNextPage.Pagination?.NextToken;
Expand Down Expand Up @@ -846,7 +846,7 @@ public async Task<List<TransportationOption>> ListTransportationOptionsAsync(str
var nextToken = response.Pagination.NextToken;
while (!string.IsNullOrEmpty(nextToken) && (!parameterListTransportationOptions.maxPages.HasValue || totalPages < parameterListTransportationOptions.maxPages.Value))
{
parameterListTransportationOptions.paginationToken = nextToken;
parameterListTransportationOptions.PaginationToken = nextToken;
var getItemNextPage = await ListTransportationOptionsByNextTokenAsync(inboundPlanId, parameterListTransportationOptions, cancellationToken);
list.AddRange(getItemNextPage.TransportationOptions);
nextToken = getItemNextPage.Pagination?.NextToken;
Expand Down Expand Up @@ -929,9 +929,9 @@ public List<MskuPrepDetail> ListPrepDetails(ParameterListPrepDetails parameterLi

public async Task<List<MskuPrepDetail>> ListPrepDetailsAsync(ParameterListPrepDetails parameterListPrepDetails, CancellationToken cancellationToken = default)
{
if (string.IsNullOrWhiteSpace(parameterListPrepDetails.marketplaceId))
if (string.IsNullOrWhiteSpace(parameterListPrepDetails.MarketplaceId))
{
parameterListPrepDetails.marketplaceId = AmazonCredential.MarketPlace.ID;
parameterListPrepDetails.MarketplaceId = AmazonCredential.MarketPlace.ID;
}

var parameter = parameterListPrepDetails.getParameters();
Expand Down

0 comments on commit 0388197

Please sign in to comment.