diff --git a/EasyKeys.Shipping.sln b/EasyKeys.Shipping.sln index 43c2dbe..d11914a 100644 --- a/EasyKeys.Shipping.sln +++ b/EasyKeys.Shipping.sln @@ -1,4 +1,3 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31825.309 @@ -82,6 +81,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyKeys.Shipping.FuncTest" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyKeys.Shipping.FedEx.UploadDocument", "src\EasyKeys.Shipping.FedEx.UploadDocument\EasyKeys.Shipping.FedEx.UploadDocument.csproj", "{CCFE77D6-0A82-4EC9-AB2F-6FCD885FC489}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Amazon", "Amazon", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyKeys.Shipping.Amazon.Abstractions", "src\EasyKeys.Shipping.Amazon.Abstractions\EasyKeys.Shipping.Amazon.Abstractions.csproj", "{3B6980FA-333A-46AD-9F33-0D9BFBD853A8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyKeys.Shipping.Amazon.Rates", "src\EasyKeys.Shipping.Amazon.Rates\EasyKeys.Shipping.Amazon.Rates.csproj", "{3668E9A5-CB31-4FC9-9918-B5046B67651A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyKeys.Shipping.Amazon.Shipment", "src\EasyKeys.Shipping.Amazon.Shipment\EasyKeys.Shipping.Amazon.Shipment.csproj", "{8B109CC8-6252-4668-983F-B0877710827C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -344,6 +351,42 @@ Global {CCFE77D6-0A82-4EC9-AB2F-6FCD885FC489}.Release|x64.Build.0 = Release|Any CPU {CCFE77D6-0A82-4EC9-AB2F-6FCD885FC489}.Release|x86.ActiveCfg = Release|Any CPU {CCFE77D6-0A82-4EC9-AB2F-6FCD885FC489}.Release|x86.Build.0 = Release|Any CPU + {3B6980FA-333A-46AD-9F33-0D9BFBD853A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3B6980FA-333A-46AD-9F33-0D9BFBD853A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3B6980FA-333A-46AD-9F33-0D9BFBD853A8}.Debug|x64.ActiveCfg = Debug|Any CPU + {3B6980FA-333A-46AD-9F33-0D9BFBD853A8}.Debug|x64.Build.0 = Debug|Any CPU + {3B6980FA-333A-46AD-9F33-0D9BFBD853A8}.Debug|x86.ActiveCfg = Debug|Any CPU + {3B6980FA-333A-46AD-9F33-0D9BFBD853A8}.Debug|x86.Build.0 = Debug|Any CPU + {3B6980FA-333A-46AD-9F33-0D9BFBD853A8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3B6980FA-333A-46AD-9F33-0D9BFBD853A8}.Release|Any CPU.Build.0 = Release|Any CPU + {3B6980FA-333A-46AD-9F33-0D9BFBD853A8}.Release|x64.ActiveCfg = Release|Any CPU + {3B6980FA-333A-46AD-9F33-0D9BFBD853A8}.Release|x64.Build.0 = Release|Any CPU + {3B6980FA-333A-46AD-9F33-0D9BFBD853A8}.Release|x86.ActiveCfg = Release|Any CPU + {3B6980FA-333A-46AD-9F33-0D9BFBD853A8}.Release|x86.Build.0 = Release|Any CPU + {3668E9A5-CB31-4FC9-9918-B5046B67651A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3668E9A5-CB31-4FC9-9918-B5046B67651A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3668E9A5-CB31-4FC9-9918-B5046B67651A}.Debug|x64.ActiveCfg = Debug|Any CPU + {3668E9A5-CB31-4FC9-9918-B5046B67651A}.Debug|x64.Build.0 = Debug|Any CPU + {3668E9A5-CB31-4FC9-9918-B5046B67651A}.Debug|x86.ActiveCfg = Debug|Any CPU + {3668E9A5-CB31-4FC9-9918-B5046B67651A}.Debug|x86.Build.0 = Debug|Any CPU + {3668E9A5-CB31-4FC9-9918-B5046B67651A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3668E9A5-CB31-4FC9-9918-B5046B67651A}.Release|Any CPU.Build.0 = Release|Any CPU + {3668E9A5-CB31-4FC9-9918-B5046B67651A}.Release|x64.ActiveCfg = Release|Any CPU + {3668E9A5-CB31-4FC9-9918-B5046B67651A}.Release|x64.Build.0 = Release|Any CPU + {3668E9A5-CB31-4FC9-9918-B5046B67651A}.Release|x86.ActiveCfg = Release|Any CPU + {3668E9A5-CB31-4FC9-9918-B5046B67651A}.Release|x86.Build.0 = Release|Any CPU + {8B109CC8-6252-4668-983F-B0877710827C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8B109CC8-6252-4668-983F-B0877710827C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8B109CC8-6252-4668-983F-B0877710827C}.Debug|x64.ActiveCfg = Debug|Any CPU + {8B109CC8-6252-4668-983F-B0877710827C}.Debug|x64.Build.0 = Debug|Any CPU + {8B109CC8-6252-4668-983F-B0877710827C}.Debug|x86.ActiveCfg = Debug|Any CPU + {8B109CC8-6252-4668-983F-B0877710827C}.Debug|x86.Build.0 = Debug|Any CPU + {8B109CC8-6252-4668-983F-B0877710827C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8B109CC8-6252-4668-983F-B0877710827C}.Release|Any CPU.Build.0 = Release|Any CPU + {8B109CC8-6252-4668-983F-B0877710827C}.Release|x64.ActiveCfg = Release|Any CPU + {8B109CC8-6252-4668-983F-B0877710827C}.Release|x64.Build.0 = Release|Any CPU + {8B109CC8-6252-4668-983F-B0877710827C}.Release|x86.ActiveCfg = Release|Any CPU + {8B109CC8-6252-4668-983F-B0877710827C}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -374,6 +417,10 @@ Global {9009798A-AE3E-47E9-8200-74CFEB7381B6} = {BCBBDD1A-FF30-41E8-B7C1-9BB2A441FF83} {48385BA3-B5AE-47E6-9C41-189EE6334D1E} = {3F55FE37-B8A2-4DDA-818B-5DBBAA18571E} {CCFE77D6-0A82-4EC9-AB2F-6FCD885FC489} = {1018F8BE-B2F4-4A54-82F4-72D787E40A7D} + {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {BCBBDD1A-FF30-41E8-B7C1-9BB2A441FF83} + {3B6980FA-333A-46AD-9F33-0D9BFBD853A8} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {3668E9A5-CB31-4FC9-9918-B5046B67651A} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {8B109CC8-6252-4668-983F-B0877710827C} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {0FBE81B8-162F-4342-BABD-0FFFD0C99331} diff --git a/GitVersion.yml b/GitVersion.yml index 526eedb..bf86f91 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,5 +1,5 @@ mode: Mainline -next-version: 4.3.0 +next-version: 5.0.0 branches: feature: tag: preview diff --git a/src/EasyKeys.Shipping.Amazon.Abstractions/.editorconfig b/src/EasyKeys.Shipping.Amazon.Abstractions/.editorconfig new file mode 100644 index 0000000..da773db --- /dev/null +++ b/src/EasyKeys.Shipping.Amazon.Abstractions/.editorconfig @@ -0,0 +1,334 @@ +# EditorConfig is awesome: https://EditorConfig.org +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +# Matches multiple files with brace expansion notation +# Set default charset +[*.js] +charset = utf-8 + +# Solution Files +[*.sln] +indent_style = tab + +# XML Project Files +[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] +indent_size = 2 + +# YAML Files +[*.{yml,yaml}] +indent_size = 2 +indent_style = space + +# Markdown Files +[*.md] +trim_trailing_whitespace = false + +# .NET Code Style Settings +[*.{cs,csx,cake,vb}] + +[*.cshtml.cs] +dotnet_diagnostic.SA1649.severity = none + +# "this." and "Me." qualifiers +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#this_and_me +dotnet_style_qualification_for_field = false:warning +dotnet_style_qualification_for_property = false:warning +dotnet_style_qualification_for_method = false:warning +dotnet_style_qualification_for_event = false:warning + +# Language keywords instead of framework type names for type references +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#language_keywords +dotnet_style_predefined_type_for_locals_parameters_members = true:warning +dotnet_style_predefined_type_for_member_access = true:warning + +# Modifier preferences +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#normalize_modifiers +dotnet_style_require_accessibility_modifiers = always:warning +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:warning +dotnet_style_readonly_field = true:warning + +# Code-block preferences +csharp_prefer_braces = true:silent +csharp_prefer_simple_using_statement = true:suggestion + +# Expression-level preferences +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#expression_level +dotnet_style_object_initializer = true:warning +dotnet_style_collection_initializer = true:warning +dotnet_style_explicit_tuple_names = true:warning +dotnet_style_prefer_inferred_tuple_names = true:warning +dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning +dotnet_style_prefer_auto_properties = true:warning +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning + +# 'using' directive preferences +csharp_using_directive_placement = outside_namespace:silent + +# Null-checking preferences +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#null_checking +dotnet_style_coalesce_expression = true:warning +dotnet_style_null_propagation = true:warning + +# Other (Undocumented) +dotnet_style_prefer_conditional_expression_over_return = false +dotnet_style_prefer_conditional_expression_over_assignment = false + +# C# Code Style Settings +[*.{cs,csx,cake}] +# Implicit and explicit types +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#implicit-and-explicit-types +csharp_style_var_for_built_in_types = true:warning +csharp_style_var_when_type_is_apparent = true:warning +csharp_style_var_elsewhere = true:warning + +# Expression-bodied members +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#expression_bodied_members +csharp_style_expression_bodied_methods = false:warning +csharp_style_expression_bodied_constructors = false:warning +csharp_style_expression_bodied_operators = true:warning +csharp_style_expression_bodied_properties = true:warning +csharp_style_expression_bodied_indexers = true:warning +csharp_style_expression_bodied_accessors = true:warning + +# Pattern matching +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#pattern_matching +csharp_style_pattern_matching_over_is_with_cast_check = true:warning +csharp_style_pattern_matching_over_as_with_null_check = true:warning + +# Inlined variable declarations +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#inlined_variable_declarations +csharp_style_inlined_variable_declaration = true:warning + +# Expression-level preferences +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#expression_level_csharp +csharp_prefer_simple_default_expression = true:warning +csharp_style_deconstructed_variable_declaration = true:warning +csharp_style_pattern_local_over_anonymous_function = true:warning + +# "Null" checking preferences +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#null_checking_csharp +csharp_style_throw_expression = true:warning +csharp_style_conditional_delegate_call = true:warning + +# Code block preferences +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#code_block +csharp_prefer_braces = true:warning + +############################# +# .NET Formatting Conventions +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#formatting-conventions +############################# + +# Organize usings +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#usings +dotnet_sort_system_directives_first = true +dotnet_separate_import_directive_groups = true + +# C# formatting settings +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#c-formatting-settings +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true:warning +csharp_new_line_before_catch = true:warning +csharp_new_line_before_finally = true:warning +csharp_new_line_before_members_in_object_initializers = true:warning +csharp_new_line_before_members_in_anonymous_types = true:warning +csharp_new_line_between_query_expression_clauses = true:warning + +# Indentation options +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#indent +csharp_indent_case_contents = true:warning +csharp_indent_switch_labels = true:warning +csharp_indent_labels = no_change:warning + +# Spacing options +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#spacing +csharp_space_after_cast = false:warning +csharp_space_after_keywords_in_control_flow_statements = true:warning +csharp_space_between_method_declaration_parameter_list_parentheses = false:warning +csharp_space_between_method_call_parameter_list_parentheses = false:warning +csharp_space_between_parentheses = expressions:warning +csharp_space_before_colon_in_inheritance_clause = true:warning +csharp_space_after_colon_in_inheritance_clause = true:warning +csharp_space_around_binary_operators = before_and_after:warning +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false:warning +csharp_space_between_method_call_name_and_opening_parenthesis = false:warning +csharp_space_between_method_call_empty_parameter_list_parentheses = false:warning + +# Wrapping options +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#wrapping +csharp_preserve_single_line_statements = false:warning +csharp_preserve_single_line_blocks = true:warning + +# More Indentation options (Undocumented) +csharp_indent_block_contents = true:warning +csharp_indent_braces = false:warning + +# Spacing Options (Undocumented) +csharp_space_after_comma = true:warning +csharp_space_after_dot = false:warning +csharp_space_after_semicolon_in_for_statement = true:warning +csharp_space_around_declaration_statements = do_not_ignore:warning +csharp_space_before_comma = false:warning +csharp_space_before_dot = false:warning +csharp_space_before_semicolon_in_for_statement = false:warning +csharp_space_before_open_square_brackets = false:warning +csharp_space_between_empty_square_brackets = false:warning +csharp_space_between_method_declaration_name_and_open_parenthesis = false:warning +csharp_space_between_square_brackets = false:warning + +######################### +# .NET Naming conventions +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions +######################### + +[*.{cs,csx,cake,vb}] +# Naming Symbols +# constant_fields - Define constant fields +dotnet_naming_symbols.constant_fields.applicable_kinds = field +dotnet_naming_symbols.constant_fields.required_modifiers = const + +# non_private_readonly_fields - Define public, internal and protected readonly fields +dotnet_naming_symbols.non_private_readonly_fields.applicable_accessibilities = public, internal, protected +dotnet_naming_symbols.non_private_readonly_fields.applicable_kinds = field +dotnet_naming_symbols.non_private_readonly_fields.required_modifiers = readonly + +# static_readonly_fields - Define static and readonly fields +dotnet_naming_symbols.static_readonly_fields.applicable_kinds = field +dotnet_naming_symbols.static_readonly_fields.required_modifiers = static, readonly + +# private_readonly_fields - Define private readonly fields +dotnet_naming_symbols.private_readonly_fields.applicable_accessibilities = private +dotnet_naming_symbols.private_readonly_fields.applicable_kinds = field +dotnet_naming_symbols.private_readonly_fields.required_modifiers = readonly + +# public_internal_fields - Define public and internal fields +dotnet_naming_symbols.public_internal_fields.applicable_accessibilities = public, internal +dotnet_naming_symbols.public_internal_fields.applicable_kinds = field + +# private_protected_fields - Define private and protected fields +dotnet_naming_symbols.private_protected_fields.applicable_accessibilities = private, protected +dotnet_naming_symbols.private_protected_fields.applicable_kinds = field + +# public_symbols - Define any public symbol +dotnet_naming_symbols.public_symbols.applicable_accessibilities = public, internal, protected, protected_internal +dotnet_naming_symbols.public_symbols.applicable_kinds = method, property, event, delegate + +# parameters - Defines any parameter +dotnet_naming_symbols.parameters.applicable_kinds = parameter + +# non_interface_types - Defines class, struct, enum and delegate types +dotnet_naming_symbols.non_interface_types.applicable_kinds = class, struct, enum, delegate + +# interface_types - Defines interfaces +dotnet_naming_symbols.interface_types.applicable_kinds = interface + +######################### +# Naming Styles +######################### + +# camel_case - Define the camelCase style +dotnet_naming_style.camel_case.capitalization = camel_case + +# pascal_case - Define the Pascal_case style +dotnet_naming_style.pascal_case.capitalization = pascal_case + +# first_upper - The first character must start with an upper-case character +dotnet_naming_style.first_upper.capitalization = first_word_upper + +# prefix_interface_interface_with_i - Interfaces must be PascalCase and the first character of an interface must be an 'I' +dotnet_naming_style.prefix_interface_interface_with_i.capitalization = pascal_case +dotnet_naming_style.prefix_interface_interface_with_i.required_prefix = I + +######################### +# Naming Rules +######################### + +# Constant fields must be PascalCase +dotnet_naming_rule.constant_fields_must_be_pascal_case.severity = warning +dotnet_naming_rule.constant_fields_must_be_pascal_case.symbols = constant_fields +dotnet_naming_rule.constant_fields_must_be_pascal_case.style = pascal_case + +# Public, internal and protected readonly fields must be PascalCase +dotnet_naming_rule.non_private_readonly_fields_must_be_pascal_case.severity = warning +dotnet_naming_rule.non_private_readonly_fields_must_be_pascal_case.symbols = non_private_readonly_fields +dotnet_naming_rule.non_private_readonly_fields_must_be_pascal_case.style = pascal_case + +# Static readonly fields must be PascalCase +dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.severity = warning +dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.symbols = static_readonly_fields +dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.style = pascal_case + +# Public and internal fields must be PascalCase +dotnet_naming_rule.public_internal_fields_must_be_pascal_case.severity = warning +dotnet_naming_rule.public_internal_fields_must_be_pascal_case.symbols = public_internal_fields +dotnet_naming_rule.public_internal_fields_must_be_pascal_case.style = pascal_case + +# Public members must be capitalized +dotnet_naming_rule.public_members_must_be_capitalized.severity = warning +dotnet_naming_rule.public_members_must_be_capitalized.symbols = public_symbols +dotnet_naming_rule.public_members_must_be_capitalized.style = first_upper + +# Parameters must be camelCase +dotnet_naming_rule.parameters_must_be_camel_case.severity = warning +dotnet_naming_rule.parameters_must_be_camel_case.symbols = parameters +dotnet_naming_rule.parameters_must_be_camel_case.style = camel_case + +# Class, struct, enum and delegates must be PascalCase +dotnet_naming_rule.non_interface_types_must_be_pascal_case.severity = warning +dotnet_naming_rule.non_interface_types_must_be_pascal_case.symbols = non_interface_types +dotnet_naming_rule.non_interface_types_must_be_pascal_case.style = pascal_case + +# Interfaces must be PascalCase and start with an 'I' +dotnet_naming_rule.interface_types_must_be_prefixed_with_i.severity = warning +dotnet_naming_rule.interface_types_must_be_prefixed_with_i.symbols = interface_types +dotnet_naming_rule.interface_types_must_be_prefixed_with_i.style = prefix_interface_interface_with_i + +dotnet_naming_symbols.private_fields.applicable_kinds = field +dotnet_naming_symbols.private_fields.applicable_accessibilities = private, internal + +# internal and private fields should be _camelCase +dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion +dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields +dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style + +dotnet_naming_symbols.private_internal_fields.applicable_kinds = field +dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal, protected + +dotnet_naming_style.camel_case_underscore_style.required_prefix = _ +dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case +dotnet_style_operator_placement_when_wrapping = beginning_of_line +tab_width = 4 +indent_size = 4 +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion + + +[*.cs] + +# CA1815: Override equals and operator equals on value types +dotnet_diagnostic.CA1815.severity = silent +csharp_indent_labels = no_change +csharp_using_directive_placement = outside_namespace:silent +csharp_prefer_simple_using_statement = true:suggestion +csharp_prefer_braces = true:warning +csharp_style_namespace_declarations = block_scoped:silent +csharp_style_prefer_method_group_conversion = true:silent +csharp_style_prefer_top_level_statements = true:silent +csharp_style_prefer_primary_constructors = true:suggestion +csharp_prefer_system_threading_lock = true:suggestion +csharp_style_expression_bodied_methods = false:warning +csharp_style_expression_bodied_constructors = false:warning +csharp_style_expression_bodied_operators = true:warning +csharp_style_expression_bodied_properties = true:warning +csharp_style_expression_bodied_indexers = true:warning +csharp_style_expression_bodied_accessors = true:warning +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = false:silent diff --git a/src/EasyKeys.Shipping.Amazon.Abstractions/DependencyInjection/AmazonShippingServiceCollectionExtensions.cs b/src/EasyKeys.Shipping.Amazon.Abstractions/DependencyInjection/AmazonShippingServiceCollectionExtensions.cs new file mode 100644 index 0000000..5096f14 --- /dev/null +++ b/src/EasyKeys.Shipping.Amazon.Abstractions/DependencyInjection/AmazonShippingServiceCollectionExtensions.cs @@ -0,0 +1,32 @@ +using EasyKeys.Shipping.Amazon.Abstractions.OpenApis.V2.Shipping; +using EasyKeys.Shipping.Amazon.Abstractions.Options; +using EasyKeys.Shipping.Amazon.Abstractions.Services; +using EasyKeys.Shipping.Amazon.Abstractions.Services.Impl; + +using Microsoft.Extensions.DependencyInjection.Extensions; + +namespace Microsoft.Extensions.DependencyInjection; + +public static class AmazonShippingServiceCollectionExtensions +{ + /// + /// adds the AmazonShippingClient to the DI container. required for usage of all amazon shipping services. + /// + /// + /// + /// + /// + public static IServiceCollection AddAmazonShippingClient( + this IServiceCollection services, + string sectionName = nameof(AmazonShippingApiOptions), + Action? configure = null) + { + services.AddChangeTokenOptions(sectionName, null, (options, config) => configure?.Invoke(options,config)); + services.TryAddSingleton(); + // add generated api clients + // services.AddHttpClient(); + services.AddHttpClient(); + + return services; + } +} diff --git a/src/EasyKeys.Shipping.Amazon.Abstractions/EasyKeys.Shipping.Amazon.Abstractions.csproj b/src/EasyKeys.Shipping.Amazon.Abstractions/EasyKeys.Shipping.Amazon.Abstractions.csproj new file mode 100644 index 0000000..9bfbe98 --- /dev/null +++ b/src/EasyKeys.Shipping.Amazon.Abstractions/EasyKeys.Shipping.Amazon.Abstractions.csproj @@ -0,0 +1,40 @@ + + + + net8.0 + enable + enable + + + DotNetCore Implementation of Amazon Authorization Api + + DotNetCore, Amazon Shipping,V2, Amazon OAuth API + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + diff --git a/src/EasyKeys.Shipping.Amazon.Abstractions/OpenApis/V2/Shipping/AmazonShippingApi.cs b/src/EasyKeys.Shipping.Amazon.Abstractions/OpenApis/V2/Shipping/AmazonShippingApi.cs new file mode 100644 index 0000000..80bf008 --- /dev/null +++ b/src/EasyKeys.Shipping.Amazon.Abstractions/OpenApis/V2/Shipping/AmazonShippingApi.cs @@ -0,0 +1,5707 @@ +//---------------------- +// +// Generated using the NSwag toolchain v13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org) +// +//---------------------- + +#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." +#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." +#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' +#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... +#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." +#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" +#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" +#pragma warning disable 8603 // Disable "CS8603 Possible null reference return" + +namespace EasyKeys.Shipping.Amazon.Abstractions.OpenApis.V2.Shipping +{ + using System = global::System; + + [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class AmazonShippingApi + { + private string _baseUrl = "https://sandbox.sellingpartnerapi-na.amazon.com/"; + private System.Net.Http.HttpClient _httpClient; + private System.Lazy _settings; + + public AmazonShippingApi(System.Net.Http.HttpClient httpClient) + { + _httpClient = httpClient; + _settings = new System.Lazy(CreateSerializerSettings); + } + + private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + { + var settings = new Newtonsoft.Json.JsonSerializerSettings(); + UpdateJsonSerializerSettings(settings); + return settings; + } + + public string BaseUrl + { + get { return _baseUrl; } + set { _baseUrl = value; } + } + + protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } + + partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + + partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); + partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); + partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); + + /// + /// Returns the available shipping service offerings. + ///
+ ///
**Usage Plan:** + ///
+ ///
| Default Quota | Unit | + ///
| ---- | ---- | + ///
| 5 | Requests Per Second | + ///
+ ///
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + ///
+ /// Amazon shipping request token + /// Amazon shipping business to assume for this request. The default is AmazonShipping_UK. + /// Success. + /// A server side error occurred. + public virtual System.Threading.Tasks.Task GetRatesAsync(string x_amz_access_token, XAmznShippingBusinessId x_amzn_shipping_business_id, GetRatesRequest body) + { + return GetRatesAsync(x_amz_access_token, x_amzn_shipping_business_id, body, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Returns the available shipping service offerings. + ///
+ ///
**Usage Plan:** + ///
+ ///
| Default Quota | Unit | + ///
| ---- | ---- | + ///
| 5 | Requests Per Second | + ///
+ ///
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + ///
+ /// Amazon shipping request token + /// Amazon shipping business to assume for this request. The default is AmazonShipping_UK. + /// Success. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task GetRatesAsync(string x_amz_access_token, XAmznShippingBusinessId x_amzn_shipping_business_id, GetRatesRequest body, System.Threading.CancellationToken cancellationToken) + { + if (body == null) + throw new System.ArgumentNullException("body"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/shipping/v2/shipments/rates"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (x_amz_access_token == null) + throw new System.ArgumentNullException("x_amz_access_token"); + request_.Headers.TryAddWithoutValidation("x-amz-access-token", ConvertToString(x_amz_access_token, System.Globalization.CultureInfo.InvariantCulture)); + + if (x_amzn_shipping_business_id == null) + throw new System.ArgumentNullException("x_amzn_shipping_business_id"); + request_.Headers.TryAddWithoutValidation("x-amzn-shipping-business-id", ConvertToString(x_amzn_shipping_business_id, System.Globalization.CultureInfo.InvariantCulture)); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var content_ = new System.Net.Http.StringContent(json_); + content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Request has missing or invalid parameters and cannot be parsed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request\'s Authorization header is not formatted correctly or does not contain a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The resource specified does not exist.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 413) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request size exceeded the maximum accepted size.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 415) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request payload is in an unsupported format.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 429) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The frequency of requests was greater than allowed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("An unexpected condition occurred that prevented the server from fulfilling the request.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 503) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Temporary overloading or maintenance of the server.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// + /// Purchases a shipping service and returns purchase related details and documents. + ///
+ ///
Note: You must complete the purchase within **10 minutes** of rate creation by the shipping service provider. If you make the request after the 10 minutes have expired, you will receive an error response with the error code equal to "TOKEN_EXPIRED". If you receive this error response, you must get the rates for the shipment again. + ///
+ ///
**Usage Plan:** + ///
+ ///
| Default Quota | Unit | + ///
| ---- | ---- | + ///
| 5 | Requests Per Second | + ///
+ ///
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + ///
+ /// Amazon shipping request token + /// Amazon shipping business to assume for this request. The default is AmazonShipping_UK. + /// Success. + /// A server side error occurred. + public virtual System.Threading.Tasks.Task PurchaseShipmentAsync(string x_amz_access_token, XAmznShippingBusinessId2 x_amzn_shipping_business_id, PurchaseShipmentRequest body) + { + return PurchaseShipmentAsync(x_amz_access_token, x_amzn_shipping_business_id, body, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Purchases a shipping service and returns purchase related details and documents. + ///
+ ///
Note: You must complete the purchase within **10 minutes** of rate creation by the shipping service provider. If you make the request after the 10 minutes have expired, you will receive an error response with the error code equal to "TOKEN_EXPIRED". If you receive this error response, you must get the rates for the shipment again. + ///
+ ///
**Usage Plan:** + ///
+ ///
| Default Quota | Unit | + ///
| ---- | ---- | + ///
| 5 | Requests Per Second | + ///
+ ///
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + ///
+ /// Amazon shipping request token + /// Amazon shipping business to assume for this request. The default is AmazonShipping_UK. + /// Success. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task PurchaseShipmentAsync(string x_amz_access_token, XAmznShippingBusinessId2 x_amzn_shipping_business_id, PurchaseShipmentRequest body, System.Threading.CancellationToken cancellationToken) + { + if (body == null) + throw new System.ArgumentNullException("body"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/shipping/v2/shipments"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (x_amz_access_token == null) + throw new System.ArgumentNullException("x_amz_access_token"); + request_.Headers.TryAddWithoutValidation("x-amz-access-token", ConvertToString(x_amz_access_token, System.Globalization.CultureInfo.InvariantCulture)); + + if (x_amzn_shipping_business_id == null) + throw new System.ArgumentNullException("x_amzn_shipping_business_id"); + request_.Headers.TryAddWithoutValidation("x-amzn-shipping-business-id", ConvertToString(x_amzn_shipping_business_id, System.Globalization.CultureInfo.InvariantCulture)); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var content_ = new System.Net.Http.StringContent(json_); + content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Request has missing or invalid parameters and cannot be parsed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request\'s Authorization header is not formatted correctly or does not contain a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The resource specified does not exist.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 413) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request size exceeded the maximum accepted size.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 415) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request payload is in an unsupported format.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 429) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The frequency of requests was greater than allowed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("An unexpected condition occurred that prevented the server from fulfilling the request.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 503) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Temporary overloading or maintenance of the server.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// + /// Purchases a shipping service identifier and returns purchase-related details and documents. + ///
+ ///
**Usage Plan:** + ///
+ ///
| Default Quota | Unit | + ///
| ---- | ---- | + ///
| 5 | Requests Per Second | + ///
+ ///
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + ///
+ /// Amazon shipping request token + /// Amazon shipping business to assume for this request. The default is AmazonShipping_UK. + /// Success. + /// A server side error occurred. + public virtual System.Threading.Tasks.Task OneClickShipmentAsync(string x_amz_access_token, XAmznShippingBusinessId3 x_amzn_shipping_business_id, OneClickShipmentRequest body) + { + return OneClickShipmentAsync(x_amz_access_token, x_amzn_shipping_business_id, body, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Purchases a shipping service identifier and returns purchase-related details and documents. + ///
+ ///
**Usage Plan:** + ///
+ ///
| Default Quota | Unit | + ///
| ---- | ---- | + ///
| 5 | Requests Per Second | + ///
+ ///
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + ///
+ /// Amazon shipping request token + /// Amazon shipping business to assume for this request. The default is AmazonShipping_UK. + /// Success. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task OneClickShipmentAsync(string x_amz_access_token, XAmznShippingBusinessId3 x_amzn_shipping_business_id, OneClickShipmentRequest body, System.Threading.CancellationToken cancellationToken) + { + if (body == null) + throw new System.ArgumentNullException("body"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/shipping/v2/oneClickShipment"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (x_amz_access_token == null) + throw new System.ArgumentNullException("x_amz_access_token"); + request_.Headers.TryAddWithoutValidation("x-amz-access-token", ConvertToString(x_amz_access_token, System.Globalization.CultureInfo.InvariantCulture)); + + if (x_amzn_shipping_business_id == null) + throw new System.ArgumentNullException("x_amzn_shipping_business_id"); + request_.Headers.TryAddWithoutValidation("x-amzn-shipping-business-id", ConvertToString(x_amzn_shipping_business_id, System.Globalization.CultureInfo.InvariantCulture)); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var content_ = new System.Net.Http.StringContent(json_); + content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Request has missing or invalid parameters and cannot be parsed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request\'s Authorization header is not formatted correctly or does not contain a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The resource specified does not exist.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 413) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request size exceeded the maximum accepted size.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 415) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request payload is in an unsupported format.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 429) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The frequency of requests was greater than allowed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("An unexpected condition occurred that prevented the server from fulfilling the request.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 503) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Temporary overloading or maintenance of the server.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// + /// Returns tracking information for a purchased shipment. + ///
+ ///
**Usage Plan:** + ///
+ ///
| Default Quota | Unit | + ///
| ---- | ---- | + ///
| 5 | Requests Per Second | + ///
+ ///
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + ///
+ /// A carrier-generated tracking identifier originally returned by the purchaseShipment operation. + /// A carrier identifier originally returned by the getRates operation for the selected rate. + /// Amazon shipping request token + /// Amazon shipping business to assume for this request. The default is AmazonShipping_UK. + /// Success. + /// A server side error occurred. + public virtual System.Threading.Tasks.Task GetTrackingAsync(string trackingId, string carrierId, string x_amz_access_token, XAmznShippingBusinessId4? x_amzn_shipping_business_id) + { + return GetTrackingAsync(trackingId, carrierId, x_amz_access_token, x_amzn_shipping_business_id, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Returns tracking information for a purchased shipment. + ///
+ ///
**Usage Plan:** + ///
+ ///
| Default Quota | Unit | + ///
| ---- | ---- | + ///
| 5 | Requests Per Second | + ///
+ ///
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + ///
+ /// A carrier-generated tracking identifier originally returned by the purchaseShipment operation. + /// A carrier identifier originally returned by the getRates operation for the selected rate. + /// Amazon shipping request token + /// Amazon shipping business to assume for this request. The default is AmazonShipping_UK. + /// Success. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task GetTrackingAsync(string trackingId, string carrierId, string x_amz_access_token, XAmznShippingBusinessId4? x_amzn_shipping_business_id, System.Threading.CancellationToken cancellationToken) + { + if (trackingId == null) + throw new System.ArgumentNullException("trackingId"); + + if (carrierId == null) + throw new System.ArgumentNullException("carrierId"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/shipping/v2/tracking?"); + urlBuilder_.Append(System.Uri.EscapeDataString("trackingId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(trackingId, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("carrierId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(carrierId, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Length--; + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (x_amz_access_token == null) + throw new System.ArgumentNullException("x_amz_access_token"); + request_.Headers.TryAddWithoutValidation("x-amz-access-token", ConvertToString(x_amz_access_token, System.Globalization.CultureInfo.InvariantCulture)); + + if (x_amzn_shipping_business_id != null) + request_.Headers.TryAddWithoutValidation("x-amzn-shipping-business-id", ConvertToString(x_amzn_shipping_business_id, System.Globalization.CultureInfo.InvariantCulture)); + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Request has missing or invalid parameters and cannot be parsed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request\'s Authorization header is not formatted correctly or does not contain a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The resource specified does not exist.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 413) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request size exceeded the maximum accepted size.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 415) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request payload is in an unsupported format.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 429) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The frequency of requests was greater than allowed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("An unexpected condition occurred that prevented the server from fulfilling the request.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 503) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Temporary overloading or maintenance of the server.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// + /// Returns the shipping documents associated with a package in a shipment. + ///
+ ///
**Usage Plan:** + ///
+ ///
| Default Quota | Unit | + ///
| ---- | ---- | + ///
| 5 | Requests Per Second | + ///
+ ///
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + ///
+ /// The shipment identifier originally returned by the purchaseShipment operation. + /// The package client reference identifier originally provided in the request body parameter for the getRates operation. + /// The file format of the document. Must be one of the supported formats returned by the getRates operation. + /// The resolution of the document (for example, 300 means 300 dots per inch). Must be one of the supported resolutions returned in the response to the getRates operation. + /// Amazon shipping request token + /// Amazon shipping business to assume for this request. The default is AmazonShipping_UK. + /// Success. + /// A server side error occurred. + public virtual System.Threading.Tasks.Task GetShipmentDocumentsAsync(string shipmentId, string packageClientReferenceId, string format, double? dpi, string x_amz_access_token, XAmznShippingBusinessId5 x_amzn_shipping_business_id) + { + return GetShipmentDocumentsAsync(shipmentId, packageClientReferenceId, format, dpi, x_amz_access_token, x_amzn_shipping_business_id, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Returns the shipping documents associated with a package in a shipment. + ///
+ ///
**Usage Plan:** + ///
+ ///
| Default Quota | Unit | + ///
| ---- | ---- | + ///
| 5 | Requests Per Second | + ///
+ ///
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + ///
+ /// The shipment identifier originally returned by the purchaseShipment operation. + /// The package client reference identifier originally provided in the request body parameter for the getRates operation. + /// The file format of the document. Must be one of the supported formats returned by the getRates operation. + /// The resolution of the document (for example, 300 means 300 dots per inch). Must be one of the supported resolutions returned in the response to the getRates operation. + /// Amazon shipping request token + /// Amazon shipping business to assume for this request. The default is AmazonShipping_UK. + /// Success. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task GetShipmentDocumentsAsync(string shipmentId, string packageClientReferenceId, string format, double? dpi, string x_amz_access_token, XAmznShippingBusinessId5 x_amzn_shipping_business_id, System.Threading.CancellationToken cancellationToken) + { + if (shipmentId == null) + throw new System.ArgumentNullException("shipmentId"); + + if (packageClientReferenceId == null) + throw new System.ArgumentNullException("packageClientReferenceId"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/shipping/v2/shipments/{shipmentId}/documents?"); + urlBuilder_.Replace("{shipmentId}", System.Uri.EscapeDataString(ConvertToString(shipmentId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append(System.Uri.EscapeDataString("packageClientReferenceId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(packageClientReferenceId, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + if (format != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("format") + "=").Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (dpi != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("dpi") + "=").Append(System.Uri.EscapeDataString(ConvertToString(dpi, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (x_amz_access_token == null) + throw new System.ArgumentNullException("x_amz_access_token"); + request_.Headers.TryAddWithoutValidation("x-amz-access-token", ConvertToString(x_amz_access_token, System.Globalization.CultureInfo.InvariantCulture)); + + if (x_amzn_shipping_business_id == null) + throw new System.ArgumentNullException("x_amzn_shipping_business_id"); + request_.Headers.TryAddWithoutValidation("x-amzn-shipping-business-id", ConvertToString(x_amzn_shipping_business_id, System.Globalization.CultureInfo.InvariantCulture)); + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Request has missing or invalid parameters and cannot be parsed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request\'s Authorization header is not formatted correctly or does not contain a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The resource specified does not exist.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 413) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request size exceeded the maximum accepted size.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 415) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request payload is in an unsupported format.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 429) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The frequency of requests was greater than allowed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("An unexpected condition occurred that prevented the server from fulfilling the request.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 503) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Temporary overloading or maintenance of the server.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// + /// Cancels a purchased shipment. Returns an empty object if the shipment is successfully cancelled. + ///
+ ///
**Usage Plan:** + ///
+ ///
| Default Quota | Unit | + ///
| ---- | ---- | + ///
| 5 | Requests Per Second | + ///
+ ///
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + ///
+ /// The shipment identifier originally returned by the purchaseShipment operation. + /// Amazon shipping request token + /// Amazon shipping business to assume for this request. The default is AmazonShipping_UK. + /// Success. + /// A server side error occurred. + public virtual System.Threading.Tasks.Task CancelShipmentAsync(string shipmentId, string x_amz_access_token, XAmznShippingBusinessId6 x_amzn_shipping_business_id) + { + return CancelShipmentAsync(shipmentId, x_amz_access_token, x_amzn_shipping_business_id, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Cancels a purchased shipment. Returns an empty object if the shipment is successfully cancelled. + ///
+ ///
**Usage Plan:** + ///
+ ///
| Default Quota | Unit | + ///
| ---- | ---- | + ///
| 5 | Requests Per Second | + ///
+ ///
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + ///
+ /// The shipment identifier originally returned by the purchaseShipment operation. + /// Amazon shipping request token + /// Amazon shipping business to assume for this request. The default is AmazonShipping_UK. + /// Success. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task CancelShipmentAsync(string shipmentId, string x_amz_access_token, XAmznShippingBusinessId6 x_amzn_shipping_business_id, System.Threading.CancellationToken cancellationToken) + { + if (shipmentId == null) + throw new System.ArgumentNullException("shipmentId"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/shipping/v2/shipments/{shipmentId}/cancel"); + urlBuilder_.Replace("{shipmentId}", System.Uri.EscapeDataString(ConvertToString(shipmentId, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (x_amz_access_token == null) + throw new System.ArgumentNullException("x_amz_access_token"); + request_.Headers.TryAddWithoutValidation("x-amz-access-token", ConvertToString(x_amz_access_token, System.Globalization.CultureInfo.InvariantCulture)); + + if (x_amzn_shipping_business_id == null) + throw new System.ArgumentNullException("x_amzn_shipping_business_id"); + request_.Headers.TryAddWithoutValidation("x-amzn-shipping-business-id", ConvertToString(x_amzn_shipping_business_id, System.Globalization.CultureInfo.InvariantCulture)); + request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); + request_.Method = new System.Net.Http.HttpMethod("PUT"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Request has missing or invalid parameters and cannot be parsed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request\'s Authorization header is not formatted correctly or does not contain a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The resource specified does not exist.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 413) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request size exceeded the maximum accepted size.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 415) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request payload is in an unsupported format.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 429) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The frequency of requests was greater than allowed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("An unexpected condition occurred that prevented the server from fulfilling the request.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 503) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Temporary overloading or maintenance of the server.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// + /// Returns a list of access points in proximity of input postal code. + ///
+ ///
**Usage Plan:** + ///
+ ///
| Default Quota | Unit | + ///
| ---- | ---- | + ///
| 5 | Requests Per Second | + ///
+ ///
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + ///
+ /// Access point types + /// Country code for access point + /// postal code for access point + /// Amazon shipping request token + /// Amazon shipping business to assume for this request. The default is AmazonShipping_UK. + /// Success. + /// A server side error occurred. + public virtual System.Threading.Tasks.Task GetAccessPointsAsync(System.Collections.Generic.IEnumerable accessPointTypes, string countryCode, string postalCode, string x_amz_access_token, XAmznShippingBusinessId7 x_amzn_shipping_business_id) + { + return GetAccessPointsAsync(accessPointTypes, countryCode, postalCode, x_amz_access_token, x_amzn_shipping_business_id, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Returns a list of access points in proximity of input postal code. + ///
+ ///
**Usage Plan:** + ///
+ ///
| Default Quota | Unit | + ///
| ---- | ---- | + ///
| 5 | Requests Per Second | + ///
+ ///
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + ///
+ /// Access point types + /// Country code for access point + /// postal code for access point + /// Amazon shipping request token + /// Amazon shipping business to assume for this request. The default is AmazonShipping_UK. + /// Success. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task GetAccessPointsAsync(System.Collections.Generic.IEnumerable accessPointTypes, string countryCode, string postalCode, string x_amz_access_token, XAmznShippingBusinessId7 x_amzn_shipping_business_id, System.Threading.CancellationToken cancellationToken) + { + if (accessPointTypes == null) + throw new System.ArgumentNullException("accessPointTypes"); + + if (countryCode == null) + throw new System.ArgumentNullException("countryCode"); + + if (postalCode == null) + throw new System.ArgumentNullException("postalCode"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/shipping/v2/accessPoints?"); + foreach (var item_ in accessPointTypes) { urlBuilder_.Append(System.Uri.EscapeDataString("accessPointTypes") + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); } + urlBuilder_.Append(System.Uri.EscapeDataString("countryCode") + "=").Append(System.Uri.EscapeDataString(ConvertToString(countryCode, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("postalCode") + "=").Append(System.Uri.EscapeDataString(ConvertToString(postalCode, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Length--; + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (x_amz_access_token == null) + throw new System.ArgumentNullException("x_amz_access_token"); + request_.Headers.TryAddWithoutValidation("x-amz-access-token", ConvertToString(x_amz_access_token, System.Globalization.CultureInfo.InvariantCulture)); + + if (x_amzn_shipping_business_id == null) + throw new System.ArgumentNullException("x_amzn_shipping_business_id"); + request_.Headers.TryAddWithoutValidation("x-amzn-shipping-business-id", ConvertToString(x_amzn_shipping_business_id, System.Globalization.CultureInfo.InvariantCulture)); + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Request has missing or invalid parameters and cannot be parsed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request\'s Authorization header is not formatted correctly or does not contain a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The resource specified does not exist.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 413) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request size exceeded the maximum accepted size.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 415) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request payload is in an unsupported format.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 429) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The frequency of requests was greater than allowed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("An unexpected condition occurred that prevented the server from fulfilling the request.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 503) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Temporary overloading or maintenance of the server.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// + /// This API submits the NDR (Non-delivery Report) Feedback for any eligible shipment. + ///
+ ///
**Usage Plan:** + ///
+ ///
| Default Quota | Unit | + ///
| ---- | ---- | + ///
| 5 | Requests Per Second | + ///
+ ///
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). + ///
+ /// Amazon shipping request token + /// Amazon shipping business to assume for this request. The default is AmazonShipping_UK. + /// Request body for ndrFeedback operation + /// Success + /// A server side error occurred. + public virtual System.Threading.Tasks.Task SubmitNdrFeedbackAsync(string x_amz_access_token, XAmznShippingBusinessId8? x_amzn_shipping_business_id, SubmitNdrFeedbackRequest body) + { + return SubmitNdrFeedbackAsync(x_amz_access_token, x_amzn_shipping_business_id, body, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// This API submits the NDR (Non-delivery Report) Feedback for any eligible shipment. + ///
+ ///
**Usage Plan:** + ///
+ ///
| Default Quota | Unit | + ///
| ---- | ---- | + ///
| 5 | Requests Per Second | + ///
+ ///
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api). + ///
+ /// Amazon shipping request token + /// Amazon shipping business to assume for this request. The default is AmazonShipping_UK. + /// Request body for ndrFeedback operation + /// Success + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task SubmitNdrFeedbackAsync(string x_amz_access_token, XAmznShippingBusinessId8? x_amzn_shipping_business_id, SubmitNdrFeedbackRequest body, System.Threading.CancellationToken cancellationToken) + { + if (body == null) + throw new System.ArgumentNullException("body"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/shipping/v2/ndrFeedback"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (x_amz_access_token == null) + throw new System.ArgumentNullException("x_amz_access_token"); + request_.Headers.TryAddWithoutValidation("x-amz-access-token", ConvertToString(x_amz_access_token, System.Globalization.CultureInfo.InvariantCulture)); + + if (x_amzn_shipping_business_id != null) + request_.Headers.TryAddWithoutValidation("x-amzn-shipping-business-id", ConvertToString(x_amzn_shipping_business_id, System.Globalization.CultureInfo.InvariantCulture)); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var content_ = new System.Net.Http.StringContent(json_); + content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 204) + { + return; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Request has missing or invalid parameters and cannot be parsed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request\'s Authorization header is not formatted correctly or does not contain a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The resource specified does not exist.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 413) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request size exceeded the maximum accepted size.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 415) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request payload is in an unsupported format.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 429) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The frequency of requests was greater than allowed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("An unexpected condition occurred that prevented the server from fulfilling the request.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 503) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Temporary overloading or maintenance of the server.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// + /// Returns the JSON schema to use for providing additional inputs when needed to purchase a shipping offering. Call the getAdditionalInputs operation when the response to a previous call to the getRates operation indicates that additional inputs are required for the rate (shipping offering) that you want to purchase. + ///
+ ///
**Usage Plan:** + ///
+ ///
| Default Quota | Unit | + ///
| ---- | ---- | + ///
| 5 | Requests Per Second | + ///
+ ///
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + ///
+ /// The request token returned in the response to the getRates operation. + /// The rate identifier for the shipping offering (rate) returned in the response to the getRates operation. + /// Amazon shipping request token + /// Amazon shipping business to assume for this request. The default is AmazonShipping_UK. + /// Success. + /// A server side error occurred. + public virtual System.Threading.Tasks.Task GetAdditionalInputsAsync(string requestToken, string rateId, string x_amz_access_token, XAmznShippingBusinessId9? x_amzn_shipping_business_id) + { + return GetAdditionalInputsAsync(requestToken, rateId, x_amz_access_token, x_amzn_shipping_business_id, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Returns the JSON schema to use for providing additional inputs when needed to purchase a shipping offering. Call the getAdditionalInputs operation when the response to a previous call to the getRates operation indicates that additional inputs are required for the rate (shipping offering) that you want to purchase. + ///
+ ///
**Usage Plan:** + ///
+ ///
| Default Quota | Unit | + ///
| ---- | ---- | + ///
| 5 | Requests Per Second | + ///
+ ///
The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). + ///
+ /// The request token returned in the response to the getRates operation. + /// The rate identifier for the shipping offering (rate) returned in the response to the getRates operation. + /// Amazon shipping request token + /// Amazon shipping business to assume for this request. The default is AmazonShipping_UK. + /// Success. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task GetAdditionalInputsAsync(string requestToken, string rateId, string x_amz_access_token, XAmznShippingBusinessId9? x_amzn_shipping_business_id, System.Threading.CancellationToken cancellationToken) + { + if (requestToken == null) + throw new System.ArgumentNullException("requestToken"); + + if (rateId == null) + throw new System.ArgumentNullException("rateId"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/shipping/v2/shipments/additionalInputs/schema?"); + urlBuilder_.Append(System.Uri.EscapeDataString("requestToken") + "=").Append(System.Uri.EscapeDataString(ConvertToString(requestToken, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("rateId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(rateId, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Length--; + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (x_amz_access_token == null) + throw new System.ArgumentNullException("x_amz_access_token"); + request_.Headers.TryAddWithoutValidation("x-amz-access-token", ConvertToString(x_amz_access_token, System.Globalization.CultureInfo.InvariantCulture)); + + if (x_amzn_shipping_business_id != null) + request_.Headers.TryAddWithoutValidation("x-amzn-shipping-business-id", ConvertToString(x_amzn_shipping_business_id, System.Globalization.CultureInfo.InvariantCulture)); + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Request has missing or invalid parameters and cannot be parsed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request\'s Authorization header is not formatted correctly or does not contain a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The resource specified does not exist.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 413) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request size exceeded the maximum accepted size.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 415) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The request payload is in an unsupported format.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 429) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("The frequency of requests was greater than allowed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("An unexpected condition occurred that prevented the server from fulfilling the request.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 503) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Temporary overloading or maintenance of the server.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + protected struct ObjectResponseResult + { + public ObjectResponseResult(T responseObject, string responseText) + { + this.Object = responseObject; + this.Text = responseText; + } + + public T Object { get; } + + public string Text { get; } + } + + public bool ReadResponseAsString { get; set; } + + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) + { + if (response == null || response.Content == null) + { + return new ObjectResponseResult(default(T), string.Empty); + } + + if (ReadResponseAsString) + { + var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); + return new ObjectResponseResult(typedBody, responseText); + } + catch (Newtonsoft.Json.JsonException exception) + { + var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; + throw new ApiException(message, (int)response.StatusCode, responseText, headers, exception); + } + } + else + { + try + { + using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + using (var streamReader = new System.IO.StreamReader(responseStream)) + using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) + { + var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings); + var typedBody = serializer.Deserialize(jsonTextReader); + return new ObjectResponseResult(typedBody, string.Empty); + } + } + catch (Newtonsoft.Json.JsonException exception) + { + var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; + throw new ApiException(message, (int)response.StatusCode, string.Empty, headers, exception); + } + } + } + + private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) + { + if (value == null) + { + return ""; + } + + if (value is System.Enum) + { + var name = System.Enum.GetName(value.GetType(), value); + if (name != null) + { + var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field != null) + { + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + as System.Runtime.Serialization.EnumMemberAttribute; + if (attribute != null) + { + return attribute.Value != null ? attribute.Value : name; + } + } + + var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); + return converted == null ? string.Empty : converted; + } + } + else if (value is bool) + { + return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); + } + else if (value is byte[]) + { + return System.Convert.ToBase64String((byte[])value); + } + else if (value.GetType().IsArray) + { + var array = System.Linq.Enumerable.OfType((System.Array)value); + return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + } + + var result = System.Convert.ToString(value, cultureInfo); + return result == null ? "" : result; + } + } + + /// + /// Error response returned when the request is unsuccessful. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class Error + { + /// + /// An error code that identifies the type of error that occurred. + /// + [Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string Code { get; set; } + + /// + /// A message that describes the error condition. + /// + [Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string Message { get; set; } + + /// + /// Additional details that can help the caller understand or fix the issue. + /// + [Newtonsoft.Json.JsonProperty("details", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Details { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// A list of error responses returned when a request is unsuccessful. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class ErrorList + { + /// + /// Array of Errors + /// + [Newtonsoft.Json.JsonProperty("errors", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public System.Collections.Generic.ICollection Errors { get; set; } = new System.Collections.ObjectModel.Collection(); + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The weight in the units indicated. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class Weight + { + /// + /// The unit of measurement. + /// + [Newtonsoft.Json.JsonProperty("unit", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public WeightUnit Unit { get; set; } + + /// + /// The measurement value. + /// + [Newtonsoft.Json.JsonProperty("value", Required = Newtonsoft.Json.Required.Always)] + public double Value { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Liquid Volume. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class LiquidVolume + { + /// + /// The unit of measurement. + /// + [Newtonsoft.Json.JsonProperty("unit", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public LiquidVolumeUnit Unit { get; set; } + + /// + /// The measurement value. + /// + [Newtonsoft.Json.JsonProperty("value", Required = Newtonsoft.Json.Required.Always)] + public double Value { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The invoice details for charges associated with the goods in the package. Only applies to certain regions. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class InvoiceDetails + { + /// + /// The invoice number of the item. + /// + [Newtonsoft.Json.JsonProperty("invoiceNumber", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string InvoiceNumber { get; set; } + + /// + /// The invoice date of the item in ISO 8061 format. + /// + [Newtonsoft.Json.JsonProperty("invoiceDate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.DateTimeOffset InvoiceDate { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// A list of charges based on the shipping service charges applied on a package. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class ChargeList : System.Collections.ObjectModel.Collection + { + + } + + /// + /// The type and amount of a charge applied on a package. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class ChargeComponent + { + [Newtonsoft.Json.JsonProperty("amount", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Currency Amount { get; set; } + + /// + /// The type of charge. + /// + [Newtonsoft.Json.JsonProperty("chargeType", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public ChargeComponentChargeType ChargeType { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The monetary value in the currency indicated, in ISO 4217 standard format. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class Currency + { + /// + /// The monetary value. + /// + [Newtonsoft.Json.JsonProperty("value", Required = Newtonsoft.Json.Required.Always)] + public double Value { get; set; } + + /// + /// The ISO 4217 format 3-character currency code. + /// + [Newtonsoft.Json.JsonProperty("unit", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.StringLength(3, MinimumLength = 3)] + public string Unit { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// A set of measurements for a three-dimensional object. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class Dimensions + { + /// + /// The length of the package. + /// + [Newtonsoft.Json.JsonProperty("length", Required = Newtonsoft.Json.Required.Always)] + public double Length { get; set; } + + /// + /// The width of the package. + /// + [Newtonsoft.Json.JsonProperty("width", Required = Newtonsoft.Json.Required.Always)] + public double Width { get; set; } + + /// + /// The height of the package. + /// + [Newtonsoft.Json.JsonProperty("height", Required = Newtonsoft.Json.Required.Always)] + public double Height { get; set; } + + /// + /// The unit of measurement. + /// + [Newtonsoft.Json.JsonProperty("unit", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public DimensionsUnit Unit { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// A list of codes used to provide additional shipment information. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum DetailCodes + { + + [System.Runtime.Serialization.EnumMember(Value = @"BusinessClosed")] + BusinessClosed = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"CustomerUnavailable")] + CustomerUnavailable = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"PaymentNotReady")] + PaymentNotReady = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"OtpNotAvailable")] + OtpNotAvailable = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"DeliveryAttempted")] + DeliveryAttempted = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"UnableToAccess")] + UnableToAccess = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"UnableToContactRecipient")] + UnableToContactRecipient = 6, + + [System.Runtime.Serialization.EnumMember(Value = @"DeliveredToBehindWheelieBin")] + DeliveredToBehindWheelieBin = 7, + + [System.Runtime.Serialization.EnumMember(Value = @"DeliveredToPorch")] + DeliveredToPorch = 8, + + [System.Runtime.Serialization.EnumMember(Value = @"DeliveredToGarage")] + DeliveredToGarage = 9, + + [System.Runtime.Serialization.EnumMember(Value = @"DeliveredToGarden")] + DeliveredToGarden = 10, + + [System.Runtime.Serialization.EnumMember(Value = @"DeliveredToGreenhouse")] + DeliveredToGreenhouse = 11, + + [System.Runtime.Serialization.EnumMember(Value = @"DeliveredToMailSlot")] + DeliveredToMailSlot = 12, + + [System.Runtime.Serialization.EnumMember(Value = @"DeliveredToMailRoom")] + DeliveredToMailRoom = 13, + + [System.Runtime.Serialization.EnumMember(Value = @"DeliveredToNeighbor")] + DeliveredToNeighbor = 14, + + [System.Runtime.Serialization.EnumMember(Value = @"DeliveredToRearDoor")] + DeliveredToRearDoor = 15, + + [System.Runtime.Serialization.EnumMember(Value = @"DeliveredToReceptionist")] + DeliveredToReceptionist = 16, + + [System.Runtime.Serialization.EnumMember(Value = @"DeliveredToShed")] + DeliveredToShed = 17, + + [System.Runtime.Serialization.EnumMember(Value = @"DeliveredWithOTP")] + DeliveredWithOTP = 18, + + [System.Runtime.Serialization.EnumMember(Value = @"Signed")] + Signed = 19, + + [System.Runtime.Serialization.EnumMember(Value = @"Damaged")] + Damaged = 20, + + [System.Runtime.Serialization.EnumMember(Value = @"IncorrectItems")] + IncorrectItems = 21, + + [System.Runtime.Serialization.EnumMember(Value = @"NotRequired")] + NotRequired = 22, + + [System.Runtime.Serialization.EnumMember(Value = @"Rejected")] + Rejected = 23, + + [System.Runtime.Serialization.EnumMember(Value = @"RejectedByRecipientWithVerification")] + RejectedByRecipientWithVerification = 24, + + [System.Runtime.Serialization.EnumMember(Value = @"CancelledByRecipient")] + CancelledByRecipient = 25, + + [System.Runtime.Serialization.EnumMember(Value = @"AddressNotFound")] + AddressNotFound = 26, + + [System.Runtime.Serialization.EnumMember(Value = @"HazmatShipment")] + HazmatShipment = 27, + + [System.Runtime.Serialization.EnumMember(Value = @"Undeliverable")] + Undeliverable = 28, + + [System.Runtime.Serialization.EnumMember(Value = @"ArrivedAtLocalFacility")] + ArrivedAtLocalFacility = 29, + + } + + /// + /// Contains detail codes that provide additional details related to the forward and return leg of the shipment. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class TrackingDetailCodes + { + /// + /// Contains detail codes that provide additional details related to the forward leg of the shipment. + /// + [Newtonsoft.Json.JsonProperty("forward", Required = Newtonsoft.Json.Required.Always, ItemConverterType = typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [System.ComponentModel.DataAnnotations.Required] + public System.Collections.Generic.ICollection Forward { get; set; } = new System.Collections.ObjectModel.Collection(); + + /// + /// Contains detail codes that provide additional details related to the return leg of the shipment. + /// + [Newtonsoft.Json.JsonProperty("returns", Required = Newtonsoft.Json.Required.Always, ItemConverterType = typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [System.ComponentModel.DataAnnotations.Required] + public System.Collections.Generic.ICollection Returns { get; set; } = new System.Collections.ObjectModel.Collection(); + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The shipper instruction. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class ShipperInstruction + { + /// + /// The delivery notes for the shipment + /// + [Newtonsoft.Json.JsonProperty("deliveryNotes", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(256)] + public string DeliveryNotes { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The address. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class Address + { + /// + /// The name of the person, business or institution at the address. + /// + [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.StringLength(50, MinimumLength = 1)] + public string Name { get; set; } + + /// + /// The first line of the address. + /// + [Newtonsoft.Json.JsonProperty("addressLine1", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.StringLength(60, MinimumLength = 1)] + public string AddressLine1 { get; set; } + + /// + /// Additional address information, if required. + /// + [Newtonsoft.Json.JsonProperty("addressLine2", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(60, MinimumLength = 1)] + public string AddressLine2 { get; set; } + + /// + /// Additional address information, if required. + /// + [Newtonsoft.Json.JsonProperty("addressLine3", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(60, MinimumLength = 1)] + public string AddressLine3 { get; set; } + + /// + /// The name of the business or institution associated with the address. + /// + [Newtonsoft.Json.JsonProperty("companyName", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string CompanyName { get; set; } + + [Newtonsoft.Json.JsonProperty("stateOrRegion", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string StateOrRegion { get; set; } + + [Newtonsoft.Json.JsonProperty("city", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string City { get; set; } + + [Newtonsoft.Json.JsonProperty("countryCode", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string CountryCode { get; set; } + + [Newtonsoft.Json.JsonProperty("postalCode", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string PostalCode { get; set; } + + /// + /// The email address of the contact associated with the address. + /// + [Newtonsoft.Json.JsonProperty("email", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(64)] + public string Email { get; set; } + + /// + /// The phone number of the person, business or institution located at that address, including the country calling code. + /// + [Newtonsoft.Json.JsonProperty("phoneNumber", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(20, MinimumLength = 1)] + public string PhoneNumber { get; set; } + + [Newtonsoft.Json.JsonProperty("geocode", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Geocode Geocode { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Defines the latitude and longitude of the access point. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class Geocode + { + /// + /// The latitude of access point. + /// + [Newtonsoft.Json.JsonProperty("latitude", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Latitude { get; set; } + + /// + /// The longitude of access point. + /// + [Newtonsoft.Json.JsonProperty("longitude", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Longitude { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The location where the person, business or institution is located. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class Location + { + [Newtonsoft.Json.JsonProperty("stateOrRegion", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string StateOrRegion { get; set; } + + [Newtonsoft.Json.JsonProperty("city", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string City { get; set; } + + [Newtonsoft.Json.JsonProperty("countryCode", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string CountryCode { get; set; } + + [Newtonsoft.Json.JsonProperty("postalCode", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string PostalCode { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The file format of the document. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum DocumentFormat + { + + [System.Runtime.Serialization.EnumMember(Value = @"PDF")] + PDF = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"PNG")] + PNG = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"ZPL")] + ZPL = 2, + + } + + /// + /// The type of shipping document. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum DocumentType + { + + [System.Runtime.Serialization.EnumMember(Value = @"PACKSLIP")] + PACKSLIP = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"LABEL")] + LABEL = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"RECEIPT")] + RECEIPT = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"CUSTOM_FORM")] + CUSTOM_FORM = 3, + + } + + /// + /// Object contains customised data requested by a shipper to be printed on a shipping label. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class RequestedLabelCustomization + { + [Newtonsoft.Json.JsonProperty("requestAttributes", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ItemConverterType = typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public RequestAttributes RequestAttributes { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Specify the type of attributes to be added on a label. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class RequestAttributes : System.Collections.ObjectModel.Collection + { + + } + + /// + /// Enumerates the attributes supported to be printed on a shipping label. The values for these attributes are retrieved from GetRates/OneClickShipment request + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum LabelAttribute + { + + [System.Runtime.Serialization.EnumMember(Value = @"PACKAGE_CLIENT_REFERENCE_ID")] + PACKAGE_CLIENT_REFERENCE_ID = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"SELLER_DISPLAY_NAME")] + SELLER_DISPLAY_NAME = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"COLLECT_ON_DELIVERY_AMOUNT")] + COLLECT_ON_DELIVERY_AMOUNT = 2, + + } + + /// + /// A list of documents related to a package. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class PackageDocumentList : System.Collections.ObjectModel.Collection + { + + } + + /// + /// A document related to a package. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class PackageDocument + { + [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public DocumentType Type { get; set; } + + [Newtonsoft.Json.JsonProperty("format", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public DocumentFormat Format { get; set; } + + [Newtonsoft.Json.JsonProperty("contents", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string Contents { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// A list of the format options for a label. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class PrintOptionList : System.Collections.ObjectModel.Collection + { + + } + + /// + /// The format options available for a label. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class PrintOption + { + /// + /// A list of the supported DPI options for a document. + /// + [Newtonsoft.Json.JsonProperty("supportedDPIs", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection SupportedDPIs { get; set; } + + /// + /// A list of the supported page layout options for a document. + /// + [Newtonsoft.Json.JsonProperty("supportedPageLayouts", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public System.Collections.Generic.ICollection SupportedPageLayouts { get; set; } = new System.Collections.ObjectModel.Collection(); + + /// + /// A list of the supported needFileJoining boolean values for a document. + /// + [Newtonsoft.Json.JsonProperty("supportedFileJoiningOptions", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public System.Collections.Generic.ICollection SupportedFileJoiningOptions { get; set; } = new System.Collections.ObjectModel.Collection(); + + /// + /// A list of the supported documented details. + /// + [Newtonsoft.Json.JsonProperty("supportedDocumentDetails", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public System.Collections.Generic.ICollection SupportedDocumentDetails { get; set; } = new System.Collections.ObjectModel.Collection(); + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The size dimensions of the label. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class DocumentSize + { + /// + /// The width of the document measured in the units specified. + /// + [Newtonsoft.Json.JsonProperty("width", Required = Newtonsoft.Json.Required.Always)] + public double Width { get; set; } + + /// + /// The length of the document measured in the units specified. + /// + [Newtonsoft.Json.JsonProperty("length", Required = Newtonsoft.Json.Required.Always)] + public double Length { get; set; } + + /// + /// The unit of measurement. + /// + [Newtonsoft.Json.JsonProperty("unit", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public DocumentSizeUnit Unit { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The supported document types for a service offering. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class SupportedDocumentDetail + { + [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public DocumentType Name { get; set; } + + /// + /// When true, the supported document type is required. + /// + [Newtonsoft.Json.JsonProperty("isMandatory", Required = Newtonsoft.Json.Required.Always)] + public bool IsMandatory { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The document specifications requested. For calls to the purchaseShipment operation, the shipment purchase fails if the specified document specifications are not among those returned in the response to the getRates operation. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class RequestedDocumentSpecification + { + [Newtonsoft.Json.JsonProperty("format", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public DocumentFormat Format { get; set; } + + [Newtonsoft.Json.JsonProperty("size", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public DocumentSize Size { get; set; } = new DocumentSize(); + + [Newtonsoft.Json.JsonProperty("dpi", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int Dpi { get; set; } + + [Newtonsoft.Json.JsonProperty("pageLayout", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string PageLayout { get; set; } + + [Newtonsoft.Json.JsonProperty("needFileJoining", Required = Newtonsoft.Json.Required.Always)] + public bool NeedFileJoining { get; set; } + + /// + /// A list of the document types requested. + /// + [Newtonsoft.Json.JsonProperty("requestedDocumentTypes", Required = Newtonsoft.Json.Required.Always, ItemConverterType = typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [System.ComponentModel.DataAnnotations.Required] + public System.Collections.Generic.ICollection RequestedDocumentTypes { get; set; } = new System.Collections.ObjectModel.Collection(); + + [Newtonsoft.Json.JsonProperty("requestedLabelCustomization", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public RequestedLabelCustomization RequestedLabelCustomization { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// A list of the document specifications supported for a shipment service offering. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class SupportedDocumentSpecificationList : System.Collections.ObjectModel.Collection + { + + } + + /// + /// Document specification that is supported for a service offering. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class SupportedDocumentSpecification + { + [Newtonsoft.Json.JsonProperty("format", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public DocumentFormat Format { get; set; } + + [Newtonsoft.Json.JsonProperty("size", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public DocumentSize Size { get; set; } = new DocumentSize(); + + [Newtonsoft.Json.JsonProperty("printOptions", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public PrintOptionList PrintOptions { get; set; } = new PrintOptionList(); + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// An item in a package. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class Item + { + [Newtonsoft.Json.JsonProperty("itemValue", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Currency ItemValue { get; set; } + + /// + /// The product description of the item. + /// + [Newtonsoft.Json.JsonProperty("description", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Description { get; set; } + + /// + /// A unique identifier for an item provided by the client. + /// + [Newtonsoft.Json.JsonProperty("itemIdentifier", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string ItemIdentifier { get; set; } + + /// + /// The number of units. This value is required. + /// + [Newtonsoft.Json.JsonProperty("quantity", Required = Newtonsoft.Json.Required.Always)] + public int Quantity { get; set; } + + [Newtonsoft.Json.JsonProperty("weight", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Weight Weight { get; set; } + + [Newtonsoft.Json.JsonProperty("liquidVolume", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public LiquidVolume LiquidVolume { get; set; } + + /// + /// When true, the item qualifies as hazardous materials (hazmat). Defaults to false. + /// + [Newtonsoft.Json.JsonProperty("isHazmat", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool IsHazmat { get; set; } + + [Newtonsoft.Json.JsonProperty("dangerousGoodsDetails", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public DangerousGoodsDetails DangerousGoodsDetails { get; set; } + + /// + /// The product type of the item. + /// + [Newtonsoft.Json.JsonProperty("productType", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string ProductType { get; set; } + + [Newtonsoft.Json.JsonProperty("invoiceDetails", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public InvoiceDetails InvoiceDetails { get; set; } + + /// + /// A list of unique serial numbers in an Amazon package that can be used to guarantee non-fraudulent items. The number of serial numbers in the list must be less than or equal to the quantity of items being shipped. Only applicable when channel source is Amazon. + /// + [Newtonsoft.Json.JsonProperty("serialNumbers", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection SerialNumbers { get; set; } + + [Newtonsoft.Json.JsonProperty("directFulfillmentItemIdentifiers", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public DirectFulfillmentItemIdentifiers DirectFulfillmentItemIdentifiers { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// A list of items. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class ItemList : System.Collections.ObjectModel.Collection + { + + } + + /// + /// A package to be shipped through a shipping service offering. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class Package + { + [Newtonsoft.Json.JsonProperty("dimensions", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public Dimensions Dimensions { get; set; } = new Dimensions(); + + [Newtonsoft.Json.JsonProperty("weight", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public Weight Weight { get; set; } = new Weight(); + + [Newtonsoft.Json.JsonProperty("insuredValue", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public Currency InsuredValue { get; set; } = new Currency(); + + /// + /// When true, the package contains hazardous materials. Defaults to false. + /// + [Newtonsoft.Json.JsonProperty("isHazmat", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool IsHazmat { get; set; } + + /// + /// The seller name displayed on the label. + /// + [Newtonsoft.Json.JsonProperty("sellerDisplayName", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string SellerDisplayName { get; set; } + + [Newtonsoft.Json.JsonProperty("charges", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public ChargeList Charges { get; set; } + + [Newtonsoft.Json.JsonProperty("packageClientReferenceId", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string PackageClientReferenceId { get; set; } + + [Newtonsoft.Json.JsonProperty("items", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public ItemList Items { get; set; } = new ItemList(); + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// A list of packages to be shipped through a shipping service offering. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class PackageList : System.Collections.ObjectModel.Collection + { + + } + + /// + /// Item identifiers for an item in a direct fulfillment shipment. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class DirectFulfillmentItemIdentifiers + { + /// + /// A unique identifier for an item provided by the client for a direct fulfillment shipment. This is only populated for direct fulfillment multi-piece shipments. It is required if a vendor wants to change the configuration of the packages in which the purchase order is shipped. + /// + [Newtonsoft.Json.JsonProperty("lineItemID", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string LineItemID { get; set; } + + /// + /// A unique identifier for an item provided by the client for a direct fulfillment shipment. This is only populated if a single line item has multiple pieces. Defaults to 1. + /// + [Newtonsoft.Json.JsonProperty("pieceNumber", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string PieceNumber { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The post-purchase details of a package that will be shipped using a shipping service. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class PackageDocumentDetail + { + [Newtonsoft.Json.JsonProperty("packageClientReferenceId", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string PackageClientReferenceId { get; set; } + + [Newtonsoft.Json.JsonProperty("packageDocuments", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public PackageDocumentList PackageDocuments { get; set; } = new PackageDocumentList(); + + [Newtonsoft.Json.JsonProperty("trackingId", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string TrackingId { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// A list of post-purchase details about a package that will be shipped using a shipping service. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class PackageDocumentDetailList : System.Collections.ObjectModel.Collection + { + + } + + /// + /// The start and end time that specifies the time interval of an event. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class TimeWindow + { + /// + /// The start time of the time window. + /// + [Newtonsoft.Json.JsonProperty("start", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.DateTimeOffset Start { get; set; } + + /// + /// The end time of the time window. + /// + [Newtonsoft.Json.JsonProperty("end", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.DateTimeOffset End { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The time windows promised for pickup and delivery events. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class Promise + { + [Newtonsoft.Json.JsonProperty("deliveryWindow", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public TimeWindow DeliveryWindow { get; set; } + + [Newtonsoft.Json.JsonProperty("pickupWindow", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public TimeWindow PickupWindow { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The value-added services to be added to a shipping service purchase. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class RequestedValueAddedServiceList : System.Collections.ObjectModel.Collection + { + + } + + /// + /// A value-added service to be applied to a shipping service purchase. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class RequestedValueAddedService + { + /// + /// The identifier of the selected value-added service. Must be among those returned in the response to the getRates operation. + /// + [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string Id { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// A list of value-added services available for a shipping service offering. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class AvailableValueAddedServiceGroupList : System.Collections.ObjectModel.Collection + { + + } + + /// + /// The value-added services available for purchase with a shipping service offering. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class AvailableValueAddedServiceGroup + { + /// + /// The type of the value-added service group. + /// + [Newtonsoft.Json.JsonProperty("groupId", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string GroupId { get; set; } + + /// + /// The name of the value-added service group. + /// + [Newtonsoft.Json.JsonProperty("groupDescription", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string GroupDescription { get; set; } + + /// + /// When true, one or more of the value-added services listed must be specified. + /// + [Newtonsoft.Json.JsonProperty("isRequired", Required = Newtonsoft.Json.Required.Always)] + public bool IsRequired { get; set; } + + /// + /// A list of optional value-added services available for purchase with a shipping service offering. + /// + [Newtonsoft.Json.JsonProperty("valueAddedServices", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection ValueAddedServices { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// A value-added service available for purchase with a shipment service offering. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class ValueAddedService + { + /// + /// The identifier for the value-added service. + /// + [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string Id { get; set; } + + /// + /// The name of the value-added service. + /// + [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string Name { get; set; } + + [Newtonsoft.Json.JsonProperty("cost", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public Currency Cost { get; set; } = new Currency(); + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The amount to collect on delivery. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class CollectOnDelivery + { + [Newtonsoft.Json.JsonProperty("amount", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public Currency Amount { get; set; } = new Currency(); + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// A collection of supported value-added services. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class ValueAddedServiceDetails + { + [Newtonsoft.Json.JsonProperty("collectOnDelivery", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public CollectOnDelivery CollectOnDelivery { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Details related to any dangerous goods/items that are being shipped. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class DangerousGoodsDetails + { + /// + /// The specific UNID of the item being shipped. + /// + [Newtonsoft.Json.JsonProperty("unitedNationsRegulatoryId", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^(UN|ID|NA)[0-9]{4}$")] + public string UnitedNationsRegulatoryId { get; set; } + + /// + /// The specific regulatory class of the item being shipped. + /// + [Newtonsoft.Json.JsonProperty("transportationRegulatoryClass", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[1-9](\.[1-9])?$")] + public string TransportationRegulatoryClass { get; set; } + + /// + /// The specific packaging group of the item being shipped. + /// + [Newtonsoft.Json.JsonProperty("packingGroup", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public DangerousGoodsDetailsPackingGroup PackingGroup { get; set; } + + /// + /// The specific packing instruction of the item being shipped. + /// + [Newtonsoft.Json.JsonProperty("packingInstruction", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public DangerousGoodsDetailsPackingInstruction PackingInstruction { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Indicates the type of tax. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum TaxType + { + + [System.Runtime.Serialization.EnumMember(Value = @"GST")] + GST = 0, + + } + + /// + /// Indicates the tax specifications associated with the shipment for customs compliance purposes in certain regions. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class TaxDetail + { + [Newtonsoft.Json.JsonProperty("taxType", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public TaxType TaxType { get; set; } + + /// + /// The shipper's tax registration number associated with the shipment for customs compliance purposes in certain regions. + /// + [Newtonsoft.Json.JsonProperty("taxRegistrationNumber", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string TaxRegistrationNumber { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// A list of tax detail information. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class TaxDetailList : System.Collections.ObjectModel.Collection + { + + } + + /// + /// The tracking event type. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum EventCode + { + + [System.Runtime.Serialization.EnumMember(Value = @"ReadyForReceive")] + ReadyForReceive = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"PickupDone")] + PickupDone = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"Delivered")] + Delivered = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"Departed")] + Departed = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"DeliveryAttempted")] + DeliveryAttempted = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"Lost")] + Lost = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"OutForDelivery")] + OutForDelivery = 6, + + [System.Runtime.Serialization.EnumMember(Value = @"ArrivedAtCarrierFacility")] + ArrivedAtCarrierFacility = 7, + + [System.Runtime.Serialization.EnumMember(Value = @"Rejected")] + Rejected = 8, + + [System.Runtime.Serialization.EnumMember(Value = @"Undeliverable")] + Undeliverable = 9, + + [System.Runtime.Serialization.EnumMember(Value = @"PickupCancelled")] + PickupCancelled = 10, + + [System.Runtime.Serialization.EnumMember(Value = @"ReturnInitiated")] + ReturnInitiated = 11, + + [System.Runtime.Serialization.EnumMember(Value = @"AvailableForPickup")] + AvailableForPickup = 12, + + [System.Runtime.Serialization.EnumMember(Value = @"RecipientRequestedAlternateDeliveryTiming")] + RecipientRequestedAlternateDeliveryTiming = 13, + + } + + /// + /// A tracking event. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class Event + { + [Newtonsoft.Json.JsonProperty("eventCode", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public EventCode EventCode { get; set; } + + [Newtonsoft.Json.JsonProperty("location", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Location Location { get; set; } + + /// + /// The ISO 8601 formatted timestamp of the event. + /// + [Newtonsoft.Json.JsonProperty("eventTime", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public System.DateTimeOffset EventTime { get; set; } + + [Newtonsoft.Json.JsonProperty("shipmentType", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public ShipmentType ShipmentType { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// A package status summary. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class TrackingSummary + { + [Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public Status Status { get; set; } + + [Newtonsoft.Json.JsonProperty("trackingDetailCodes", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public TrackingDetailCodes TrackingDetailCodes { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The status of the package being shipped. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum Status + { + + [System.Runtime.Serialization.EnumMember(Value = @"PreTransit")] + PreTransit = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"InTransit")] + InTransit = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"Delivered")] + Delivered = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"Lost")] + Lost = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"OutForDelivery")] + OutForDelivery = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"Rejected")] + Rejected = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"Undeliverable")] + Undeliverable = 6, + + [System.Runtime.Serialization.EnumMember(Value = @"DeliveryAttempted")] + DeliveryAttempted = 7, + + [System.Runtime.Serialization.EnumMember(Value = @"PickupCancelled")] + PickupCancelled = 8, + + [System.Runtime.Serialization.EnumMember(Value = @"AwaitingCustomerPickup")] + AwaitingCustomerPickup = 9, + + } + + /// + /// Amazon order information. This is required if the shipment source channel is Amazon. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class AmazonOrderDetails + { + /// + /// The Amazon order ID associated with the Amazon order fulfilled by this shipment. + /// + [Newtonsoft.Json.JsonProperty("orderId", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string OrderId { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Amazon shipment information. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class AmazonShipmentDetails + { + /// + /// This attribute is required only for a Direct Fulfillment shipment. This is the encrypted shipment ID. + /// + [Newtonsoft.Json.JsonProperty("shipmentId", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string ShipmentId { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The shipment source channel type. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum ChannelType + { + + [System.Runtime.Serialization.EnumMember(Value = @"AMAZON")] + AMAZON = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"EXTERNAL")] + EXTERNAL = 1, + + } + + /// + /// Shipment source channel related information. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class ChannelDetails + { + [Newtonsoft.Json.JsonProperty("channelType", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public ChannelType ChannelType { get; set; } + + [Newtonsoft.Json.JsonProperty("amazonOrderDetails", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public AmazonOrderDetails AmazonOrderDetails { get; set; } + + [Newtonsoft.Json.JsonProperty("amazonShipmentDetails", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public AmazonShipmentDetails AmazonShipmentDetails { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// A list of eligible shipping service offerings. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class RateList : System.Collections.ObjectModel.Collection + { + + } + + /// + /// The details of a shipping service offering. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class Rate + { + [Newtonsoft.Json.JsonProperty("rateId", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string RateId { get; set; } + + [Newtonsoft.Json.JsonProperty("carrierId", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string CarrierId { get; set; } + + [Newtonsoft.Json.JsonProperty("carrierName", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string CarrierName { get; set; } + + [Newtonsoft.Json.JsonProperty("serviceId", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string ServiceId { get; set; } + + [Newtonsoft.Json.JsonProperty("serviceName", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string ServiceName { get; set; } + + [Newtonsoft.Json.JsonProperty("billedWeight", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Weight BilledWeight { get; set; } + + [Newtonsoft.Json.JsonProperty("totalCharge", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public Currency TotalCharge { get; set; } = new Currency(); + + [Newtonsoft.Json.JsonProperty("promise", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public Promise Promise { get; set; } = new Promise(); + + [Newtonsoft.Json.JsonProperty("supportedDocumentSpecifications", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public SupportedDocumentSpecificationList SupportedDocumentSpecifications { get; set; } = new SupportedDocumentSpecificationList(); + + [Newtonsoft.Json.JsonProperty("availableValueAddedServiceGroups", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public AvailableValueAddedServiceGroupList AvailableValueAddedServiceGroups { get; set; } + + /// + /// When true, indicates that additional inputs are required to purchase this shipment service. You must then call the getAdditionalInputs operation to return the JSON schema to use when providing the additional inputs to the purchaseShipment operation. + /// + [Newtonsoft.Json.JsonProperty("requiresAdditionalInputs", Required = Newtonsoft.Json.Required.Always)] + public bool RequiresAdditionalInputs { get; set; } + + [Newtonsoft.Json.JsonProperty("rateItemList", Required = Newtonsoft.Json.Required.AllowNull, DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Ignore, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public RateItemList RateItemList { get; set; } + + [Newtonsoft.Json.JsonProperty("paymentType", Required = Newtonsoft.Json.Required.AllowNull, DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Ignore, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public PaymentType PaymentType { get; set; } + + [Newtonsoft.Json.JsonProperty("benefits", Required = Newtonsoft.Json.Required.AllowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Benefits Benefits { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Reasons that make a shipment service offering ineligible. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum IneligibilityReasonCode + { + + [System.Runtime.Serialization.EnumMember(Value = @"NO_COVERAGE")] + NO_COVERAGE = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"PICKUP_SLOT_RESTRICTION")] + PICKUP_SLOT_RESTRICTION = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"UNSUPPORTED_VAS")] + UNSUPPORTED_VAS = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"VAS_COMBINATION_RESTRICTION")] + VAS_COMBINATION_RESTRICTION = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"SIZE_RESTRICTIONS")] + SIZE_RESTRICTIONS = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"WEIGHT_RESTRICTIONS")] + WEIGHT_RESTRICTIONS = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"LATE_DELIVERY")] + LATE_DELIVERY = 6, + + [System.Runtime.Serialization.EnumMember(Value = @"PROGRAM_CONSTRAINTS")] + PROGRAM_CONSTRAINTS = 7, + + [System.Runtime.Serialization.EnumMember(Value = @"TERMS_AND_CONDITIONS_NOT_ACCEPTED")] + TERMS_AND_CONDITIONS_NOT_ACCEPTED = 8, + + [System.Runtime.Serialization.EnumMember(Value = @"UNKNOWN")] + UNKNOWN = 9, + + } + + /// + /// The reason why a shipping service offering is ineligible. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class IneligibilityReason + { + [Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public IneligibilityReasonCode Code { get; set; } + + /// + /// The ineligibility reason. + /// + [Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string Message { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Detailed information for an ineligible shipping service offering. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class IneligibleRate + { + [Newtonsoft.Json.JsonProperty("serviceId", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string ServiceId { get; set; } + + [Newtonsoft.Json.JsonProperty("serviceName", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string ServiceName { get; set; } + + [Newtonsoft.Json.JsonProperty("carrierName", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string CarrierName { get; set; } + + [Newtonsoft.Json.JsonProperty("carrierId", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string CarrierId { get; set; } + + /// + /// A list of reasons why a shipping service offering is ineligible. + /// + [Newtonsoft.Json.JsonProperty("ineligibilityReasons", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public System.Collections.Generic.ICollection IneligibilityReasons { get; set; } = new System.Collections.ObjectModel.Collection(); + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// A list of ineligible shipping service offerings. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class IneligibleRateList : System.Collections.ObjectModel.Collection + { + + } + + /// + /// The payload for the cancelShipment operation. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class CancelShipmentResult : System.Collections.Generic.Dictionary + { + + } + + /// + /// Response schema for the cancelShipment operation. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class CancelShipmentResponse + { + [Newtonsoft.Json.JsonProperty("payload", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public CancelShipmentResult Payload { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The request schema for the getRates operation. When the channelType is Amazon, the shipTo address is not required and will be ignored. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class GetRatesRequest + { + [Newtonsoft.Json.JsonProperty("shipTo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Address ShipTo { get; set; } + + [Newtonsoft.Json.JsonProperty("shipFrom", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public Address ShipFrom { get; set; } = new Address(); + + [Newtonsoft.Json.JsonProperty("returnTo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Address ReturnTo { get; set; } + + /// + /// The ship date and time (the requested pickup). This defaults to the current date and time. + /// + [Newtonsoft.Json.JsonProperty("shipDate", Required = Newtonsoft.Json.Required.AllowNull, DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Ignore, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string ShipDate { get; set; } + + [Newtonsoft.Json.JsonProperty("shipperInstruction", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public ShipperInstruction ShipperInstruction { get; set; } + + [Newtonsoft.Json.JsonProperty("packages", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public PackageList Packages { get; set; } = new PackageList(); + + [Newtonsoft.Json.JsonProperty("valueAddedServices", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public ValueAddedServiceDetails ValueAddedServices { get; set; } + + [Newtonsoft.Json.JsonProperty("taxDetails", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public TaxDetailList TaxDetails { get; set; } + + [Newtonsoft.Json.JsonProperty("channelDetails", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public ChannelDetails ChannelDetails { get; set; } = new ChannelDetails(); + + [Newtonsoft.Json.JsonProperty("clientReferenceDetails", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public ClientReferenceDetails ClientReferenceDetails { get; set; } + + [Newtonsoft.Json.JsonProperty("shipmentType", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public ShipmentType ShipmentType { get; set; } + + [Newtonsoft.Json.JsonProperty("destinationAccessPointDetails", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public AccessPointDetails DestinationAccessPointDetails { get; set; } + + [Newtonsoft.Json.JsonProperty("carrierAccounts", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public CarrierAccounts CarrierAccounts { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// AccessPointDetails object + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class AccessPointDetails + { + [Newtonsoft.Json.JsonProperty("accessPointId", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string AccessPointId { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The type of NDR action shipper wants to take for a particular shipment. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum NdrAction + { + + [System.Runtime.Serialization.EnumMember(Value = @"RESCHEDULE")] + RESCHEDULE = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"REATTEMPT")] + REATTEMPT = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"RTO")] + RTO = 2, + + } + + /// + /// Additional information required for the NDR action that has been filed. If the NDR Action is RESCHEDULE, rescheduleDate is a required field. Otherwise, if the NDR Action is REATTEMPT, additionalAddressNotes is a required field. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class NdrRequestData + { + /// + /// The date on which the Seller wants to reschedule shipment delivery, in ISO-8601 date/time format + /// + [Newtonsoft.Json.JsonProperty("rescheduleDate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.DateTimeOffset RescheduleDate { get; set; } + + [Newtonsoft.Json.JsonProperty("additionalAddressNotes", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(256)] + public string AdditionalAddressNotes { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The payload for the getRates operation. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class GetRatesResult + { + [Newtonsoft.Json.JsonProperty("requestToken", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string RequestToken { get; set; } + + [Newtonsoft.Json.JsonProperty("rates", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public RateList Rates { get; set; } = new RateList(); + + [Newtonsoft.Json.JsonProperty("ineligibleRates", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public IneligibleRateList IneligibleRates { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The response schema for the getRates operation. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class GetRatesResponse + { + [Newtonsoft.Json.JsonProperty("payload", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public GetRatesResult Payload { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The payload for the getShipmentDocuments operation. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class GetShipmentDocumentsResult + { + [Newtonsoft.Json.JsonProperty("shipmentId", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string ShipmentId { get; set; } + + [Newtonsoft.Json.JsonProperty("packageDocumentDetail", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public PackageDocumentDetail PackageDocumentDetail { get; set; } = new PackageDocumentDetail(); + + [Newtonsoft.Json.JsonProperty("benefits", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Benefits Benefits { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The response schema for the the getShipmentDocuments operation. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class GetShipmentDocumentsResponse + { + [Newtonsoft.Json.JsonProperty("payload", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public GetShipmentDocumentsResult Payload { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The payload for the getTracking operation. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class GetTrackingResult + { + [Newtonsoft.Json.JsonProperty("trackingId", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string TrackingId { get; set; } + + [Newtonsoft.Json.JsonProperty("alternateLegTrackingId", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string AlternateLegTrackingId { get; set; } + + /// + /// A list of tracking events. + /// + [Newtonsoft.Json.JsonProperty("eventHistory", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public System.Collections.Generic.ICollection EventHistory { get; set; } = new System.Collections.ObjectModel.Collection(); + + /// + /// The date and time by which the shipment is promised to be delivered. + /// + [Newtonsoft.Json.JsonProperty("promisedDeliveryDate", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public System.DateTimeOffset PromisedDeliveryDate { get; set; } + + [Newtonsoft.Json.JsonProperty("summary", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public TrackingSummary Summary { get; set; } = new TrackingSummary(); + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The request schema for the NdrFeedback operation + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class SubmitNdrFeedbackRequest + { + [Newtonsoft.Json.JsonProperty("trackingId", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string TrackingId { get; set; } + + [Newtonsoft.Json.JsonProperty("ndrAction", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public NdrAction NdrAction { get; set; } + + [Newtonsoft.Json.JsonProperty("ndrRequestData", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public NdrRequestData NdrRequestData { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The response schema for the getTracking operation. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class GetTrackingResponse + { + [Newtonsoft.Json.JsonProperty("payload", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public GetTrackingResult Payload { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The request schema for the purchaseShipment operation. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class PurchaseShipmentRequest + { + [Newtonsoft.Json.JsonProperty("requestToken", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string RequestToken { get; set; } + + [Newtonsoft.Json.JsonProperty("rateId", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string RateId { get; set; } + + [Newtonsoft.Json.JsonProperty("requestedDocumentSpecification", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public RequestedDocumentSpecification RequestedDocumentSpecification { get; set; } = new RequestedDocumentSpecification(); + + [Newtonsoft.Json.JsonProperty("requestedValueAddedServices", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public RequestedValueAddedServiceList RequestedValueAddedServices { get; set; } + + /// + /// The additional inputs required to purchase a shipping offering, in JSON format. The JSON provided here must adhere to the JSON schema that is returned in the response to the getAdditionalInputs operation. + ///
+ ///
Additional inputs are only required when indicated by the requiresAdditionalInputs property in the response to the getRates operation. + ///
+ [Newtonsoft.Json.JsonProperty("additionalInputs", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.IDictionary AdditionalInputs { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The payload for the purchaseShipment operation. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class PurchaseShipmentResult + { + [Newtonsoft.Json.JsonProperty("shipmentId", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string ShipmentId { get; set; } + + [Newtonsoft.Json.JsonProperty("packageDocumentDetails", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public PackageDocumentDetailList PackageDocumentDetails { get; set; } = new PackageDocumentDetailList(); + + [Newtonsoft.Json.JsonProperty("promise", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public Promise Promise { get; set; } = new Promise(); + + [Newtonsoft.Json.JsonProperty("benefits", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Benefits Benefits { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The response schema for the purchaseShipment operation. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class PurchaseShipmentResponse + { + [Newtonsoft.Json.JsonProperty("payload", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public PurchaseShipmentResult Payload { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The request schema for the OneClickShipment operation. When the channelType is not Amazon, shipTo is required and when channelType is Amazon shipTo is ignored. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class OneClickShipmentRequest + { + [Newtonsoft.Json.JsonProperty("shipTo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Address ShipTo { get; set; } + + [Newtonsoft.Json.JsonProperty("shipFrom", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public Address ShipFrom { get; set; } = new Address(); + + [Newtonsoft.Json.JsonProperty("returnTo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Address ReturnTo { get; set; } + + /// + /// The ship date and time (the requested pickup). This defaults to the current date and time. + /// + [Newtonsoft.Json.JsonProperty("shipDate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.String ShipDate { get; set; } + + [Newtonsoft.Json.JsonProperty("packages", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public PackageList Packages { get; set; } = new PackageList(); + + [Newtonsoft.Json.JsonProperty("valueAddedServicesDetails", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public OneClickShipmentValueAddedServiceDetails ValueAddedServicesDetails { get; set; } + + [Newtonsoft.Json.JsonProperty("taxDetails", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public TaxDetailList TaxDetails { get; set; } + + [Newtonsoft.Json.JsonProperty("channelDetails", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public ChannelDetails ChannelDetails { get; set; } = new ChannelDetails(); + + [Newtonsoft.Json.JsonProperty("labelSpecifications", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public RequestedDocumentSpecification LabelSpecifications { get; set; } = new RequestedDocumentSpecification(); + + [Newtonsoft.Json.JsonProperty("serviceSelection", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public ServiceSelection ServiceSelection { get; set; } = new ServiceSelection(); + + [Newtonsoft.Json.JsonProperty("shipperInstruction", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public ShipperInstruction ShipperInstruction { get; set; } + + [Newtonsoft.Json.JsonProperty("destinationAccessPointDetails", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public AccessPointDetails DestinationAccessPointDetails { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The response schema for the OneClickShipment operation. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class OneClickShipmentResponse + { + [Newtonsoft.Json.JsonProperty("payload", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public OneClickShipmentResult Payload { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The payload for the OneClickShipment API. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class OneClickShipmentResult + { + [Newtonsoft.Json.JsonProperty("shipmentId", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string ShipmentId { get; set; } + + [Newtonsoft.Json.JsonProperty("packageDocumentDetails", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public PackageDocumentDetailList PackageDocumentDetails { get; set; } = new PackageDocumentDetailList(); + + [Newtonsoft.Json.JsonProperty("promise", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public Promise Promise { get; set; } = new Promise(); + + [Newtonsoft.Json.JsonProperty("carrier", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public Carrier Carrier { get; set; } = new Carrier(); + + [Newtonsoft.Json.JsonProperty("service", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public Service Service { get; set; } = new Service(); + + [Newtonsoft.Json.JsonProperty("totalCharge", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public Currency TotalCharge { get; set; } = new Currency(); + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The response schema for the GetAccessPoints operation. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class GetAccessPointsResponse + { + [Newtonsoft.Json.JsonProperty("payload", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public GetAccessPointsResult Payload { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The payload for the GetAccessPoints API. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class GetAccessPointsResult + { + [Newtonsoft.Json.JsonProperty("accessPointsMap", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public AccessPointsMap AccessPointsMap { get; set; } = new AccessPointsMap(); + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The type of access point, like counter (HELIX), lockers, etc. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum AccessPointType + { + + [System.Runtime.Serialization.EnumMember(Value = @"HELIX")] + HELIX = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"CAMPUS_LOCKER")] + CAMPUS_LOCKER = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"OMNI_LOCKER")] + OMNI_LOCKER = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"ODIN_LOCKER")] + ODIN_LOCKER = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"DOBBY_LOCKER")] + DOBBY_LOCKER = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"CORE_LOCKER")] + CORE_LOCKER = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"3P")] + _3P = 6, + + [System.Runtime.Serialization.EnumMember(Value = @"CAMPUS_ROOM")] + CAMPUS_ROOM = 7, + + } + + /// + /// Map of type of access point to list of access points + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class AccessPointsMap : System.Collections.Generic.Dictionary + { + + } + + /// + /// List of relevant Access points requested by shipper. These access points are sorted by proximity to postal code, and are limited to 40. We have internally defined a radius value to render relevant results. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class AccessPointList : System.Collections.ObjectModel.Collection + { + + } + + /// + /// Access point details + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class AccessPoint + { + [Newtonsoft.Json.JsonProperty("accessPointId", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string AccessPointId { get; set; } + + /// + /// Name of entity (store/hub etc) where this access point is located + /// + [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Name { get; set; } + + /// + /// Timezone of access point + /// + [Newtonsoft.Json.JsonProperty("timezone", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Timezone { get; set; } + + [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public AccessPointType Type { get; set; } + + [Newtonsoft.Json.JsonProperty("accessibilityAttributes", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public AccessibilityAttributes AccessibilityAttributes { get; set; } + + [Newtonsoft.Json.JsonProperty("address", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Address Address { get; set; } + + /// + /// Exception operating hours for Access Point + /// + [Newtonsoft.Json.JsonProperty("exceptionOperatingHours", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection ExceptionOperatingHours { get; set; } + + /// + /// Assistance type enum for Access point i.e. STAFF_ASSISTED or SELF_ASSISTED + /// + [Newtonsoft.Json.JsonProperty("assistanceType", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public AccessPointAssistanceType AssistanceType { get; set; } + + /// + /// The score of access point, based on proximity to postal code and sorting preference. This can be used to sort access point results on shipper's end. + /// + [Newtonsoft.Json.JsonProperty("score", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Score { get; set; } + + [Newtonsoft.Json.JsonProperty("standardOperatingHours", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public DayOfWeekTimeMap StandardOperatingHours { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Defines the accessibility details of the access point. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class AccessibilityAttributes + { + /// + /// The approximate distance of access point from input postalCode's centroid. + /// + [Newtonsoft.Json.JsonProperty("distance", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Distance { get; set; } + + /// + /// The approximate (static) drive time from input postal code's centroid. + /// + [Newtonsoft.Json.JsonProperty("driveTime", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int DriveTime { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The hours in which the access point shall remain operational + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class OperatingHours + { + [Newtonsoft.Json.JsonProperty("closingTime", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public TimeOfDay ClosingTime { get; set; } + + [Newtonsoft.Json.JsonProperty("openingTime", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public TimeOfDay OpeningTime { get; set; } + + /// + /// midDayClosures operating hours array + /// + [Newtonsoft.Json.JsonProperty("midDayClosures", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection MidDayClosures { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Denotes time of the day, used for defining opening or closing time of access points + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class TimeOfDay + { + /// + /// Denotes hour of the day, used for defining opening or closing time of access points + /// + [Newtonsoft.Json.JsonProperty("hourOfDay", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int HourOfDay { get; set; } + + /// + /// Denotes minute of the hour, used for defining opening or closing time of access points + /// + [Newtonsoft.Json.JsonProperty("minuteOfHour", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int MinuteOfHour { get; set; } + + /// + /// Denotes second of the minute, used for defining opening or closing time of access points + /// + [Newtonsoft.Json.JsonProperty("secondOfMinute", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int SecondOfMinute { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Map of day of the week to operating hours of that day + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class DayOfWeekTimeMap : System.Collections.Generic.Dictionary + { + + } + + /// + /// Defines exceptions to standard operating hours for certain date ranges. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class ExceptionOperatingHours + { + [Newtonsoft.Json.JsonProperty("dateRange", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public DateRange DateRange { get; set; } + + [Newtonsoft.Json.JsonProperty("operatingHours", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public OperatingHours OperatingHours { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// The JSON schema to use to provide additional inputs when required to purchase a shipping offering. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class GetAdditionalInputsResult : System.Collections.Generic.Dictionary + { + + } + + /// + /// The response schema for the getAdditionalInputs operation. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class GetAdditionalInputsResponse + { + [Newtonsoft.Json.JsonProperty("payload", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public GetAdditionalInputsResult Payload { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Object to pass additional information about the MCI Integrator shipperType: List of ClientReferenceDetail + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class ClientReferenceDetails : System.Collections.ObjectModel.Collection + { + + } + + /// + /// Client Reference Details + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class ClientReferenceDetail + { + /// + /// Client Reference type. + /// + [Newtonsoft.Json.JsonProperty("clientReferenceType", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public ClientReferenceDetailClientReferenceType ClientReferenceType { get; set; } + + /// + /// The Client Reference Id. + /// + [Newtonsoft.Json.JsonProperty("clientReferenceId", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string ClientReferenceId { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Shipment type. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum ShipmentType + { + + [System.Runtime.Serialization.EnumMember(Value = @"FORWARD")] + FORWARD = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"RETURNS")] + RETURNS = 1, + + } + + /// + /// A list of CarrierAccounts + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class CarrierAccounts : System.Collections.ObjectModel.Collection + { + + } + + /// + /// Carrier Account details used to fetch rates. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class CarrierAccount + { + [Newtonsoft.Json.JsonProperty("carrierAccountId", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string CarrierAccountId { get; set; } + + [Newtonsoft.Json.JsonProperty("carrierId", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string CarrierId { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Date Range for query the results. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class DateRange + { + /// + /// Start Date for query . + /// + [Newtonsoft.Json.JsonProperty("startDate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string StartDate { get; set; } + + /// + /// end date for query. + /// + [Newtonsoft.Json.JsonProperty("endDate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string EndDate { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Payment type of the purchase. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum PaymentType + { + + [System.Runtime.Serialization.EnumMember(Value = @"PAY_THROUGH_AMAZON")] + PAY_THROUGH_AMAZON = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"PAY_DIRECT_TO_CARRIER")] + PAY_DIRECT_TO_CARRIER = 1, + + } + + /// + /// A list of RateItem + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class RateItemList : System.Collections.ObjectModel.Collection + { + + } + + /// + /// Rate Item for shipping (base cost, transaction fee, confirmation, insurance, etc.) Data source definition: + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class RateItem + { + [Newtonsoft.Json.JsonProperty("rateItemID", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public RateItemID RateItemID { get; set; } + + [Newtonsoft.Json.JsonProperty("rateItemType", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public RateItemType RateItemType { get; set; } + + [Newtonsoft.Json.JsonProperty("rateItemCharge", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Currency RateItemCharge { get; set; } + + /// + /// Used for the localization. + /// + [Newtonsoft.Json.JsonProperty("rateItemNameLocalization", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string RateItemNameLocalization { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Unique ID for the rateItem. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum RateItemID + { + + [System.Runtime.Serialization.EnumMember(Value = @"BASE_RATE")] + BASE_RATE = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"TRANSACTION_FEE")] + TRANSACTION_FEE = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"ADULT_SIGNATURE_CONFIRMATION")] + ADULT_SIGNATURE_CONFIRMATION = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"SIGNATURE_CONFIRMATION")] + SIGNATURE_CONFIRMATION = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"NO_CONFIRMATION")] + NO_CONFIRMATION = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"WAIVE_SIGNATURE")] + WAIVE_SIGNATURE = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"IMPLIED_LIABILITY")] + IMPLIED_LIABILITY = 6, + + [System.Runtime.Serialization.EnumMember(Value = @"HIDDEN_POSTAGE")] + HIDDEN_POSTAGE = 7, + + [System.Runtime.Serialization.EnumMember(Value = @"DECLARED_VALUE")] + DECLARED_VALUE = 8, + + [System.Runtime.Serialization.EnumMember(Value = @"SUNDAY_HOLIDAY_DELIVERY")] + SUNDAY_HOLIDAY_DELIVERY = 9, + + [System.Runtime.Serialization.EnumMember(Value = @"DELIVERY_CONFIRMATION")] + DELIVERY_CONFIRMATION = 10, + + [System.Runtime.Serialization.EnumMember(Value = @"IMPORT_DUTY_CHARGE")] + IMPORT_DUTY_CHARGE = 11, + + [System.Runtime.Serialization.EnumMember(Value = @"VAT")] + VAT = 12, + + [System.Runtime.Serialization.EnumMember(Value = @"NO_SATURDAY_DELIVERY")] + NO_SATURDAY_DELIVERY = 13, + + [System.Runtime.Serialization.EnumMember(Value = @"INSURANCE")] + INSURANCE = 14, + + [System.Runtime.Serialization.EnumMember(Value = @"COD")] + COD = 15, + + [System.Runtime.Serialization.EnumMember(Value = @"FUEL_SURCHARGE")] + FUEL_SURCHARGE = 16, + + [System.Runtime.Serialization.EnumMember(Value = @"INSPECTION_CHARGE")] + INSPECTION_CHARGE = 17, + + [System.Runtime.Serialization.EnumMember(Value = @"DELIVERY_AREA_SURCHARGE")] + DELIVERY_AREA_SURCHARGE = 18, + + [System.Runtime.Serialization.EnumMember(Value = @"WAYBILL_CHARGE")] + WAYBILL_CHARGE = 19, + + [System.Runtime.Serialization.EnumMember(Value = @"AMAZON_SPONSORED_DISCOUNT")] + AMAZON_SPONSORED_DISCOUNT = 20, + + [System.Runtime.Serialization.EnumMember(Value = @"INTEGRATOR_SPONSORED_DISCOUNT")] + INTEGRATOR_SPONSORED_DISCOUNT = 21, + + [System.Runtime.Serialization.EnumMember(Value = @"OVERSIZE_SURCHARGE")] + OVERSIZE_SURCHARGE = 22, + + [System.Runtime.Serialization.EnumMember(Value = @"CONGESTION_CHARGE")] + CONGESTION_CHARGE = 23, + + [System.Runtime.Serialization.EnumMember(Value = @"RESIDENTIAL_SURCHARGE")] + RESIDENTIAL_SURCHARGE = 24, + + [System.Runtime.Serialization.EnumMember(Value = @"ADDITIONAL_SURCHARGE")] + ADDITIONAL_SURCHARGE = 25, + + [System.Runtime.Serialization.EnumMember(Value = @"SURCHARGE")] + SURCHARGE = 26, + + [System.Runtime.Serialization.EnumMember(Value = @"REBATE")] + REBATE = 27, + + [System.Runtime.Serialization.EnumMember(Value = @"HIGH_CUBE_SURCHARGE")] + HIGH_CUBE_SURCHARGE = 28, + + [System.Runtime.Serialization.EnumMember(Value = @"HIGH_LENGTH_SURCHARGE")] + HIGH_LENGTH_SURCHARGE = 29, + + [System.Runtime.Serialization.EnumMember(Value = @"HIGH_WIDTH_SURCHARGE")] + HIGH_WIDTH_SURCHARGE = 30, + + [System.Runtime.Serialization.EnumMember(Value = @"DEMAND_SURCHARGE")] + DEMAND_SURCHARGE = 31, + + [System.Runtime.Serialization.EnumMember(Value = @"NONSTANDARD_FEE")] + NONSTANDARD_FEE = 32, + + } + + /// + /// Type of the rateItem. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum RateItemType + { + + [System.Runtime.Serialization.EnumMember(Value = @"MANDATORY")] + MANDATORY = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"OPTIONAL")] + OPTIONAL = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"INCLUDED")] + INCLUDED = 2, + + } + + /// + /// Benefits that are included and excluded for each shipping offer. Benefits represents services provided by Amazon (eg. CLAIMS_PROTECTED, etc.) when sellers purchase shipping through Amazon. Benefit details will be made available for any shipment placed on or after January 1st 2024 00:00 UTC. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class Benefits + { + [Newtonsoft.Json.JsonProperty("includedBenefits", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public IncludedBenefits IncludedBenefits { get; set; } = new IncludedBenefits(); + + [Newtonsoft.Json.JsonProperty("excludedBenefits", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public ExcludedBenefits ExcludedBenefits { get; set; } = new ExcludedBenefits(); + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// A list of included benefits. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class IncludedBenefits : System.Collections.ObjectModel.Collection + { + + } + + /// + /// A list of excluded benefit. Refer to the ExcludeBenefit object for further documentation + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class ExcludedBenefits : System.Collections.ObjectModel.Collection + { + + } + + /// + /// Object representing a benefit that is excluded for a shipping offer or rate. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class ExcludedBenefit + { + /// + /// benefit + /// + [Newtonsoft.Json.JsonProperty("benefit", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string Benefit { get; set; } + + [Newtonsoft.Json.JsonProperty("reasonCodes", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.MinLength(1)] + public ExcludedBenefitReasonCodes ReasonCodes { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// List of reasons (eg. LATE_DELIVERY_RISK, etc.) indicating why a benefit is excluded for a shipping offer. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class ExcludedBenefitReasonCodes : System.Collections.ObjectModel.Collection + { + + } + + /// + /// Service Selection Criteria. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class ServiceSelection + { + [Newtonsoft.Json.JsonProperty("serviceId", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public ServiceIds ServiceId { get; set; } = new ServiceIds(); + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// A list of ServiceId. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class ServiceIds : System.Collections.ObjectModel.Collection + { + + } + + /// + /// The value-added services to be added to a shipping service purchase. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class OneClickShipmentValueAddedServiceDetails : System.Collections.ObjectModel.Collection + { + + } + + /// + /// A value-added service to be applied to a shipping service purchase. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class OneClickShipmentValueAddedService + { + /// + /// The identifier of the selected value-added service. + /// + [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string Id { get; set; } + + [Newtonsoft.Json.JsonProperty("amount", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Currency Amount { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Service Related Info + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class Service + { + [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string Id { get; set; } + + [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string Name { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Carrier Related Info + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class Carrier + { + [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string Id { get; set; } + + [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string Name { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum XAmznShippingBusinessId + { + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_US")] + AmazonShipping_US = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_IN")] + AmazonShipping_IN = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_UK")] + AmazonShipping_UK = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_IT")] + AmazonShipping_IT = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_ES")] + AmazonShipping_ES = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_FR")] + AmazonShipping_FR = 5, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum XAmznShippingBusinessId2 + { + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_US")] + AmazonShipping_US = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_IN")] + AmazonShipping_IN = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_UK")] + AmazonShipping_UK = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_IT")] + AmazonShipping_IT = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_ES")] + AmazonShipping_ES = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_FR")] + AmazonShipping_FR = 5, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum XAmznShippingBusinessId3 + { + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_US")] + AmazonShipping_US = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_IN")] + AmazonShipping_IN = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_UK")] + AmazonShipping_UK = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_IT")] + AmazonShipping_IT = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_ES")] + AmazonShipping_ES = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_FR")] + AmazonShipping_FR = 5, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum XAmznShippingBusinessId4 + { + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_US")] + AmazonShipping_US = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_IN")] + AmazonShipping_IN = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_UK")] + AmazonShipping_UK = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_IT")] + AmazonShipping_IT = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_ES")] + AmazonShipping_ES = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_FR")] + AmazonShipping_FR = 5, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum XAmznShippingBusinessId5 + { + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_US")] + AmazonShipping_US = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_IN")] + AmazonShipping_IN = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_UK")] + AmazonShipping_UK = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_IT")] + AmazonShipping_IT = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_ES")] + AmazonShipping_ES = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_FR")] + AmazonShipping_FR = 5, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum XAmznShippingBusinessId6 + { + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_US")] + AmazonShipping_US = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_IN")] + AmazonShipping_IN = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_UK")] + AmazonShipping_UK = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_IT")] + AmazonShipping_IT = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_ES")] + AmazonShipping_ES = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_FR")] + AmazonShipping_FR = 5, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum Anonymous + { + + [System.Runtime.Serialization.EnumMember(Value = @"HELIX")] + HELIX = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"CAMPUS_LOCKER")] + CAMPUS_LOCKER = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"OMNI_LOCKER")] + OMNI_LOCKER = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"ODIN_LOCKER")] + ODIN_LOCKER = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"DOBBY_LOCKER")] + DOBBY_LOCKER = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"CORE_LOCKER")] + CORE_LOCKER = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"3P")] + _3P = 6, + + [System.Runtime.Serialization.EnumMember(Value = @"CAMPUS_ROOM")] + CAMPUS_ROOM = 7, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum XAmznShippingBusinessId7 + { + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_US")] + AmazonShipping_US = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_IN")] + AmazonShipping_IN = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_UK")] + AmazonShipping_UK = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_IT")] + AmazonShipping_IT = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_ES")] + AmazonShipping_ES = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_FR")] + AmazonShipping_FR = 5, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum XAmznShippingBusinessId8 + { + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_US")] + AmazonShipping_US = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_IN")] + AmazonShipping_IN = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_UK")] + AmazonShipping_UK = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_IT")] + AmazonShipping_IT = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_ES")] + AmazonShipping_ES = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_FR")] + AmazonShipping_FR = 5, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum XAmznShippingBusinessId9 + { + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_US")] + AmazonShipping_US = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_IN")] + AmazonShipping_IN = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_UK")] + AmazonShipping_UK = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_IT")] + AmazonShipping_IT = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_ES")] + AmazonShipping_ES = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"AmazonShipping_FR")] + AmazonShipping_FR = 5, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum WeightUnit + { + + [System.Runtime.Serialization.EnumMember(Value = @"GRAM")] + GRAM = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"KILOGRAM")] + KILOGRAM = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"OUNCE")] + OUNCE = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"POUND")] + POUND = 3, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum LiquidVolumeUnit + { + + [System.Runtime.Serialization.EnumMember(Value = @"ML")] + ML = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"L")] + L = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"FL_OZ")] + FL_OZ = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"GAL")] + GAL = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"PT")] + PT = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"QT")] + QT = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"C")] + C = 6, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum ChargeComponentChargeType + { + + [System.Runtime.Serialization.EnumMember(Value = @"TAX")] + TAX = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"DISCOUNT")] + DISCOUNT = 1, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum DimensionsUnit + { + + [System.Runtime.Serialization.EnumMember(Value = @"INCH")] + INCH = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"CENTIMETER")] + CENTIMETER = 1, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum DocumentSizeUnit + { + + [System.Runtime.Serialization.EnumMember(Value = @"INCH")] + INCH = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"CENTIMETER")] + CENTIMETER = 1, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum DangerousGoodsDetailsPackingGroup + { + + [System.Runtime.Serialization.EnumMember(Value = @"I")] + I = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"II")] + II = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"III")] + III = 2, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum DangerousGoodsDetailsPackingInstruction + { + + [System.Runtime.Serialization.EnumMember(Value = @"PI965_SECTION_IA")] + PI965_SECTION_IA = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"PI965_SECTION_IB")] + PI965_SECTION_IB = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"PI965_SECTION_II")] + PI965_SECTION_II = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"PI966_SECTION_I")] + PI966_SECTION_I = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"PI966_SECTION_II")] + PI966_SECTION_II = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"PI967_SECTION_I")] + PI967_SECTION_I = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"PI967_SECTION_II")] + PI967_SECTION_II = 6, + + [System.Runtime.Serialization.EnumMember(Value = @"PI968_SECTION_IA")] + PI968_SECTION_IA = 7, + + [System.Runtime.Serialization.EnumMember(Value = @"PI968_SECTION_IB")] + PI968_SECTION_IB = 8, + + [System.Runtime.Serialization.EnumMember(Value = @"PI969_SECTION_I")] + PI969_SECTION_I = 9, + + [System.Runtime.Serialization.EnumMember(Value = @"PI969_SECTION_II")] + PI969_SECTION_II = 10, + + [System.Runtime.Serialization.EnumMember(Value = @"PI970_SECTION_I")] + PI970_SECTION_I = 11, + + [System.Runtime.Serialization.EnumMember(Value = @"PI970_SECTION_II")] + PI970_SECTION_II = 12, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum AccessPointAssistanceType + { + + [System.Runtime.Serialization.EnumMember(Value = @"STAFF_ASSISTED")] + STAFF_ASSISTED = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"SELF_ASSISTED")] + SELF_ASSISTED = 1, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public enum ClientReferenceDetailClientReferenceType + { + + [System.Runtime.Serialization.EnumMember(Value = @"IntegratorShipperId")] + IntegratorShipperId = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"IntegratorMerchantId")] + IntegratorMerchantId = 1, + + } + + + + [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class ApiException : System.Exception + { + public int StatusCode { get; private set; } + + public string Response { get; private set; } + + public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } + + public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) + : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) + { + StatusCode = statusCode; + Response = response; + Headers = headers; + } + + public override string ToString() + { + return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")] + public partial class ApiException : ApiException + { + public TResult Result { get; private set; } + + public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) + : base(message, statusCode, response, headers, innerException) + { + Result = result; + } + } + +} + +#pragma warning restore 1591 +#pragma warning restore 1573 +#pragma warning restore 472 +#pragma warning restore 114 +#pragma warning restore 108 +#pragma warning restore 3016 +#pragma warning restore 8603 diff --git a/src/EasyKeys.Shipping.Amazon.Abstractions/OpenApis/V2/Shipping/amazon-shipping.json b/src/EasyKeys.Shipping.Amazon.Abstractions/OpenApis/V2/Shipping/amazon-shipping.json new file mode 100644 index 0000000..adbde20 --- /dev/null +++ b/src/EasyKeys.Shipping.Amazon.Abstractions/OpenApis/V2/Shipping/amazon-shipping.json @@ -0,0 +1,7137 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Amazon Shipping API", + "description": "The Amazon Shipping API is designed to support outbound shipping use cases both for orders originating on Amazon-owned marketplaces as well as external channels/marketplaces. With these APIs, you can request shipping rates, create shipments, cancel shipments, and track shipments.", + "version": "v2" + }, + "servers": [ + { + "url": "https://sandbox.sellingpartnerapi-na.amazon.com/" + } + ], + "paths": { + "/shipping/v2/shipments/rates": { + "post": { + "tags": [ + "shipping" + ], + "description": "Returns the available shipping service offerings.\n\n**Usage Plan:**\n\n| Default Quota | Unit |\n| ---- | ---- |\n| 5 | Requests Per Second |\n\nThe `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).", + "operationId": "getRates", + "parameters": [ + { + "name": "x-amz-access-token", + "in": "header", + "description": "Amazon shipping request token", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "x-amzn-shipping-business-id", + "in": "header", + "description": "Amazon shipping business to assume for this request. The default is AmazonShipping_UK.", + "required": true, + "schema": { + "type": "string", + "enum": [ + "AmazonShipping_US", + "AmazonShipping_IN", + "AmazonShipping_UK", + "AmazonShipping_IT", + "AmazonShipping_ES", + "AmazonShipping_FR" + ], + "x-docgen-enum-table-extension": [ + { + "value": "AmazonShipping_US", + "description": "The United States Amazon shipping business." + }, + { + "value": "AmazonShipping_IN", + "description": "The India Amazon shipping business." + }, + { + "value": "AmazonShipping_UK", + "description": "The United Kingdom Amazon shipping business." + }, + { + "value": "AmazonShipping_IT", + "description": "The Italy Amazon shipping business." + }, + { + "value": "AmazonShipping_ES", + "description": "The Spain Amazon shipping business." + }, + { + "value": "AmazonShipping_FR", + "description": "The France Amazon shipping business." + } + ] + }, + "x-docgen-enum-table-extension": [ + { + "value": "AmazonShipping_US", + "description": "The United States Amazon shipping business." + }, + { + "value": "AmazonShipping_IN", + "description": "The India Amazon shipping business." + }, + { + "value": "AmazonShipping_UK", + "description": "The United Kingdom Amazon shipping business." + }, + { + "value": "AmazonShipping_IT", + "description": "The Italy Amazon shipping business." + }, + { + "value": "AmazonShipping_ES", + "description": "The Spain Amazon shipping business." + }, + { + "value": "AmazonShipping_FR", + "description": "The France Amazon shipping business." + } + ] + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetRatesRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetRatesResponse" + }, + "example": { + "requestToken": "6DCCEDD3FF961C15FEB94F342D41C", + "rates": [ + { + "rateId": "F4B68849F969E239FF9FCA9C12E35", + "carrierId": "FOOSHIPGRD", + "carrierName": "FOO SHIP GRD", + "billedWeight": { + "value": 5, + "unit": "GRAMS" + }, + "totalCharge": { + "value": 7, + "unit": "USD" + }, + "serviceId": "FOORSID", + "serviceName": "FOO RS ID", + "promise": { + "deliveryWindow": { + "start": "2018-08-24T08:22:30.737Z", + "end": "2018-08-24T20:22:30.737Z" + }, + "pickupWindow": { + "start": "2018-08-23T08:22:30.737Z", + "end": "2018-08-23T20:22:30.737Z" + } + }, + "supportedDocumentSpecifications": [ + { + "format": "PNG", + "size": { + "length": 6, + "width": 4, + "unit": "INCH" + }, + "printOptions": [ + { + "supportedDPIs": [ + 300, + 203 + ], + "supportedPageLayouts": [ + "LEFT", + "RIGHT" + ], + "supportedFileJoiningOptions": [ + true, + false + ], + "supportedDocumentDetails": [ + { + "name": "LABEL", + "isMandatory": true + } + ] + } + ] + }, + { + "format": "ZPL", + "size": { + "length": 6, + "width": 4, + "unit": "INCH" + }, + "printOptions": [ + { + "supportedDPIs": [ + 300, + 203 + ], + "supportedPageLayouts": [ + "LEFT", + "RIGHT" + ], + "supportedFileJoiningOptions": [ + true, + false + ], + "supportedDocumentDetails": [ + { + "name": "LABEL", + "isMandatory": true + } + ] + } + ] + } + ], + "availableValueAddedServiceGroups": [ + { + "groupId": "SIG_VERIFICATION", + "groupDescription": "Signature Verification", + "isRequired": true, + "valueAddedServices": [ + { + "id": "CUST_SIG_VERIFICATION", + "name": "Customer Signature Verification", + "cost": { + "unit": "USD", + "value": 2 + } + } + ] + } + ], + "requiresAdditionalInputs": false, + "rateItemList": [ + { + "rateItemCharge": { + "unit": "INR", + "value": "2.00000" + }, + "rateItemID": "BASE_RATE", + "rateItemNameLocalization": "Base Rate", + "rateItemType": "MANDATORY" + }, + { + "rateItemCharge": { + "unit": "INR", + "value": "1.20000" + }, + "rateItemID": "DELIVERY_CONFIRMATION", + "rateItemNameLocalization": "Delivery Confirmation", + "rateItemType": "INCLUDED" + }, + { + "rateItemCharge": { + "unit": "INR", + "value": "2.00" + }, + "rateItemID": "VAT", + "rateItemNameLocalization": "VAT", + "rateItemType": "MANDATORY" + } + ], + "paymentType": "PAY_THROUGH_AMAZON", + "benefits": { + "includedBenefits": [], + "excludedBenefits": [ + { + "benefit": "CLAIMS_PROTECTED", + "reasonCodes": [ + "LATE_DELIVERY_RISK" + ] + } + ] + } + } + ], + "ineligibleRates": [ + { + "carrierId": "FOOSTDGRD", + "serviceId": "FOO8420430", + "carrierName": "FOOSTDGRD", + "serviceName": "FOO8420430", + "ineligibilityReasons": [ + { + "code": "NO_COVERAGE", + "message": "Required shipping network coverage doesn't exist for the offering" + } + ] + } + ] + } + } + } + }, + "400": { + "description": "Request has missing or invalid parameters and cannot be parsed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "Request is missing or has invalid parameters", + "details": "ChannelDetails object cannot be null" + } + ] + } + } + } + }, + "401": { + "description": "The request's Authorization header is not formatted correctly or does not contain a valid token.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "Unauthorized", + "message": "You don't have access to the requested response or the credentials are invalid." + } + ] + } + } + } + }, + "403": { + "description": "Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "Unauthorized", + "message": "You don't have access to the requested response or the credentials are invalid." + } + ] + } + } + } + }, + "404": { + "description": "The resource specified does not exist.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "NotFound", + "message": "The requested resource is invalid or doesn't exist" + } + ] + } + } + } + }, + "413": { + "description": "The request size exceeded the maximum accepted size.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "The request payload size is greater than maximum accepted size." + } + ] + } + } + } + }, + "415": { + "description": "The request payload is in an unsupported format.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "The request payload format is not supported." + } + ] + } + } + } + }, + "429": { + "description": "The frequency of requests was greater than allowed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "TooManyRequests", + "message": "The total number of requests exceeded your allowed limit." + } + ] + } + } + } + }, + "500": { + "description": "An unexpected condition occurred that prevented the server from fulfilling the request.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InternalError", + "message": "Something went wrong while processing the request." + } + ] + } + } + } + }, + "503": { + "description": "Temporary overloading or maintenance of the server.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "ServiceUnavailable", + "message": "Service temporarily unavailable or down for maintenance. Please try again after sometime." + } + ] + } + } + } + } + }, + "x-amzn-api-sandbox": { + "dynamic": {} + }, + "x-codegen-request-body-name": "body" + } + }, + "/shipping/v2/shipments": { + "post": { + "tags": [ + "shipping" + ], + "description": "Purchases a shipping service and returns purchase related details and documents.\n\nNote: You must complete the purchase within **10 minutes** of rate creation by the shipping service provider. If you make the request after the 10 minutes have expired, you will receive an error response with the error code equal to \"TOKEN_EXPIRED\". If you receive this error response, you must get the rates for the shipment again.\n\n**Usage Plan:**\n\n| Default Quota | Unit |\n| ---- | ---- |\n| 5 | Requests Per Second |\n\nThe `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).", + "operationId": "purchaseShipment", + "parameters": [ + { + "name": "x-amz-access-token", + "in": "header", + "description": "Amazon shipping request token", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "x-amzn-shipping-business-id", + "in": "header", + "description": "Amazon shipping business to assume for this request. The default is AmazonShipping_UK.", + "required": true, + "schema": { + "type": "string", + "enum": [ + "AmazonShipping_US", + "AmazonShipping_IN", + "AmazonShipping_UK", + "AmazonShipping_IT", + "AmazonShipping_ES", + "AmazonShipping_FR" + ], + "x-docgen-enum-table-extension": [ + { + "value": "AmazonShipping_US", + "description": "The United States Amazon shipping business." + }, + { + "value": "AmazonShipping_IN", + "description": "The India Amazon shipping business." + }, + { + "value": "AmazonShipping_UK", + "description": "The United Kingdom Amazon shipping business." + }, + { + "value": "AmazonShipping_IT", + "description": "The Italy Amazon shipping business." + }, + { + "value": "AmazonShipping_ES", + "description": "The Spain Amazon shipping business." + }, + { + "value": "AmazonShipping_FR", + "description": "The France Amazon shipping business." + } + ] + }, + "x-docgen-enum-table-extension": [ + { + "value": "AmazonShipping_US", + "description": "The United States Amazon shipping business." + }, + { + "value": "AmazonShipping_IN", + "description": "The India Amazon shipping business." + }, + { + "value": "AmazonShipping_UK", + "description": "The United Kingdom Amazon shipping business." + }, + { + "value": "AmazonShipping_IT", + "description": "The Italy Amazon shipping business." + }, + { + "value": "AmazonShipping_ES", + "description": "The Spain Amazon shipping business." + }, + { + "value": "AmazonShipping_FR", + "description": "The France Amazon shipping business." + } + ] + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PurchaseShipmentRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PurchaseShipmentResponse" + }, + "example": { + "shipmentId": "87852211788104", + "packageDocumentDetails": [ + { + "packageClientReferenceId": "abcd", + "packageDocuments": [ + { + "type": "LABEL", + "format": "PNG", + "contents": "sdioadaiosfhdodsaiufhouafhoudfhdouahfac==" + } + ], + "trackingId": 1578648261977 + } + ], + "promise": { + "pickupWindow": { + "start": "2019-12-11T07:09:05.513Z", + "end": "2019-12-11T09:09:05.513Z" + }, + "deliveryWindow": { + "start": "2019-12-13T07:09:05.513Z", + "end": "2019-12-13T09:09:05.513Z" + } + }, + "benefits": { + "includedBenefits": [ + "CLAIMS_PROTECTED" + ], + "excludedBenefits": [] + } + } + } + } + }, + "400": { + "description": "Request has missing or invalid parameters and cannot be parsed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "Request is missing or has invalid parameters", + "details": "RateId cannot be null" + } + ] + } + } + } + }, + "401": { + "description": "The request's Authorization header is not formatted correctly or does not contain a valid token.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "Unauthorized", + "message": "You don't have access to the requested response or the credentials are invalid." + } + ] + } + } + } + }, + "403": { + "description": "Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "Unauthorized", + "message": "You don't have access to the requested response or the credentials are invalid." + } + ] + } + } + } + }, + "404": { + "description": "The resource specified does not exist.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "NotFound", + "message": "The requested resource is invalid or doesn't exist" + } + ] + } + } + } + }, + "413": { + "description": "The request size exceeded the maximum accepted size.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "The request payload size is greater than maximum accepted size." + } + ] + } + } + } + }, + "415": { + "description": "The request payload is in an unsupported format.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "The request payload format is not supported." + } + ] + } + } + } + }, + "429": { + "description": "The frequency of requests was greater than allowed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "TooManyRequests", + "message": "The total number of requests exceeded your allowed limit." + } + ] + } + } + } + }, + "500": { + "description": "An unexpected condition occurred that prevented the server from fulfilling the request.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InternalError", + "message": "Something went wrong while processing the request." + } + ] + } + } + } + }, + "503": { + "description": "Temporary overloading or maintenance of the server.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "ServiceUnavailable", + "message": "Service temporarily unavailable or down for maintenance. Please try again after sometime." + } + ] + } + } + } + } + }, + "x-amzn-api-sandbox": { + "dynamic": {} + }, + "x-codegen-request-body-name": "body" + } + }, + "/shipping/v2/oneClickShipment": { + "post": { + "tags": [ + "shipping" + ], + "description": "Purchases a shipping service identifier and returns purchase-related details and documents.\n\n**Usage Plan:**\n\n| Default Quota | Unit |\n| ---- | ---- |\n| 5 | Requests Per Second |\n\nThe `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).", + "operationId": "oneClickShipment", + "parameters": [ + { + "name": "x-amz-access-token", + "in": "header", + "description": "Amazon shipping request token", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "x-amzn-shipping-business-id", + "in": "header", + "description": "Amazon shipping business to assume for this request. The default is AmazonShipping_UK.", + "required": true, + "schema": { + "type": "string", + "enum": [ + "AmazonShipping_US", + "AmazonShipping_IN", + "AmazonShipping_UK", + "AmazonShipping_IT", + "AmazonShipping_ES", + "AmazonShipping_FR" + ], + "x-docgen-enum-table-extension": [ + { + "value": "AmazonShipping_US", + "description": "The United States Amazon shipping business." + }, + { + "value": "AmazonShipping_IN", + "description": "The India Amazon shipping business." + }, + { + "value": "AmazonShipping_UK", + "description": "The United Kingdom Amazon shipping business." + }, + { + "value": "AmazonShipping_IT", + "description": "The Italy Amazon shipping business." + }, + { + "value": "AmazonShipping_ES", + "description": "The Spain Amazon shipping business." + }, + { + "value": "AmazonShipping_FR", + "description": "The France Amazon shipping business." + } + ] + }, + "x-docgen-enum-table-extension": [ + { + "value": "AmazonShipping_US", + "description": "The United States Amazon shipping business." + }, + { + "value": "AmazonShipping_IN", + "description": "The India Amazon shipping business." + }, + { + "value": "AmazonShipping_UK", + "description": "The United Kingdom Amazon shipping business." + }, + { + "value": "AmazonShipping_IT", + "description": "The Italy Amazon shipping business." + }, + { + "value": "AmazonShipping_ES", + "description": "The Spain Amazon shipping business." + }, + { + "value": "AmazonShipping_FR", + "description": "The France Amazon shipping business." + } + ] + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OneClickShipmentRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OneClickShipmentResponse" + }, + "example": { + "shipmentId": "87852211788104", + "packageDocumentDetails": [ + { + "packageClientReferenceId": "#abcd", + "packageDocuments": [ + { + "type": "LABEL", + "format": "PNG", + "contents": "sdioadaiosfhdodsaiufhouafhoudfhdouahfac==" + } + ], + "trackingId": 1578648261977 + } + ], + "promise": { + "pickupWindow": { + "start": "2019-12-11T07:09:05.513Z", + "end": "2019-12-11T09:09:05.513Z" + }, + "deliveryWindow": { + "start": "2019-12-13T07:09:05.513Z", + "end": "2019-12-13T09:09:05.513Z" + } + }, + "carrier": { + "id": "AMZN_UK", + "name": "Amazon Shipping" + }, + "service": { + "id": "SWA-UK-PREM", + "name": "Amazon Shipping One Day" + }, + "totalCharge": { + "unit": "GBP", + "value": 4.76 + } + } + } + } + }, + "400": { + "description": "Request has missing or invalid parameters and cannot be parsed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "Request is missing or has invalid parameters", + "details": "ServiceId cannot be null" + } + ] + } + } + } + }, + "401": { + "description": "The request's Authorization header is not formatted correctly or does not contain a valid token.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "Unauthorized", + "message": "You don't have access to the requested response or the credentials are invalid." + } + ] + } + } + } + }, + "403": { + "description": "Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "Unauthorized", + "message": "You don't have access to the requested response or the credentials are invalid." + } + ] + } + } + } + }, + "404": { + "description": "The resource specified does not exist.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "NotFound", + "message": "The requested resource is invalid or doesn't exist" + } + ] + } + } + } + }, + "413": { + "description": "The request size exceeded the maximum accepted size.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "The request payload size is greater than maximum accepted size." + } + ] + } + } + } + }, + "415": { + "description": "The request payload is in an unsupported format.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "The request payload format is not supported." + } + ] + } + } + } + }, + "429": { + "description": "The frequency of requests was greater than allowed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "TooManyRequests", + "message": "The total number of requests exceeded your allowed limit." + } + ] + } + } + } + }, + "500": { + "description": "An unexpected condition occurred that prevented the server from fulfilling the request.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InternalError", + "message": "Something went wrong while processing the request." + } + ] + } + } + } + }, + "503": { + "description": "Temporary overloading or maintenance of the server.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "ServiceUnavailable", + "message": "Service temporarily unavailable or down for maintenance. Please try again after sometime." + } + ] + } + } + } + } + }, + "x-amzn-api-sandbox": { + "dynamic": {} + }, + "x-codegen-request-body-name": "body" + } + }, + "/shipping/v2/tracking": { + "get": { + "tags": [ + "shipping" + ], + "description": "Returns tracking information for a purchased shipment.\n\n**Usage Plan:**\n\n| Default Quota | Unit |\n| ---- | ---- |\n| 5 | Requests Per Second |\n\nThe `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).", + "operationId": "getTracking", + "parameters": [ + { + "name": "trackingId", + "in": "query", + "description": "A carrier-generated tracking identifier originally returned by the purchaseShipment operation.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "carrierId", + "in": "query", + "description": "A carrier identifier originally returned by the getRates operation for the selected rate.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "x-amz-access-token", + "in": "header", + "description": "Amazon shipping request token", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "x-amzn-shipping-business-id", + "in": "header", + "description": "Amazon shipping business to assume for this request. The default is AmazonShipping_UK.", + "schema": { + "type": "string", + "enum": [ + "AmazonShipping_US", + "AmazonShipping_IN", + "AmazonShipping_UK", + "AmazonShipping_IT", + "AmazonShipping_ES", + "AmazonShipping_FR" + ], + "x-docgen-enum-table-extension": [ + { + "value": "AmazonShipping_US", + "description": "The United States Amazon shipping business." + }, + { + "value": "AmazonShipping_IN", + "description": "The India Amazon shipping business." + }, + { + "value": "AmazonShipping_UK", + "description": "The United Kingdom Amazon shipping business." + }, + { + "value": "AmazonShipping_IT", + "description": "The Italy Amazon shipping business." + }, + { + "value": "AmazonShipping_ES", + "description": "The Spain Amazon shipping business." + }, + { + "value": "AmazonShipping_FR", + "description": "The France Amazon shipping business." + } + ] + }, + "x-docgen-enum-table-extension": [ + { + "value": "AmazonShipping_US", + "description": "The United States Amazon shipping business." + }, + { + "value": "AmazonShipping_IN", + "description": "The India Amazon shipping business." + }, + { + "value": "AmazonShipping_UK", + "description": "The United Kingdom Amazon shipping business." + }, + { + "value": "AmazonShipping_IT", + "description": "The Italy Amazon shipping business." + }, + { + "value": "AmazonShipping_ES", + "description": "The Spain Amazon shipping business." + }, + { + "value": "AmazonShipping_FR", + "description": "The France Amazon shipping business." + } + ] + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetTrackingResponse" + }, + "example": { + "trackingId": "23AA47DE2B3B6", + "alternateLegTrackingId": "null", + "eventHistory": [ + { + "eventCode": "Undeliverable", + "location": { + "postalCode": "EX33 2JL", + "countryCode": "GB" + }, + "eventTime": "2024-02-11T07:09:05.513Z", + "shipmentType": "FORWARD" + }, + { + "eventCode": "ReturnInitiated", + "location": { + "postalCode": "EX33 2JL", + "countryCode": "GB" + }, + "eventTime": "2024-02-12T09:09:05.513Z", + "shipmentType": "RETURNS" + }, + { + "eventCode": "Delivered", + "location": { + "postalCode": "EX33 2JL", + "countryCode": "GB" + }, + "eventTime": "2024-02-13T04:09:05.513Z", + "shipmentType": "RETURNS" + } + ], + "promisedDeliveryDate": "2024-02-12T13:09:05.513Z", + "summary": { + "status": "Delivered", + "trackingDetailCodes": { + "forward": [ + "Rejected", + "Damaged" + ], + "returns": [ + "Signed" + ] + } + } + } + } + } + }, + "400": { + "description": "Request has missing or invalid parameters and cannot be parsed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "Request is missing or has invalid parameters", + "details": "CarrierId is missing in the request" + } + ] + } + } + } + }, + "401": { + "description": "The request's Authorization header is not formatted correctly or does not contain a valid token.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "Unauthorized", + "message": "You don't have access to the requested response or the credentials are invalid." + } + ] + } + } + } + }, + "403": { + "description": "Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "Unauthorized", + "message": "You don't have access to the requested response or the credentials are invalid." + } + ] + } + } + } + }, + "404": { + "description": "The resource specified does not exist.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "NotFound", + "message": "The requested resource is invalid or doesn't exist" + } + ] + } + } + } + }, + "413": { + "description": "The request size exceeded the maximum accepted size.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "The request payload size is greater than maximum accepted size." + } + ] + } + } + } + }, + "415": { + "description": "The request payload is in an unsupported format.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "The request payload format is not supported." + } + ] + } + } + } + }, + "429": { + "description": "The frequency of requests was greater than allowed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "TooManyRequests", + "message": "The total number of requests exceeded your allowed limit." + } + ] + } + } + } + }, + "500": { + "description": "An unexpected condition occurred that prevented the server from fulfilling the request.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InternalError", + "message": "Something went wrong while processing the request." + } + ] + } + } + } + }, + "503": { + "description": "Temporary overloading or maintenance of the server.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "ServiceUnavailable", + "message": "Service temporarily unavailable or down for maintenance. Please try again after sometime." + } + ] + } + } + } + } + }, + "x-amzn-api-sandbox": { + "dynamic": {} + } + } + }, + "/shipping/v2/shipments/{shipmentId}/documents": { + "get": { + "tags": [ + "shipping" + ], + "description": "Returns the shipping documents associated with a package in a shipment.\n\n**Usage Plan:**\n\n| Default Quota | Unit |\n| ---- | ---- |\n| 5 | Requests Per Second |\n\nThe `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).", + "operationId": "getShipmentDocuments", + "parameters": [ + { + "name": "shipmentId", + "in": "path", + "description": "The shipment identifier originally returned by the purchaseShipment operation.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "packageClientReferenceId", + "in": "query", + "description": "The package client reference identifier originally provided in the request body parameter for the getRates operation.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "format", + "in": "query", + "description": "The file format of the document. Must be one of the supported formats returned by the getRates operation.", + "schema": { + "type": "string" + } + }, + { + "name": "dpi", + "in": "query", + "description": "The resolution of the document (for example, 300 means 300 dots per inch). Must be one of the supported resolutions returned in the response to the getRates operation.", + "schema": { + "type": "number" + } + }, + { + "name": "x-amz-access-token", + "in": "header", + "description": "Amazon shipping request token", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "x-amzn-shipping-business-id", + "in": "header", + "description": "Amazon shipping business to assume for this request. The default is AmazonShipping_UK.", + "required": true, + "schema": { + "type": "string", + "enum": [ + "AmazonShipping_US", + "AmazonShipping_IN", + "AmazonShipping_UK", + "AmazonShipping_IT", + "AmazonShipping_ES", + "AmazonShipping_FR" + ], + "x-docgen-enum-table-extension": [ + { + "value": "AmazonShipping_US", + "description": "The United States Amazon shipping business." + }, + { + "value": "AmazonShipping_IN", + "description": "The India Amazon shipping business." + }, + { + "value": "AmazonShipping_UK", + "description": "The United Kingdom Amazon shipping business." + }, + { + "value": "AmazonShipping_IT", + "description": "The Italy Amazon shipping business." + }, + { + "value": "AmazonShipping_ES", + "description": "The Spain Amazon shipping business." + }, + { + "value": "AmazonShipping_FR", + "description": "The France Amazon shipping business." + } + ] + }, + "x-docgen-enum-table-extension": [ + { + "value": "AmazonShipping_US", + "description": "The United States Amazon shipping business." + }, + { + "value": "AmazonShipping_IN", + "description": "The India Amazon shipping business." + }, + { + "value": "AmazonShipping_UK", + "description": "The United Kingdom Amazon shipping business." + }, + { + "value": "AmazonShipping_IT", + "description": "The Italy Amazon shipping business." + }, + { + "value": "AmazonShipping_ES", + "description": "The Spain Amazon shipping business." + }, + { + "value": "AmazonShipping_FR", + "description": "The France Amazon shipping business." + } + ] + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetShipmentDocumentsResponse" + }, + "example": { + "shipmentId": "445454-3232-3232", + "packageDocumentDetail": { + "packageClientReferenceId": "ASUSDI-45343854", + "trackingId": "T1234567", + "packageDocuments": [ + { + "type": "LABEL", + "format": "PNG", + "contents": "sdioadaiosfhdodsaiufhouafhoudfhdouahfac==" + } + ], + "benefits": { + "includedBenefits": [ + "CLAIMS_PROTECTED" + ], + "excludedBenefits": [] + } + } + } + } + } + }, + "400": { + "description": "Request has missing or invalid parameters and cannot be parsed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "Request is missing or has invalid parameters", + "details": "shipmentId is missing in the request" + } + ] + } + } + } + }, + "401": { + "description": "The request's Authorization header is not formatted correctly or does not contain a valid token.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "Unauthorized", + "message": "You don't have access to the requested response or the credentials are invalid." + } + ] + } + } + } + }, + "403": { + "description": "Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "Unauthorized", + "message": "You don't have access to the requested response or the credentials are invalid." + } + ] + } + } + } + }, + "404": { + "description": "The resource specified does not exist.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "NotFound", + "message": "The requested resource is invalid or doesn't exist" + } + ] + } + } + } + }, + "413": { + "description": "The request size exceeded the maximum accepted size.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "The request payload size is greater than maximum accepted size." + } + ] + } + } + } + }, + "415": { + "description": "The request payload is in an unsupported format.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "The request payload format is not supported." + } + ] + } + } + } + }, + "429": { + "description": "The frequency of requests was greater than allowed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "TooManyRequests", + "message": "The total number of requests exceeded your allowed limit." + } + ] + } + } + } + }, + "500": { + "description": "An unexpected condition occurred that prevented the server from fulfilling the request.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InternalError", + "message": "Something went wrong while processing the request." + } + ] + } + } + } + }, + "503": { + "description": "Temporary overloading or maintenance of the server.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "ServiceUnavailable", + "message": "Service temporarily unavailable or down for maintenance. Please try again after sometime." + } + ] + } + } + } + } + }, + "x-amzn-api-sandbox": { + "dynamic": {} + } + } + }, + "/shipping/v2/shipments/{shipmentId}/cancel": { + "put": { + "tags": [ + "shipping" + ], + "description": "Cancels a purchased shipment. Returns an empty object if the shipment is successfully cancelled.\n\n**Usage Plan:**\n\n| Default Quota | Unit |\n| ---- | ---- |\n| 5 | Requests Per Second |\n\nThe `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).", + "operationId": "cancelShipment", + "parameters": [ + { + "name": "shipmentId", + "in": "path", + "description": "The shipment identifier originally returned by the purchaseShipment operation.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "x-amz-access-token", + "in": "header", + "description": "Amazon shipping request token", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "x-amzn-shipping-business-id", + "in": "header", + "description": "Amazon shipping business to assume for this request. The default is AmazonShipping_UK.", + "required": true, + "schema": { + "type": "string", + "enum": [ + "AmazonShipping_US", + "AmazonShipping_IN", + "AmazonShipping_UK", + "AmazonShipping_IT", + "AmazonShipping_ES", + "AmazonShipping_FR" + ], + "x-docgen-enum-table-extension": [ + { + "value": "AmazonShipping_US", + "description": "The United States Amazon shipping business." + }, + { + "value": "AmazonShipping_IN", + "description": "The India Amazon shipping business." + }, + { + "value": "AmazonShipping_UK", + "description": "The United Kingdom Amazon shipping business." + }, + { + "value": "AmazonShipping_IT", + "description": "The Italy Amazon shipping business." + }, + { + "value": "AmazonShipping_ES", + "description": "The Spain Amazon shipping business." + }, + { + "value": "AmazonShipping_FR", + "description": "The France Amazon shipping business." + } + ] + }, + "x-docgen-enum-table-extension": [ + { + "value": "AmazonShipping_US", + "description": "The United States Amazon shipping business." + }, + { + "value": "AmazonShipping_IN", + "description": "The India Amazon shipping business." + }, + { + "value": "AmazonShipping_UK", + "description": "The United Kingdom Amazon shipping business." + }, + { + "value": "AmazonShipping_IT", + "description": "The Italy Amazon shipping business." + }, + { + "value": "AmazonShipping_ES", + "description": "The Spain Amazon shipping business." + }, + { + "value": "AmazonShipping_FR", + "description": "The France Amazon shipping business." + } + ] + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelShipmentResponse" + }, + "example": {} + } + } + }, + "400": { + "description": "Request has missing or invalid parameters and cannot be parsed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "Request is missing or has invalid parameters", + "details": "ShipmentId cannot be null" + } + ] + } + } + } + }, + "401": { + "description": "The request's Authorization header is not formatted correctly or does not contain a valid token.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "Unauthorized", + "message": "You don't have access to the requested response or the credentials are invalid." + } + ] + } + } + } + }, + "403": { + "description": "Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "Unauthorized", + "message": "You don't have access to the requested response or the credentials are invalid." + } + ] + } + } + } + }, + "404": { + "description": "The resource specified does not exist.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "NotFound", + "message": "The requested resource is invalid or doesn't exist" + } + ] + } + } + } + }, + "413": { + "description": "The request size exceeded the maximum accepted size.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "The request payload size is greater than maximum accepted size." + } + ] + } + } + } + }, + "415": { + "description": "The request payload is in an unsupported format.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "The request payload format is not supported." + } + ] + } + } + } + }, + "429": { + "description": "The frequency of requests was greater than allowed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "TooManyRequests", + "message": "The total number of requests exceeded your allowed limit." + } + ] + } + } + } + }, + "500": { + "description": "An unexpected condition occurred that prevented the server from fulfilling the request.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InternalError", + "message": "Something went wrong while processing the request." + } + ] + } + } + } + }, + "503": { + "description": "Temporary overloading or maintenance of the server.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "ServiceUnavailable", + "message": "Service temporarily unavailable or down for maintenance. Please try again after sometime." + } + ] + } + } + } + } + }, + "x-amzn-api-sandbox": { + "dynamic": {} + } + } + }, + "/shipping/v2/accessPoints": { + "get": { + "tags": [ + "shipping" + ], + "description": "Returns a list of access points in proximity of input postal code.\n\n**Usage Plan:**\n\n| Default Quota | Unit |\n| ---- | ---- |\n| 5 | Requests Per Second |\n\nThe `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).", + "operationId": "getAccessPoints", + "parameters": [ + { + "name": "accessPointTypes", + "in": "query", + "description": "Access point types", + "required": true, + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "HELIX", + "CAMPUS_LOCKER", + "OMNI_LOCKER", + "ODIN_LOCKER", + "DOBBY_LOCKER", + "CORE_LOCKER", + "3P", + "CAMPUS_ROOM" + ] + }, + "x-docgen-enum-table-extension": [ + { + "value": "HELIX", + "description": "Counter, aka Helix, is an assisted access point where customers interact with a store associate to collect or return packages. Counter stores do not have Locker" + }, + { + "value": "CAMPUS_LOCKER", + "description": "It denotes a physical Locker present at Locker+ stores" + }, + { + "value": "OMNI_LOCKER", + "description": "Omni lockers are similar to core lockers installed at apartment buildings. Core and Omni will have common base hardware platform" + }, + { + "value": "ODIN_LOCKER", + "description": "Odin lockers rely on Bluetooth connection as there is no screen or scanner on the locker. Drivers, customers, and even technicians can interact with the locker using an app (different depending on the user)." + }, + { + "value": "DOBBY_LOCKER", + "description": "Dobby lockers are Odin lockers installed at apartment complexes and available only to residents." + }, + { + "value": "CORE_LOCKER", + "description": "Core lockers are the traditional and initial style of lockers when Hub was launched. Core lockers have a screen, keypad and scanner. Customer either enter their pickup code using the Locker screen or scan pickup code barcode to pick up their package." + }, + { + "value": "3P", + "description": "Networks that are owned end-to-end by commercial carriers (CC - e.g. DHL, UPS, DPD and Postal organizations), who operate both the transportation leg and the access point aspect. These networks offer a range of pickup points including: 3P Lockers, legacy Postal Offices, 3P Counters (e.g. Gas Stations and Retail Outlets - supermarkets, bookstores, news-stands etc)." + }, + { + "value": "CAMPUS_ROOM", + "description": "Locker+, formerly known as Campus, are attended, physical stores, where the Locker is used dynamically by the staff to keep packages ready for customer pickup. Locker+ store can have multiple Lockers installed," + } + ] + }, + "x-docgen-enum-table-extension": [ + { + "value": "HELIX", + "description": "Counter, aka Helix, is an assisted access point where customers interact with a store associate to collect or return packages. Counter stores do not have Locker" + }, + { + "value": "CAMPUS_LOCKER", + "description": "It denotes a physical Locker present at Locker+ stores" + }, + { + "value": "OMNI_LOCKER", + "description": "Omni lockers are similar to core lockers installed at apartment buildings. Core and Omni will have common base hardware platform" + }, + { + "value": "ODIN_LOCKER", + "description": "Odin lockers rely on Bluetooth connection as there is no screen or scanner on the locker. Drivers, customers, and even technicians can interact with the locker using an app (different depending on the user)." + }, + { + "value": "DOBBY_LOCKER", + "description": "Dobby lockers are Odin lockers installed at apartment complexes and available only to residents." + }, + { + "value": "CORE_LOCKER", + "description": "Core lockers are the traditional and initial style of lockers when Hub was launched. Core lockers have a screen, keypad and scanner. Customer either enter their pickup code using the Locker screen or scan pickup code barcode to pick up their package." + }, + { + "value": "3P", + "description": "Networks that are owned end-to-end by commercial carriers (CC - e.g. DHL, UPS, DPD and Postal organizations), who operate both the transportation leg and the access point aspect. These networks offer a range of pickup points including: 3P Lockers, legacy Postal Offices, 3P Counters (e.g. Gas Stations and Retail Outlets - supermarkets, bookstores, news-stands etc)." + }, + { + "value": "CAMPUS_ROOM", + "description": "Locker+, formerly known as Campus, are attended, physical stores, where the Locker is used dynamically by the staff to keep packages ready for customer pickup. Locker+ store can have multiple Lockers installed," + } + ] + }, + { + "name": "countryCode", + "in": "query", + "description": "Country code for access point", + "required": true, + "schema": { + "type": "string" + }, + "example": "US" + }, + { + "name": "postalCode", + "in": "query", + "description": "postal code for access point", + "required": true, + "schema": { + "type": "string" + }, + "example": "EX332JL" + }, + { + "name": "x-amz-access-token", + "in": "header", + "description": "Amazon shipping request token", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "x-amzn-shipping-business-id", + "in": "header", + "description": "Amazon shipping business to assume for this request. The default is AmazonShipping_UK.", + "required": true, + "schema": { + "type": "string", + "enum": [ + "AmazonShipping_US", + "AmazonShipping_IN", + "AmazonShipping_UK", + "AmazonShipping_IT", + "AmazonShipping_ES", + "AmazonShipping_FR" + ], + "x-docgen-enum-table-extension": [ + { + "value": "AmazonShipping_US", + "description": "The United States Amazon shipping business." + }, + { + "value": "AmazonShipping_IN", + "description": "The India Amazon shipping business." + }, + { + "value": "AmazonShipping_UK", + "description": "The United Kingdom Amazon shipping business." + }, + { + "value": "AmazonShipping_IT", + "description": "The Italy Amazon shipping business." + }, + { + "value": "AmazonShipping_ES", + "description": "The Spain Amazon shipping business." + }, + { + "value": "AmazonShipping_FR", + "description": "The France Amazon shipping business." + } + ] + }, + "x-docgen-enum-table-extension": [ + { + "value": "AmazonShipping_US", + "description": "The United States Amazon shipping business." + }, + { + "value": "AmazonShipping_IN", + "description": "The India Amazon shipping business." + }, + { + "value": "AmazonShipping_UK", + "description": "The United Kingdom Amazon shipping business." + }, + { + "value": "AmazonShipping_IT", + "description": "The Italy Amazon shipping business." + }, + { + "value": "AmazonShipping_ES", + "description": "The Spain Amazon shipping business." + }, + { + "value": "AmazonShipping_FR", + "description": "The France Amazon shipping business." + } + ] + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetAccessPointsResponse" + }, + "example": { + "HELIX": { + "accessPointId": "00046c4b-bb0a-4c03-831e-5633e142f16a", + "name": "Amazon Hub Counter - Co-op Braunton", + "timezone": "Europe/London", + "type": "HELIX", + "accessibilityAttributes": { + "distance": "21.200000762939453", + "driveTime": "0.0" + }, + "address": { + "addressObject": { + "addressLine1": "Exeter Road", + "city": "Braunton", + "countryCode": "GB", + "zipOrPostalCode": "EX33 2JL" + }, + "geocode": { + "latitude": "51.1076671", + "longitude": "-4.1607301" + } + }, + "exceptionOperatingHours": [ + { + "dateRange": { + "endDate": "1.6932672E9", + "startDate": "1.6931808E9" + }, + "operatingHours": { + "closingTime": { + "hourOfDay": 0, + "minuteOfHour": 0, + "secondOfMinute": 0 + }, + "midDayClosures": [], + "openingTime": { + "hourOfDay": 0, + "minuteOfHour": 0, + "secondOfMinute": 0 + } + } + } + ], + "assistanceType": "STAFF_ASSISTED", + "score": "0.6688068509101868", + "standardOperatingHours": { + "WEDNESDAY": { + "closingTime": { + "hourOfDay": 22, + "minuteOfHour": 0, + "secondOfMinute": 0 + }, + "midDayClosures": [], + "openingTime": { + "hourOfDay": 7, + "minuteOfHour": 0, + "secondOfMinute": 0 + } + }, + "MONDAY": { + "closingTime": { + "hourOfDay": 22, + "minuteOfHour": 0, + "secondOfMinute": 0 + }, + "midDayClosures": [], + "openingTime": { + "hourOfDay": 7, + "minuteOfHour": 0, + "secondOfMinute": 0 + } + }, + "THURSDAY": { + "closingTime": { + "hourOfDay": 22, + "minuteOfHour": 0, + "secondOfMinute": 0 + }, + "midDayClosures": [], + "openingTime": { + "hourOfDay": 7, + "minuteOfHour": 0, + "secondOfMinute": 0 + } + }, + "SUNDAY": { + "closingTime": { + "hourOfDay": 22, + "minuteOfHour": 0, + "secondOfMinute": 0 + }, + "midDayClosures": [], + "openingTime": { + "hourOfDay": 7, + "minuteOfHour": 0, + "secondOfMinute": 0 + } + }, + "TUESDAY": { + "closingTime": { + "hourOfDay": 22, + "minuteOfHour": 0, + "secondOfMinute": 0 + }, + "midDayClosures": [], + "openingTime": { + "hourOfDay": 7, + "minuteOfHour": 0, + "secondOfMinute": 0 + } + }, + "FRIDAY": { + "closingTime": { + "hourOfDay": 22, + "minuteOfHour": 0, + "secondOfMinute": 0 + }, + "midDayClosures": [], + "openingTime": { + "hourOfDay": 7, + "minuteOfHour": 0, + "secondOfMinute": 0 + } + }, + "SATURDAY": { + "closingTime": { + "hourOfDay": 22, + "minuteOfHour": 0, + "secondOfMinute": 0 + }, + "midDayClosures": [], + "openingTime": { + "hourOfDay": 7, + "minuteOfHour": 0, + "secondOfMinute": 0 + } + } + } + } + } + } + } + }, + "400": { + "description": "Request has missing or invalid parameters and cannot be parsed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "Request is missing or has invalid parameters", + "details": "Access Point types cannot be null" + } + ] + } + } + } + }, + "401": { + "description": "The request's Authorization header is not formatted correctly or does not contain a valid token.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "Unauthorized", + "message": "You don't have access to the requested response or the credentials are invalid." + } + ] + } + } + } + }, + "403": { + "description": "Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "Unauthorized", + "message": "You don't have access to the requested response or the credentials are invalid." + } + ] + } + } + } + }, + "404": { + "description": "The resource specified does not exist.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "NotFound", + "message": "The requested resource is invalid or doesn't exist" + } + ] + } + } + } + }, + "413": { + "description": "The request size exceeded the maximum accepted size.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "The request payload size is greater than maximum accepted size." + } + ] + } + } + } + }, + "415": { + "description": "The request payload is in an unsupported format.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "The request payload format is not supported." + } + ] + } + } + } + }, + "429": { + "description": "The frequency of requests was greater than allowed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "TooManyRequests", + "message": "The total number of requests exceeded your allowed limit." + } + ] + } + } + } + }, + "500": { + "description": "An unexpected condition occurred that prevented the server from fulfilling the request.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InternalError", + "message": "Something went wrong while processing the request." + } + ] + } + } + } + }, + "503": { + "description": "Temporary overloading or maintenance of the server.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "ServiceUnavailable", + "message": "Service temporarily unavailable or down for maintenance. Please try again after sometime." + } + ] + } + } + } + } + }, + "x-amzn-api-sandbox": { + "dynamic": {} + } + } + }, + "/shipping/v2/ndrFeedback": { + "post": { + "tags": [ + "shipping" + ], + "description": "This API submits the NDR (Non-delivery Report) Feedback for any eligible shipment.\n\n**Usage Plan:**\n\n| Default Quota | Unit |\n| ---- | ---- |\n| 5 | Requests Per Second |\n\nThe `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).", + "operationId": "submitNdrFeedback", + "parameters": [ + { + "name": "x-amz-access-token", + "in": "header", + "description": "Amazon shipping request token", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "x-amzn-shipping-business-id", + "in": "header", + "description": "Amazon shipping business to assume for this request. The default is AmazonShipping_UK.", + "schema": { + "type": "string", + "enum": [ + "AmazonShipping_US", + "AmazonShipping_IN", + "AmazonShipping_UK", + "AmazonShipping_IT", + "AmazonShipping_ES", + "AmazonShipping_FR" + ], + "x-docgen-enum-table-extension": [ + { + "value": "AmazonShipping_US", + "description": "The United States Amazon shipping business." + }, + { + "value": "AmazonShipping_IN", + "description": "The India Amazon shipping business." + }, + { + "value": "AmazonShipping_UK", + "description": "The United Kingdom Amazon shipping business." + }, + { + "value": "AmazonShipping_IT", + "description": "The Italy Amazon shipping business." + }, + { + "value": "AmazonShipping_ES", + "description": "The Spain Amazon shipping business." + }, + { + "value": "AmazonShipping_FR", + "description": "The France Amazon shipping business." + } + ] + }, + "x-docgen-enum-table-extension": [ + { + "value": "AmazonShipping_US", + "description": "The United States Amazon shipping business." + }, + { + "value": "AmazonShipping_IN", + "description": "The India Amazon shipping business." + }, + { + "value": "AmazonShipping_UK", + "description": "The United Kingdom Amazon shipping business." + }, + { + "value": "AmazonShipping_IT", + "description": "The Italy Amazon shipping business." + }, + { + "value": "AmazonShipping_ES", + "description": "The Spain Amazon shipping business." + }, + { + "value": "AmazonShipping_FR", + "description": "The France Amazon shipping business." + } + ] + } + ], + "requestBody": { + "description": "Request body for ndrFeedback operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubmitNdrFeedbackRequest" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "Success", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": {} + }, + "400": { + "description": "Request has missing or invalid parameters and cannot be parsed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "Request is missing or has invalid parameters", + "details": "RescheduleDate is missing in the request" + } + ] + } + } + } + }, + "401": { + "description": "The request's Authorization header is not formatted correctly or does not contain a valid token.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "Unauthorized", + "message": "You don't have access to the requested resource or the credentials are invalid." + } + ] + } + } + } + }, + "403": { + "description": "Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "Unauthorized", + "message": "You don't have access to the requested resource or the credentials are invalid." + } + ] + } + } + } + }, + "404": { + "description": "The resource specified does not exist.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "NotFound", + "message": "The requested resource is invalid or doesn't exist" + } + ] + } + } + } + }, + "413": { + "description": "The request size exceeded the maximum accepted size.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "The request payload size is greater than maximum accepted size." + } + ] + } + } + } + }, + "415": { + "description": "The request payload is in an unsupported format.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "The request payload format is not supported." + } + ] + } + } + } + }, + "429": { + "description": "The frequency of requests was greater than allowed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "TooManyRequests", + "message": "The total number of requests exceeded your allowed limit." + } + ] + } + } + } + }, + "500": { + "description": "An unexpected condition occurred that prevented the server from fulfilling the request.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InternalError", + "message": "Something went wrong while processing the request." + } + ] + } + } + } + }, + "503": { + "description": "Temporary overloading or maintenance of the server.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "ServiceUnavailable", + "message": "Service temporarily unavailable or down for maintenance. Please try again after sometime." + } + ] + } + } + } + } + }, + "x-amzn-api-sandbox": { + "dynamic": {} + }, + "x-codegen-request-body-name": "body" + } + }, + "/shipping/v2/shipments/additionalInputs/schema": { + "get": { + "tags": [ + "shipping" + ], + "description": "Returns the JSON schema to use for providing additional inputs when needed to purchase a shipping offering. Call the getAdditionalInputs operation when the response to a previous call to the getRates operation indicates that additional inputs are required for the rate (shipping offering) that you want to purchase.\n\n**Usage Plan:**\n\n| Default Quota | Unit |\n| ---- | ---- |\n| 5 | Requests Per Second |\n\nThe `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).", + "operationId": "getAdditionalInputs", + "parameters": [ + { + "name": "requestToken", + "in": "query", + "description": "The request token returned in the response to the getRates operation.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "rateId", + "in": "query", + "description": "The rate identifier for the shipping offering (rate) returned in the response to the getRates operation.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "x-amz-access-token", + "in": "header", + "description": "Amazon shipping request token", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "x-amzn-shipping-business-id", + "in": "header", + "description": "Amazon shipping business to assume for this request. The default is AmazonShipping_UK.", + "schema": { + "type": "string", + "enum": [ + "AmazonShipping_US", + "AmazonShipping_IN", + "AmazonShipping_UK", + "AmazonShipping_IT", + "AmazonShipping_ES", + "AmazonShipping_FR" + ], + "x-docgen-enum-table-extension": [ + { + "value": "AmazonShipping_US", + "description": "The United States Amazon shipping business." + }, + { + "value": "AmazonShipping_IN", + "description": "The India Amazon shipping business." + }, + { + "value": "AmazonShipping_UK", + "description": "The United Kingdom Amazon shipping business." + }, + { + "value": "AmazonShipping_IT", + "description": "The Italy Amazon shipping business." + }, + { + "value": "AmazonShipping_ES", + "description": "The Spain Amazon shipping business." + }, + { + "value": "AmazonShipping_FR", + "description": "The France Amazon shipping business." + } + ] + }, + "x-docgen-enum-table-extension": [ + { + "value": "AmazonShipping_US", + "description": "The United States Amazon shipping business." + }, + { + "value": "AmazonShipping_IN", + "description": "The India Amazon shipping business." + }, + { + "value": "AmazonShipping_UK", + "description": "The United Kingdom Amazon shipping business." + }, + { + "value": "AmazonShipping_IT", + "description": "The Italy Amazon shipping business." + }, + { + "value": "AmazonShipping_ES", + "description": "The Spain Amazon shipping business." + }, + { + "value": "AmazonShipping_FR", + "description": "The France Amazon shipping business." + } + ] + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetAdditionalInputsResponse" + }, + "example": { + "payload": { + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Additional inputs for Shipping Offering", + "type": "object", + "properties": { + "harmonizedSystemCode": { + "type": "string", + "description": "Harmonized System's commodity code for an item." + }, + "packageClientReferenceId": { + "type": "string", + "description": "Unique identifier for the item." + } + } + } + } + } + }, + "x-amzn-api-sandbox": { + "static": [ + { + "request": { + "parameters": { + "requestToken": { + "value": "amzn1.rq.123456789.101" + }, + "rateId": { + "value": "122324234543535321345436534321423423523452345" + } + } + }, + "response": { + "payload": {} + } + } + ] + } + }, + "400": { + "description": "Request has missing or invalid parameters and cannot be parsed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "Request is missing or has invalid parameters", + "details": "RequestToken cannot be null" + } + ] + } + } + }, + "x-amzn-api-sandbox": { + "static": [ + { + "request": { + "parameters": { + "requestToken": { + "value": "null" + }, + "rateId": { + "value": "2314346237423894905834905890346890789075" + } + } + }, + "response": { + "errors": [ + { + "code": "InvalidRequest", + "message": "Request is missing or has invalid parameters", + "details": "RequestToken cannot be null" + } + ] + } + } + ] + } + }, + "401": { + "description": "The request's Authorization header is not formatted correctly or does not contain a valid token.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "Unauthorized", + "message": "You don't have access to the requested response or the credentials are invalid." + } + ] + } + } + } + }, + "403": { + "description": "Indicates that access to the resource is forbidden. Possible reasons include Access Denied, Unauthorized, Expired Token, or Invalid Signature.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "Unauthorized", + "message": "You don't have access to the requested response or the credentials are invalid." + } + ] + } + } + } + }, + "404": { + "description": "The resource specified does not exist.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "NotFound", + "message": "The requested resource is invalid or doesn't exist" + } + ] + } + } + } + }, + "413": { + "description": "The request size exceeded the maximum accepted size.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "The request payload size is greater than maximum accepted size." + } + ] + } + } + } + }, + "415": { + "description": "The request payload is in an unsupported format.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InvalidRequest", + "message": "The request payload format is not supported." + } + ] + } + } + } + }, + "429": { + "description": "The frequency of requests was greater than allowed.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "TooManyRequests", + "message": "The total number of requests exceeded your allowed limit." + } + ] + } + } + } + }, + "500": { + "description": "An unexpected condition occurred that prevented the server from fulfilling the request.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "InternalError", + "message": "Something went wrong while processing the request." + } + ] + } + } + } + }, + "503": { + "description": "Temporary overloading or maintenance of the server.", + "headers": { + "x-amzn-RequestId": { + "description": "Unique request reference identifier.", + "schema": { + "type": "string" + } + }, + "x-amzn-RateLimit-Limit": { + "description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorList" + }, + "example": { + "errors": [ + { + "code": "ServiceUnavailable", + "message": "Service temporarily unavailable or down for maintenance. Please try again after sometime." + } + ] + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Error": { + "required": [ + "code", + "message" + ], + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "An error code that identifies the type of error that occurred." + }, + "message": { + "type": "string", + "description": "A message that describes the error condition." + }, + "details": { + "type": "string", + "description": "Additional details that can help the caller understand or fix the issue." + } + }, + "description": "Error response returned when the request is unsuccessful." + }, + "ErrorList": { + "required": [ + "errors" + ], + "type": "object", + "properties": { + "errors": { + "type": "array", + "description": "Array of Errors", + "items": { + "$ref": "#/components/schemas/Error" + } + } + }, + "description": "A list of error responses returned when a request is unsuccessful." + }, + "Weight": { + "required": [ + "unit", + "value" + ], + "type": "object", + "properties": { + "unit": { + "type": "string", + "description": "The unit of measurement.", + "enum": [ + "GRAM", + "KILOGRAM", + "OUNCE", + "POUND" + ], + "x-docgen-enum-table-extension": [ + { + "value": "GRAM", + "description": "Metric unit of mass equal to one thousandth of a kilogram." + }, + { + "value": "KILOGRAM", + "description": "Metric unit of mass." + }, + { + "value": "OUNCE", + "description": "The imperial unit of weight that is one sixteenth of a pound." + }, + { + "value": "POUND", + "description": "The imperial unit of weight." + } + ] + }, + "value": { + "type": "number", + "description": "The measurement value." + } + }, + "description": "The weight in the units indicated." + }, + "LiquidVolume": { + "required": [ + "unit", + "value" + ], + "type": "object", + "properties": { + "unit": { + "type": "string", + "description": "The unit of measurement.", + "enum": [ + "ML", + "L", + "FL_OZ", + "GAL", + "PT", + "QT", + "C" + ], + "x-docgen-enum-table-extension": [ + { + "value": "ML", + "description": "Milliliter - Metric unit of volume." + }, + { + "value": "L", + "description": "Liter - Metric unit of volume." + }, + { + "value": "FL_OZ", + "description": "Fluid Ounce - Imperial unit of volume." + }, + { + "value": "GAL", + "description": "Gallon - Imperial unit of volume." + }, + { + "value": "PT", + "description": "Pint - Imperial unit of volume." + }, + { + "value": "QT", + "description": "Quart - Imperial unit of volume." + }, + { + "value": "C", + "description": "Cup - Imperial unit of volume." + } + ] + }, + "value": { + "type": "number", + "description": "The measurement value." + } + }, + "description": "Liquid Volume." + }, + "InvoiceDetails": { + "type": "object", + "properties": { + "invoiceNumber": { + "type": "string", + "description": "The invoice number of the item." + }, + "invoiceDate": { + "type": "string", + "description": "The invoice date of the item in ISO 8061 format.", + "format": "date-time" + } + }, + "description": "The invoice details for charges associated with the goods in the package. Only applies to certain regions." + }, + "ChargeList": { + "type": "array", + "description": "A list of charges based on the shipping service charges applied on a package.", + "items": { + "$ref": "#/components/schemas/ChargeComponent" + } + }, + "ChargeComponent": { + "type": "object", + "properties": { + "amount": { + "$ref": "#/components/schemas/Currency" + }, + "chargeType": { + "type": "string", + "description": "The type of charge.", + "enum": [ + "TAX", + "DISCOUNT" + ], + "x-docgen-enum-table-extension": [ + { + "value": "TAX", + "description": "A tax imposed on a package." + }, + { + "value": "DISCOUNT", + "description": "A discount deducted from the cost of a package." + } + ] + } + }, + "description": "The type and amount of a charge applied on a package." + }, + "Currency": { + "required": [ + "unit", + "value" + ], + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "The monetary value." + }, + "unit": { + "maxLength": 3, + "minLength": 3, + "type": "string", + "description": "The ISO 4217 format 3-character currency code." + } + }, + "description": "The monetary value in the currency indicated, in ISO 4217 standard format." + }, + "Dimensions": { + "required": [ + "height", + "length", + "unit", + "width" + ], + "type": "object", + "properties": { + "length": { + "type": "number", + "description": "The length of the package." + }, + "width": { + "type": "number", + "description": "The width of the package." + }, + "height": { + "type": "number", + "description": "The height of the package." + }, + "unit": { + "type": "string", + "description": "The unit of measurement.", + "enum": [ + "INCH", + "CENTIMETER" + ], + "x-docgen-enum-table-extension": [ + { + "value": "INCH", + "description": "The imperial unit of length equal to one twelfth of a foot." + }, + { + "value": "CENTIMETER", + "description": "A metric unit of length, equal to one hundredth of a meter." + } + ] + } + }, + "description": "A set of measurements for a three-dimensional object." + }, + "RequestToken": { + "type": "string", + "description": "A unique token generated to identify a getRates operation." + }, + "RateId": { + "type": "string", + "description": "An identifier for the rate (shipment offering) provided by a shipping service provider." + }, + "CarrierId": { + "type": "string", + "description": "The carrier identifier for the offering, provided by the carrier." + }, + "CarrierName": { + "type": "string", + "description": "The carrier name for the offering." + }, + "AccountId": { + "type": "string", + "description": "Identifier for the seller's carrier account." + }, + "PackageClientReferenceId": { + "type": "string", + "description": "A client provided unique identifier for a package being shipped. This value should be saved by the client to pass as a parameter to the getShipmentDocuments operation." + }, + "ShipmentId": { + "type": "string", + "description": "The unique shipment identifier provided by a shipping service." + }, + "DetailCodes": { + "type": "string", + "description": "A list of codes used to provide additional shipment information.", + "enum": [ + "BusinessClosed", + "CustomerUnavailable", + "PaymentNotReady", + "OtpNotAvailable", + "DeliveryAttempted", + "UnableToAccess", + "UnableToContactRecipient", + "DeliveredToBehindWheelieBin", + "DeliveredToPorch", + "DeliveredToGarage", + "DeliveredToGarden", + "DeliveredToGreenhouse", + "DeliveredToMailSlot", + "DeliveredToMailRoom", + "DeliveredToNeighbor", + "DeliveredToRearDoor", + "DeliveredToReceptionist", + "DeliveredToShed", + "DeliveredWithOTP", + "Signed", + "Damaged", + "IncorrectItems", + "NotRequired", + "Rejected", + "RejectedByRecipientWithVerification", + "CancelledByRecipient", + "AddressNotFound", + "HazmatShipment", + "Undeliverable", + "ArrivedAtLocalFacility" + ], + "x-docgen-enum-table-extension": [ + { + "value": "BusinessClosed", + "description": "Attempted delivery but the business was closed." + }, + { + "value": "CustomerUnavailable", + "description": "Attempted delivery but the recipient was unavailable." + }, + { + "value": "PaymentNotReady", + "description": "Attempted delivery but cash was not available from recipient." + }, + { + "value": "OtpNotAvailable", + "description": "Attempted delivery but the recipient did not have the PIN available." + }, + { + "value": "DeliveryAttempted", + "description": "Delivery was attempted." + }, + { + "value": "UnableToAccess", + "description": "Attempted delivery but could not access the recipient location." + }, + { + "value": "UnableToContactRecipient", + "description": "Attempted delivery but unable to contact the recipient to coordinate delivery." + }, + { + "value": "DeliveredToBehindWheelieBin", + "description": "Shipment delivered behind wheelie bin." + }, + { + "value": "DeliveredToPorch", + "description": "Shipment delivered to front porch or front door." + }, + { + "value": "DeliveredToGarage", + "description": "Shipment delivered to garage." + }, + { + "value": "DeliveredToGarden", + "description": "Shipment delivered to garden." + }, + { + "value": "DeliveredToGreenhouse", + "description": "Shipment delivered to greenhouse." + }, + { + "value": "DeliveredToMailSlot", + "description": "Shipment delivered to letterbox/mail slot." + }, + { + "value": "DeliveredToMailRoom", + "description": "Shipment delivered to mailroom." + }, + { + "value": "DeliveredToNeighbor", + "description": "Shipment delivered and signed for by neighbor." + }, + { + "value": "DeliveredToRearDoor", + "description": "Shipment delivered to rear porch or rear door." + }, + { + "value": "DeliveredToReceptionist", + "description": "Shipment delivered to reception." + }, + { + "value": "DeliveredToShed", + "description": "Shipment delivered to shed." + }, + { + "value": "DeliveredWithOTP", + "description": "Shipment delivered with onetime passcode." + }, + { + "value": "Signed", + "description": "Shipment delivered and signature received." + }, + { + "value": "Damaged", + "description": "Shipment was damaged. When paired with Rejected this indicates the recipient refused to accept the shipment because the shipment was damaged. When paired with UNDELIVERABLE it means the shipment was undeliverable due to being damaged and may be returned to the seller." + }, + { + "value": "IncorrectItems", + "description": "Recipient refused to accept the shipment because the shipment contains incorrect item/s." + }, + { + "value": "NotRequired", + "description": "Recipient refused to accept the shipment because the recipient did not want the shipment." + }, + { + "value": "Rejected", + "description": "Recipient refused to accept the shipment." + }, + { + "value": "RejectedByRecipientWithVerification", + "description": "Recipient refused to accept the shipment and provided verification." + }, + { + "value": "CancelledByRecipient", + "description": "Shipment was cancelled by the recipient. This tag is paired with the rejected shipment status." + }, + { + "value": "AddressNotFound", + "description": "Shipment is undeliverable and is returning to seller because the address was missing or incorrect." + }, + { + "value": "HazmatShipment", + "description": "Shipment is non-compliant Hazmat." + }, + { + "value": "Undeliverable", + "description": "Shipment is undeliverable and is returning to the seller." + }, + { + "value": "ArrivedAtLocalFacility", + "description": "Package arrived at the local facility." + } + ] + }, + "TrackingDetailCodes": { + "required": [ + "forward", + "returns" + ], + "type": "object", + "properties": { + "forward": { + "type": "array", + "description": "Contains detail codes that provide additional details related to the forward leg of the shipment.", + "items": { + "$ref": "#/components/schemas/DetailCodes" + } + }, + "returns": { + "type": "array", + "description": "Contains detail codes that provide additional details related to the return leg of the shipment.", + "items": { + "$ref": "#/components/schemas/DetailCodes" + } + } + }, + "description": "Contains detail codes that provide additional details related to the forward and return leg of the shipment." + }, + "TrackingId": { + "type": "string", + "description": "The carrier generated identifier for a package in a purchased shipment." + }, + "AlternateLegTrackingId": { + "type": "string", + "description": "The carrier generated reverse identifier for a returned package in a purchased shipment." + }, + "ServiceId": { + "type": "string", + "description": "An identifier for the shipping service." + }, + "ServiceName": { + "type": "string", + "description": "The name of the shipping service." + }, + "AdditionalAddressNotes": { + "maxLength": 256, + "type": "string", + "description": "Address notes to re-attempt delivery with." + }, + "ShipperInstruction": { + "type": "object", + "properties": { + "deliveryNotes": { + "maxLength": 256, + "type": "string", + "description": "The delivery notes for the shipment" + } + }, + "description": "The shipper instruction." + }, + "Address": { + "required": [ + "addressLine1", + "city", + "countryCode", + "name", + "postalCode", + "stateOrRegion" + ], + "type": "object", + "properties": { + "name": { + "maxLength": 50, + "minLength": 1, + "type": "string", + "description": "The name of the person, business or institution at the address." + }, + "addressLine1": { + "maxLength": 60, + "minLength": 1, + "type": "string", + "description": "The first line of the address." + }, + "addressLine2": { + "maxLength": 60, + "minLength": 1, + "type": "string", + "description": "Additional address information, if required." + }, + "addressLine3": { + "maxLength": 60, + "minLength": 1, + "type": "string", + "description": "Additional address information, if required." + }, + "companyName": { + "type": "string", + "description": "The name of the business or institution associated with the address." + }, + "stateOrRegion": { + "$ref": "#/components/schemas/StateOrRegion" + }, + "city": { + "$ref": "#/components/schemas/City" + }, + "countryCode": { + "$ref": "#/components/schemas/CountryCode" + }, + "postalCode": { + "$ref": "#/components/schemas/PostalCode" + }, + "email": { + "maxLength": 64, + "type": "string", + "description": "The email address of the contact associated with the address." + }, + "phoneNumber": { + "maxLength": 20, + "minLength": 1, + "type": "string", + "description": "The phone number of the person, business or institution located at that address, including the country calling code." + }, + "geocode": { + "$ref": "#/components/schemas/Geocode" + } + }, + "description": "The address." + }, + "Geocode": { + "type": "object", + "properties": { + "latitude": { + "type": "string", + "description": "The latitude of access point." + }, + "longitude": { + "type": "string", + "description": "The longitude of access point." + } + }, + "description": "Defines the latitude and longitude of the access point." + }, + "StateOrRegion": { + "type": "string", + "description": "The state, county or region where the person, business or institution is located." + }, + "City": { + "type": "string", + "description": "The city or town where the person, business or institution is located." + }, + "CountryCode": { + "type": "string", + "description": "The two digit country code. Follows ISO 3166-1 alpha-2 format." + }, + "PostalCode": { + "type": "string", + "description": "The postal code of that address. It contains a series of letters or digits or both, sometimes including spaces or punctuation." + }, + "Location": { + "type": "object", + "properties": { + "stateOrRegion": { + "$ref": "#/components/schemas/StateOrRegion" + }, + "city": { + "$ref": "#/components/schemas/City" + }, + "countryCode": { + "$ref": "#/components/schemas/CountryCode" + }, + "postalCode": { + "$ref": "#/components/schemas/PostalCode" + } + }, + "description": "The location where the person, business or institution is located." + }, + "DocumentFormat": { + "type": "string", + "description": "The file format of the document.", + "enum": [ + "PDF", + "PNG", + "ZPL" + ], + "x-docgen-enum-table-extension": [ + { + "value": "PDF", + "description": "The Portable Document Format (PDF) file format. Used to present documents, including text formatting and images, in a manner independent of application software, hardware, and operating systems." + }, + { + "value": "PNG", + "description": "Portable Network Graphics (PNG) is a raster-graphics file format that supports lossless data compression." + }, + { + "value": "ZPL", + "description": "Zebra Programming Language (ZPL) format is from Zebra Technologies. It's used primarily for labeling applications and can only be used with ZPL compatible printers." + } + ] + }, + "DocumentType": { + "type": "string", + "description": "The type of shipping document.", + "enum": [ + "PACKSLIP", + "LABEL", + "RECEIPT", + "CUSTOM_FORM" + ], + "x-docgen-enum-table-extension": [ + { + "value": "PACKSLIP", + "description": "A listing of the items packed within the shipment." + }, + { + "value": "LABEL", + "description": "The shipping label for the specific shipment." + }, + { + "value": "RECEIPT", + "description": "The receipt of the shipment." + }, + { + "value": "CUSTOM_FORM", + "description": "The customs documentation for a cross-border shipment." + } + ] + }, + "Dpi": { + "type": "integer", + "description": "The dots per inch (DPI) value used in printing. This value represents a measure of the resolution of the document." + }, + "PageLayout": { + "type": "string", + "description": "Indicates the position of the label on the paper. Should be the same value as returned in getRates response." + }, + "NeedFileJoining": { + "type": "boolean", + "description": "When true, files should be stitched together. Otherwise, files should be returned separately. Defaults to false." + }, + "Contents": { + "type": "string", + "description": "A Base64 encoded string of the file contents." + }, + "RequestedLabelCustomization": { + "type": "object", + "properties": { + "requestAttributes": { + "$ref": "#/components/schemas/RequestAttributes" + } + }, + "description": "Object contains customised data requested by a shipper to be printed on a shipping label." + }, + "RequestAttributes": { + "type": "array", + "description": "Specify the type of attributes to be added on a label.", + "items": { + "$ref": "#/components/schemas/LabelAttribute" + } + }, + "LabelAttribute": { + "type": "string", + "description": "Enumerates the attributes supported to be printed on a shipping label. The values for these attributes are retrieved from GetRates/OneClickShipment request", + "enum": [ + "PACKAGE_CLIENT_REFERENCE_ID", + "SELLER_DISPLAY_NAME", + "COLLECT_ON_DELIVERY_AMOUNT" + ], + "x-docgen-enum-table-extension": [ + { + "value": "PACKAGE_CLIENT_REFERENCE_ID", + "description": "Prints client reference ID on the shipping label" + }, + { + "value": "SELLER_DISPLAY_NAME", + "description": "Prints seller name on the shipping label" + }, + { + "value": "COLLECT_ON_DELIVERY_AMOUNT", + "description": "Prints Collect On Delivery amount on the shipping label." + } + ] + }, + "PackageDocumentList": { + "type": "array", + "description": "A list of documents related to a package.", + "items": { + "$ref": "#/components/schemas/PackageDocument" + } + }, + "PackageDocument": { + "required": [ + "contents", + "format", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/DocumentType" + }, + "format": { + "$ref": "#/components/schemas/DocumentFormat" + }, + "contents": { + "$ref": "#/components/schemas/Contents" + } + }, + "description": "A document related to a package." + }, + "PrintOptionList": { + "type": "array", + "description": "A list of the format options for a label.", + "items": { + "$ref": "#/components/schemas/PrintOption" + } + }, + "PrintOption": { + "required": [ + "supportedDocumentDetails", + "supportedFileJoiningOptions", + "supportedPageLayouts" + ], + "type": "object", + "properties": { + "supportedDPIs": { + "type": "array", + "description": "A list of the supported DPI options for a document.", + "items": { + "$ref": "#/components/schemas/Dpi" + } + }, + "supportedPageLayouts": { + "type": "array", + "description": "A list of the supported page layout options for a document.", + "items": { + "$ref": "#/components/schemas/PageLayout" + } + }, + "supportedFileJoiningOptions": { + "type": "array", + "description": "A list of the supported needFileJoining boolean values for a document.", + "items": { + "$ref": "#/components/schemas/NeedFileJoining" + } + }, + "supportedDocumentDetails": { + "type": "array", + "description": "A list of the supported documented details.", + "items": { + "$ref": "#/components/schemas/SupportedDocumentDetail" + } + } + }, + "description": "The format options available for a label." + }, + "DocumentSize": { + "required": [ + "length", + "unit", + "width" + ], + "type": "object", + "properties": { + "width": { + "type": "number", + "description": "The width of the document measured in the units specified." + }, + "length": { + "type": "number", + "description": "The length of the document measured in the units specified." + }, + "unit": { + "type": "string", + "description": "The unit of measurement.", + "enum": [ + "INCH", + "CENTIMETER" + ], + "x-docgen-enum-table-extension": [ + { + "value": "INCH", + "description": "The imperial unit of length equal to one twelfth of a foot." + }, + { + "value": "CENTIMETER", + "description": "A metric unit of length, equal to one hundredth of a meter." + } + ] + } + }, + "description": "The size dimensions of the label." + }, + "SupportedDocumentDetail": { + "required": [ + "isMandatory", + "name" + ], + "type": "object", + "properties": { + "name": { + "$ref": "#/components/schemas/DocumentType" + }, + "isMandatory": { + "type": "boolean", + "description": "When true, the supported document type is required." + } + }, + "description": "The supported document types for a service offering." + }, + "RequestedDocumentSpecification": { + "required": [ + "format", + "needFileJoining", + "requestedDocumentTypes", + "size" + ], + "type": "object", + "properties": { + "format": { + "$ref": "#/components/schemas/DocumentFormat" + }, + "size": { + "$ref": "#/components/schemas/DocumentSize" + }, + "dpi": { + "$ref": "#/components/schemas/Dpi" + }, + "pageLayout": { + "$ref": "#/components/schemas/PageLayout" + }, + "needFileJoining": { + "$ref": "#/components/schemas/NeedFileJoining" + }, + "requestedDocumentTypes": { + "type": "array", + "description": "A list of the document types requested.", + "items": { + "$ref": "#/components/schemas/DocumentType" + } + }, + "requestedLabelCustomization": { + "$ref": "#/components/schemas/RequestedLabelCustomization" + } + }, + "description": "The document specifications requested. For calls to the purchaseShipment operation, the shipment purchase fails if the specified document specifications are not among those returned in the response to the getRates operation." + }, + "SupportedDocumentSpecificationList": { + "type": "array", + "description": "A list of the document specifications supported for a shipment service offering.", + "items": { + "$ref": "#/components/schemas/SupportedDocumentSpecification" + } + }, + "SupportedDocumentSpecification": { + "required": [ + "format", + "printOptions", + "size" + ], + "type": "object", + "properties": { + "format": { + "$ref": "#/components/schemas/DocumentFormat" + }, + "size": { + "$ref": "#/components/schemas/DocumentSize" + }, + "printOptions": { + "$ref": "#/components/schemas/PrintOptionList" + } + }, + "description": "Document specification that is supported for a service offering." + }, + "Item": { + "required": [ + "quantity" + ], + "type": "object", + "properties": { + "itemValue": { + "$ref": "#/components/schemas/Currency" + }, + "description": { + "type": "string", + "description": "The product description of the item." + }, + "itemIdentifier": { + "type": "string", + "description": "A unique identifier for an item provided by the client." + }, + "quantity": { + "type": "integer", + "description": "The number of units. This value is required." + }, + "weight": { + "$ref": "#/components/schemas/Weight" + }, + "liquidVolume": { + "$ref": "#/components/schemas/LiquidVolume" + }, + "isHazmat": { + "type": "boolean", + "description": "When true, the item qualifies as hazardous materials (hazmat). Defaults to false." + }, + "dangerousGoodsDetails": { + "$ref": "#/components/schemas/DangerousGoodsDetails" + }, + "productType": { + "type": "string", + "description": "The product type of the item." + }, + "invoiceDetails": { + "$ref": "#/components/schemas/InvoiceDetails" + }, + "serialNumbers": { + "type": "array", + "description": "A list of unique serial numbers in an Amazon package that can be used to guarantee non-fraudulent items. The number of serial numbers in the list must be less than or equal to the quantity of items being shipped. Only applicable when channel source is Amazon.", + "items": { + "type": "string" + } + }, + "directFulfillmentItemIdentifiers": { + "$ref": "#/components/schemas/DirectFulfillmentItemIdentifiers" + } + }, + "description": "An item in a package." + }, + "ItemList": { + "type": "array", + "description": "A list of items.", + "items": { + "$ref": "#/components/schemas/Item" + } + }, + "Package": { + "required": [ + "dimensions", + "insuredValue", + "items", + "packageClientReferenceId", + "weight" + ], + "type": "object", + "properties": { + "dimensions": { + "$ref": "#/components/schemas/Dimensions" + }, + "weight": { + "$ref": "#/components/schemas/Weight" + }, + "insuredValue": { + "$ref": "#/components/schemas/Currency" + }, + "isHazmat": { + "type": "boolean", + "description": "When true, the package contains hazardous materials. Defaults to false." + }, + "sellerDisplayName": { + "type": "string", + "description": "The seller name displayed on the label." + }, + "charges": { + "$ref": "#/components/schemas/ChargeList" + }, + "packageClientReferenceId": { + "$ref": "#/components/schemas/PackageClientReferenceId" + }, + "items": { + "$ref": "#/components/schemas/ItemList" + } + }, + "description": "A package to be shipped through a shipping service offering." + }, + "PackageList": { + "type": "array", + "description": "A list of packages to be shipped through a shipping service offering.", + "items": { + "$ref": "#/components/schemas/Package" + } + }, + "DirectFulfillmentItemIdentifiers": { + "required": [ + "lineItemID" + ], + "type": "object", + "properties": { + "lineItemID": { + "type": "string", + "description": "A unique identifier for an item provided by the client for a direct fulfillment shipment. This is only populated for direct fulfillment multi-piece shipments. It is required if a vendor wants to change the configuration of the packages in which the purchase order is shipped." + }, + "pieceNumber": { + "type": "string", + "description": "A unique identifier for an item provided by the client for a direct fulfillment shipment. This is only populated if a single line item has multiple pieces. Defaults to 1." + } + }, + "description": "Item identifiers for an item in a direct fulfillment shipment." + }, + "PackageDocumentDetail": { + "required": [ + "packageClientReferenceId", + "packageDocuments" + ], + "type": "object", + "properties": { + "packageClientReferenceId": { + "$ref": "#/components/schemas/PackageClientReferenceId" + }, + "packageDocuments": { + "$ref": "#/components/schemas/PackageDocumentList" + }, + "trackingId": { + "$ref": "#/components/schemas/TrackingId" + } + }, + "description": "The post-purchase details of a package that will be shipped using a shipping service." + }, + "PackageDocumentDetailList": { + "type": "array", + "description": "A list of post-purchase details about a package that will be shipped using a shipping service.", + "items": { + "$ref": "#/components/schemas/PackageDocumentDetail" + } + }, + "TimeWindow": { + "type": "object", + "properties": { + "start": { + "type": "string", + "description": "The start time of the time window.", + "format": "date-time" + }, + "end": { + "type": "string", + "description": "The end time of the time window.", + "format": "date-time" + } + }, + "description": "The start and end time that specifies the time interval of an event." + }, + "Promise": { + "type": "object", + "properties": { + "deliveryWindow": { + "$ref": "#/components/schemas/TimeWindow" + }, + "pickupWindow": { + "$ref": "#/components/schemas/TimeWindow" + } + }, + "description": "The time windows promised for pickup and delivery events." + }, + "RequestedValueAddedServiceList": { + "type": "array", + "description": "The value-added services to be added to a shipping service purchase.", + "items": { + "$ref": "#/components/schemas/RequestedValueAddedService" + } + }, + "RequestedValueAddedService": { + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The identifier of the selected value-added service. Must be among those returned in the response to the getRates operation." + } + }, + "description": "A value-added service to be applied to a shipping service purchase." + }, + "AvailableValueAddedServiceGroupList": { + "type": "array", + "description": "A list of value-added services available for a shipping service offering.", + "items": { + "$ref": "#/components/schemas/AvailableValueAddedServiceGroup" + } + }, + "AvailableValueAddedServiceGroup": { + "required": [ + "groupDescription", + "groupId", + "isRequired" + ], + "type": "object", + "properties": { + "groupId": { + "type": "string", + "description": "The type of the value-added service group." + }, + "groupDescription": { + "type": "string", + "description": "The name of the value-added service group." + }, + "isRequired": { + "type": "boolean", + "description": "When true, one or more of the value-added services listed must be specified." + }, + "valueAddedServices": { + "type": "array", + "description": "A list of optional value-added services available for purchase with a shipping service offering.", + "items": { + "$ref": "#/components/schemas/ValueAddedService" + } + } + }, + "description": "The value-added services available for purchase with a shipping service offering." + }, + "ValueAddedService": { + "required": [ + "cost", + "id", + "name" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The identifier for the value-added service." + }, + "name": { + "type": "string", + "description": "The name of the value-added service." + }, + "cost": { + "$ref": "#/components/schemas/Currency" + } + }, + "description": "A value-added service available for purchase with a shipment service offering." + }, + "CollectOnDelivery": { + "required": [ + "amount" + ], + "type": "object", + "properties": { + "amount": { + "$ref": "#/components/schemas/Currency" + } + }, + "description": "The amount to collect on delivery." + }, + "ValueAddedServiceDetails": { + "type": "object", + "properties": { + "collectOnDelivery": { + "$ref": "#/components/schemas/CollectOnDelivery" + } + }, + "description": "A collection of supported value-added services." + }, + "DangerousGoodsDetails": { + "type": "object", + "properties": { + "unitedNationsRegulatoryId": { + "pattern": "^(UN|ID|NA)[0-9]{4}$", + "type": "string", + "description": "The specific UNID of the item being shipped." + }, + "transportationRegulatoryClass": { + "pattern": "^[1-9](\\.[1-9])?$", + "type": "string", + "description": "The specific regulatory class of the item being shipped." + }, + "packingGroup": { + "type": "string", + "description": "The specific packaging group of the item being shipped.", + "enum": [ + "I", + "II", + "III" + ], + "x-docgen-enum-table-extension": [ + { + "value": "I", + "description": "Packing group I indicates great danger." + }, + { + "value": "II", + "description": "Packing group II indicates medium danger." + }, + { + "value": "III", + "description": "Packing group III indicates minor danger." + } + ] + }, + "packingInstruction": { + "type": "string", + "description": "The specific packing instruction of the item being shipped.", + "enum": [ + "PI965_SECTION_IA", + "PI965_SECTION_IB", + "PI965_SECTION_II", + "PI966_SECTION_I", + "PI966_SECTION_II", + "PI967_SECTION_I", + "PI967_SECTION_II", + "PI968_SECTION_IA", + "PI968_SECTION_IB", + "PI969_SECTION_I", + "PI969_SECTION_II", + "PI970_SECTION_I", + "PI970_SECTION_II" + ], + "x-docgen-enum-table-extension": [ + { + "value": "PI965_SECTION_IA", + "description": "Ion PI965 Section IA (LiBa)" + }, + { + "value": "PI965_SECTION_IB", + "description": "Ion PI965 Section IB (LiBa)" + }, + { + "value": "PI965_SECTION_II", + "description": "Ion PI965 Section II (LiBa)" + }, + { + "value": "PI966_SECTION_I", + "description": "Ion PI966 Section I (LiBa with equipment)" + }, + { + "value": "PI966_SECTION_II", + "description": "Ion PI966 Section II (LiBa with equipment)" + }, + { + "value": "PI967_SECTION_I", + "description": "Ion PI967 Section I (LiBa in equipment)" + }, + { + "value": "PI967_SECTION_II", + "description": "Ion PI967 Section II (LiBa in equipment)" + }, + { + "value": "PI968_SECTION_IA", + "description": "Metal PI968 Section IA (LiBa)" + }, + { + "value": "PI968_SECTION_IB", + "description": "Metal PI968 Section IB (LiBa)" + }, + { + "value": "PI969_SECTION_I", + "description": "Metal PI969 Section I (LiBa with equipment)" + }, + { + "value": "PI969_SECTION_II", + "description": "Metal PI969 Section II (LiBa with equipment)" + }, + { + "value": "PI970_SECTION_I", + "description": "Metal PI970 Section I (LiBa in equipment)" + }, + { + "value": "PI970_SECTION_II", + "description": "Metal PI970 Section II (LiBa in equipment)" + } + ] + } + }, + "description": "Details related to any dangerous goods/items that are being shipped." + }, + "TaxType": { + "type": "string", + "description": "Indicates the type of tax.", + "enum": [ + "GST" + ], + "x-docgen-enum-table-extension": [ + { + "value": "GST", + "description": "Goods and Services Tax." + } + ] + }, + "TaxDetail": { + "required": [ + "taxRegistrationNumber", + "taxType" + ], + "type": "object", + "properties": { + "taxType": { + "$ref": "#/components/schemas/TaxType" + }, + "taxRegistrationNumber": { + "type": "string", + "description": "The shipper's tax registration number associated with the shipment for customs compliance purposes in certain regions." + } + }, + "description": "Indicates the tax specifications associated with the shipment for customs compliance purposes in certain regions." + }, + "TaxDetailList": { + "type": "array", + "description": "A list of tax detail information.", + "items": { + "$ref": "#/components/schemas/TaxDetail" + } + }, + "EventCode": { + "type": "string", + "description": "The tracking event type.", + "enum": [ + "ReadyForReceive", + "PickupDone", + "Delivered", + "Departed", + "DeliveryAttempted", + "Lost", + "OutForDelivery", + "ArrivedAtCarrierFacility", + "Rejected", + "Undeliverable", + "PickupCancelled", + "ReturnInitiated", + "AvailableForPickup", + "RecipientRequestedAlternateDeliveryTiming" + ], + "x-docgen-enum-table-extension": [ + { + "value": "ReadyForReceive", + "description": "Package has been created and is ready for pickup at the shippers location. This is a pre-transit status event code." + }, + { + "value": "PickupDone", + "description": "Package has been picked up by the service provider." + }, + { + "value": "Delivered", + "description": "Package has been delivered." + }, + { + "value": "Departed", + "description": "Package has departed from a particular location in carrier network." + }, + { + "value": "DeliveryAttempted", + "description": "Delivery was attempted, but was unsuccessful." + }, + { + "value": "Lost", + "description": "Package is lost." + }, + { + "value": "OutForDelivery", + "description": "Package is out for delivery." + }, + { + "value": "ArrivedAtCarrierFacility", + "description": "Package is in transit and has been received at a carrier location." + }, + { + "value": "Rejected", + "description": "Package was rejected by the recipient." + }, + { + "value": "Undeliverable", + "description": "Package is undeliverable." + }, + { + "value": "PickupCancelled", + "description": "Pickup scheduled for the package was cancelled." + }, + { + "value": "ReturnInitiated", + "description": "Return label has been generated." + }, + { + "value": "AvailableForPickup", + "description": "Package held for recipient pickup." + }, + { + "value": "RecipientRequestedAlternateDeliveryTiming", + "description": "Recipient has requested an update to their delivery date." + } + ] + }, + "Event": { + "required": [ + "eventCode", + "eventTime" + ], + "type": "object", + "properties": { + "eventCode": { + "$ref": "#/components/schemas/EventCode" + }, + "location": { + "$ref": "#/components/schemas/Location" + }, + "eventTime": { + "type": "string", + "description": "The ISO 8601 formatted timestamp of the event.", + "format": "date-time" + }, + "shipmentType": { + "$ref": "#/components/schemas/ShipmentType" + } + }, + "description": "A tracking event." + }, + "TrackingSummary": { + "type": "object", + "properties": { + "status": { + "$ref": "#/components/schemas/Status" + }, + "trackingDetailCodes": { + "$ref": "#/components/schemas/TrackingDetailCodes" + } + }, + "description": "A package status summary." + }, + "Status": { + "type": "string", + "description": "The status of the package being shipped.", + "enum": [ + "PreTransit", + "InTransit", + "Delivered", + "Lost", + "OutForDelivery", + "Rejected", + "Undeliverable", + "DeliveryAttempted", + "PickupCancelled", + "AwaitingCustomerPickup" + ], + "x-docgen-enum-table-extension": [ + { + "value": "PreTransit", + "description": "Package has been created but has not been picked up." + }, + { + "value": "InTransit", + "description": "Package has been picked up and is in transit." + }, + { + "value": "Delivered", + "description": "Package has has been delivered successfully." + }, + { + "value": "Lost", + "description": "Package is lost." + }, + { + "value": "OutForDelivery", + "description": "Package is out for delivery." + }, + { + "value": "Rejected", + "description": "Package has been rejected by the recipient." + }, + { + "value": "Undeliverable", + "description": "Package was undeliverable." + }, + { + "value": "DeliveryAttempted", + "description": "Delivery was attempted to the recipient location, but was not delivered." + }, + { + "value": "PickupCancelled", + "description": "Pickup was cancelled for the package." + }, + { + "value": "AwaitingCustomerPickup", + "description": "Package held at facility for the customer pickup." + } + ] + }, + "AmazonOrderDetails": { + "required": [ + "orderId" + ], + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The Amazon order ID associated with the Amazon order fulfilled by this shipment." + } + }, + "description": "Amazon order information. This is required if the shipment source channel is Amazon." + }, + "AmazonShipmentDetails": { + "required": [ + "shipmentId" + ], + "type": "object", + "properties": { + "shipmentId": { + "type": "string", + "description": "This attribute is required only for a Direct Fulfillment shipment. This is the encrypted shipment ID." + } + }, + "description": "Amazon shipment information." + }, + "ChannelType": { + "type": "string", + "description": "The shipment source channel type.", + "enum": [ + "AMAZON", + "EXTERNAL" + ], + "x-docgen-enum-table-extension": [ + { + "value": "AMAZON", + "description": "Indicates that the shipment originates from an Amazon order." + }, + { + "value": "EXTERNAL", + "description": "Indicates that the shipment originates from a non-Amazon channel." + } + ] + }, + "ChannelDetails": { + "required": [ + "channelType" + ], + "type": "object", + "properties": { + "channelType": { + "$ref": "#/components/schemas/ChannelType" + }, + "amazonOrderDetails": { + "$ref": "#/components/schemas/AmazonOrderDetails" + }, + "amazonShipmentDetails": { + "$ref": "#/components/schemas/AmazonShipmentDetails" + } + }, + "description": "Shipment source channel related information." + }, + "RateList": { + "type": "array", + "description": "A list of eligible shipping service offerings.", + "items": { + "$ref": "#/components/schemas/Rate" + } + }, + "Rate": { + "required": [ + "carrierId", + "carrierName", + "promise", + "rateId", + "requiresAdditionalInputs", + "serviceId", + "serviceName", + "supportedDocumentSpecifications", + "totalCharge" + ], + "type": "object", + "properties": { + "rateId": { + "$ref": "#/components/schemas/RateId" + }, + "carrierId": { + "$ref": "#/components/schemas/CarrierId" + }, + "carrierName": { + "$ref": "#/components/schemas/CarrierName" + }, + "serviceId": { + "$ref": "#/components/schemas/ServiceId" + }, + "serviceName": { + "$ref": "#/components/schemas/ServiceName" + }, + "billedWeight": { + "$ref": "#/components/schemas/Weight" + }, + "totalCharge": { + "$ref": "#/components/schemas/Currency" + }, + "promise": { + "$ref": "#/components/schemas/Promise" + }, + "supportedDocumentSpecifications": { + "$ref": "#/components/schemas/SupportedDocumentSpecificationList" + }, + "availableValueAddedServiceGroups": { + "$ref": "#/components/schemas/AvailableValueAddedServiceGroupList" + }, + "requiresAdditionalInputs": { + "type": "boolean", + "description": "When true, indicates that additional inputs are required to purchase this shipment service. You must then call the getAdditionalInputs operation to return the JSON schema to use when providing the additional inputs to the purchaseShipment operation." + }, + "rateItemList": { + "$ref": "#/components/schemas/RateItemList" + }, + "paymentType": { + "$ref": "#/components/schemas/PaymentType" + }, + "benefits": { + "$ref": "#/components/schemas/Benefits" + } + }, + "description": "The details of a shipping service offering." + }, + "IneligibilityReasonCode": { + "type": "string", + "description": "Reasons that make a shipment service offering ineligible.", + "enum": [ + "NO_COVERAGE", + "PICKUP_SLOT_RESTRICTION", + "UNSUPPORTED_VAS", + "VAS_COMBINATION_RESTRICTION", + "SIZE_RESTRICTIONS", + "WEIGHT_RESTRICTIONS", + "LATE_DELIVERY", + "PROGRAM_CONSTRAINTS", + "TERMS_AND_CONDITIONS_NOT_ACCEPTED", + "UNKNOWN" + ], + "x-docgen-enum-table-extension": [ + { + "value": "NO_COVERAGE", + "description": "The shipment is ineligible because there is no coverage to that address." + }, + { + "value": "PICKUP_SLOT_RESTRICTION", + "description": "The shipment is ineligible because there is an issue with the pickup slot." + }, + { + "value": "UNSUPPORTED_VAS", + "description": "The shipment is ineligible because the value-added service is invalid for this shipment." + }, + { + "value": "VAS_COMBINATION_RESTRICTION", + "description": "The shipment is ineligible because an invalid combination of value-added services were chosen." + }, + { + "value": "SIZE_RESTRICTIONS", + "description": "The shipment is ineligible because the package dimensions are unsupported." + }, + { + "value": "WEIGHT_RESTRICTIONS", + "description": "The shipment is ineligible because the weight is unsupported." + }, + { + "value": "LATE_DELIVERY", + "description": "The shipment is ineligible because delivery is too late." + }, + { + "value": "PROGRAM_CONSTRAINTS", + "description": "The shipment is ineligible because of program constraints." + }, + { + "value": "TERMS_AND_CONDITIONS_NOT_ACCEPTED", + "description": "The shipment is ineligible because terms and conditions have not been accepted by the carrier." + }, + { + "value": "UNKNOWN", + "description": "The ineligibility reason is unknown." + } + ] + }, + "IneligibilityReason": { + "required": [ + "code", + "message" + ], + "type": "object", + "properties": { + "code": { + "$ref": "#/components/schemas/IneligibilityReasonCode" + }, + "message": { + "type": "string", + "description": "The ineligibility reason." + } + }, + "description": "The reason why a shipping service offering is ineligible." + }, + "IneligibleRate": { + "required": [ + "carrierId", + "carrierName", + "ineligibilityReasons", + "serviceId", + "serviceName" + ], + "type": "object", + "properties": { + "serviceId": { + "$ref": "#/components/schemas/ServiceId" + }, + "serviceName": { + "$ref": "#/components/schemas/ServiceName" + }, + "carrierName": { + "$ref": "#/components/schemas/CarrierName" + }, + "carrierId": { + "$ref": "#/components/schemas/CarrierId" + }, + "ineligibilityReasons": { + "type": "array", + "description": "A list of reasons why a shipping service offering is ineligible.", + "items": { + "$ref": "#/components/schemas/IneligibilityReason" + } + } + }, + "description": "Detailed information for an ineligible shipping service offering." + }, + "IneligibleRateList": { + "type": "array", + "description": "A list of ineligible shipping service offerings.", + "items": { + "$ref": "#/components/schemas/IneligibleRate" + } + }, + "CancelShipmentResult": { + "type": "object", + "additionalProperties": { + "type": "object" + }, + "description": "The payload for the cancelShipment operation." + }, + "CancelShipmentResponse": { + "type": "object", + "properties": { + "payload": { + "$ref": "#/components/schemas/CancelShipmentResult" + } + }, + "description": "Response schema for the cancelShipment operation." + }, + "GetRatesRequest": { + "required": [ + "channelDetails", + "packages", + "shipFrom" + ], + "type": "object", + "properties": { + "shipTo": { + "$ref": "#/components/schemas/Address" + }, + "shipFrom": { + "$ref": "#/components/schemas/Address" + }, + "returnTo": { + "$ref": "#/components/schemas/Address" + }, + "shipDate": { + "type": "string", + "description": "The ship date and time (the requested pickup). This defaults to the current date and time.", + "format": "date-time" + }, + "shipperInstruction": { + "$ref": "#/components/schemas/ShipperInstruction" + }, + "packages": { + "$ref": "#/components/schemas/PackageList" + }, + "valueAddedServices": { + "$ref": "#/components/schemas/ValueAddedServiceDetails" + }, + "taxDetails": { + "$ref": "#/components/schemas/TaxDetailList" + }, + "channelDetails": { + "$ref": "#/components/schemas/ChannelDetails" + }, + "clientReferenceDetails": { + "$ref": "#/components/schemas/ClientReferenceDetails" + }, + "shipmentType": { + "$ref": "#/components/schemas/ShipmentType" + }, + "destinationAccessPointDetails": { + "$ref": "#/components/schemas/AccessPointDetails" + }, + "carrierAccounts": { + "$ref": "#/components/schemas/CarrierAccounts" + } + }, + "description": "The request schema for the getRates operation. When the channelType is Amazon, the shipTo address is not required and will be ignored." + }, + "AccessPointDetails": { + "type": "object", + "properties": { + "accessPointId": { + "$ref": "#/components/schemas/AccessPointId" + } + }, + "description": "AccessPointDetails object" + }, + "NdrAction": { + "type": "string", + "description": "The type of NDR action shipper wants to take for a particular shipment.", + "enum": [ + "RESCHEDULE", + "REATTEMPT", + "RTO" + ], + "x-docgen-enum-table-extension": [ + { + "value": "RESCHEDULE", + "description": "Seller wants to reschedule shipment delivery to a specific date." + }, + { + "value": "REATTEMPT", + "description": "Seller wants to re-attempt delivery with additional delivery notes." + }, + { + "value": "RTO", + "description": "Seller wants the shipment to return to the origin." + } + ] + }, + "NdrRequestData": { + "type": "object", + "properties": { + "rescheduleDate": { + "type": "string", + "description": "The date on which the Seller wants to reschedule shipment delivery, in ISO-8601 date/time format", + "format": "date-time", + "example": "2023-12-12T05:24:00Z" + }, + "additionalAddressNotes": { + "$ref": "#/components/schemas/AdditionalAddressNotes" + } + }, + "description": "Additional information required for the NDR action that has been filed. If the NDR Action is RESCHEDULE, rescheduleDate is a required field. Otherwise, if the NDR Action is REATTEMPT, additionalAddressNotes is a required field. " + }, + "GetRatesResult": { + "required": [ + "rates", + "requestToken" + ], + "type": "object", + "properties": { + "requestToken": { + "$ref": "#/components/schemas/RequestToken" + }, + "rates": { + "$ref": "#/components/schemas/RateList" + }, + "ineligibleRates": { + "$ref": "#/components/schemas/IneligibleRateList" + } + }, + "description": "The payload for the getRates operation." + }, + "GetRatesResponse": { + "type": "object", + "properties": { + "payload": { + "$ref": "#/components/schemas/GetRatesResult" + } + }, + "description": "The response schema for the getRates operation." + }, + "GetShipmentDocumentsResult": { + "required": [ + "packageDocumentDetail", + "shipmentId" + ], + "type": "object", + "properties": { + "shipmentId": { + "$ref": "#/components/schemas/ShipmentId" + }, + "packageDocumentDetail": { + "$ref": "#/components/schemas/PackageDocumentDetail" + }, + "benefits": { + "$ref": "#/components/schemas/Benefits" + } + }, + "description": "The payload for the getShipmentDocuments operation." + }, + "GetShipmentDocumentsResponse": { + "type": "object", + "properties": { + "payload": { + "$ref": "#/components/schemas/GetShipmentDocumentsResult" + } + }, + "description": "The response schema for the the getShipmentDocuments operation." + }, + "GetTrackingResult": { + "required": [ + "alternateLegTrackingId", + "eventHistory", + "promisedDeliveryDate", + "summary", + "trackingId" + ], + "type": "object", + "properties": { + "trackingId": { + "$ref": "#/components/schemas/TrackingId" + }, + "alternateLegTrackingId": { + "$ref": "#/components/schemas/AlternateLegTrackingId" + }, + "eventHistory": { + "type": "array", + "description": "A list of tracking events.", + "items": { + "$ref": "#/components/schemas/Event" + } + }, + "promisedDeliveryDate": { + "type": "string", + "description": "The date and time by which the shipment is promised to be delivered.", + "format": "date-time" + }, + "summary": { + "$ref": "#/components/schemas/TrackingSummary" + } + }, + "description": "The payload for the getTracking operation." + }, + "SubmitNdrFeedbackRequest": { + "required": [ + "ndrAction", + "trackingId" + ], + "type": "object", + "properties": { + "trackingId": { + "$ref": "#/components/schemas/TrackingId" + }, + "ndrAction": { + "$ref": "#/components/schemas/NdrAction" + }, + "ndrRequestData": { + "$ref": "#/components/schemas/NdrRequestData" + } + }, + "description": "The request schema for the NdrFeedback operation" + }, + "GetTrackingResponse": { + "type": "object", + "properties": { + "payload": { + "$ref": "#/components/schemas/GetTrackingResult" + } + }, + "description": "The response schema for the getTracking operation." + }, + "PurchaseShipmentRequest": { + "required": [ + "rateId", + "requestToken", + "requestedDocumentSpecification" + ], + "type": "object", + "properties": { + "requestToken": { + "$ref": "#/components/schemas/RequestToken" + }, + "rateId": { + "$ref": "#/components/schemas/RateId" + }, + "requestedDocumentSpecification": { + "$ref": "#/components/schemas/RequestedDocumentSpecification" + }, + "requestedValueAddedServices": { + "$ref": "#/components/schemas/RequestedValueAddedServiceList" + }, + "additionalInputs": { + "type": "object", + "additionalProperties": { + "type": "object" + }, + "description": "The additional inputs required to purchase a shipping offering, in JSON format. The JSON provided here must adhere to the JSON schema that is returned in the response to the getAdditionalInputs operation.\n\nAdditional inputs are only required when indicated by the requiresAdditionalInputs property in the response to the getRates operation." + } + }, + "description": "The request schema for the purchaseShipment operation." + }, + "PurchaseShipmentResult": { + "required": [ + "packageDocumentDetails", + "promise", + "shipmentId" + ], + "type": "object", + "properties": { + "shipmentId": { + "$ref": "#/components/schemas/ShipmentId" + }, + "packageDocumentDetails": { + "$ref": "#/components/schemas/PackageDocumentDetailList" + }, + "promise": { + "$ref": "#/components/schemas/Promise" + }, + "benefits": { + "$ref": "#/components/schemas/Benefits" + } + }, + "description": "The payload for the purchaseShipment operation." + }, + "PurchaseShipmentResponse": { + "type": "object", + "properties": { + "payload": { + "$ref": "#/components/schemas/PurchaseShipmentResult" + } + }, + "description": "The response schema for the purchaseShipment operation." + }, + "OneClickShipmentRequest": { + "required": [ + "channelDetails", + "labelSpecifications", + "packages", + "serviceSelection", + "shipFrom" + ], + "type": "object", + "properties": { + "shipTo": { + "$ref": "#/components/schemas/Address" + }, + "shipFrom": { + "$ref": "#/components/schemas/Address" + }, + "returnTo": { + "$ref": "#/components/schemas/Address" + }, + "shipDate": { + "type": "string", + "description": "The ship date and time (the requested pickup). This defaults to the current date and time.", + "format": "date-time" + }, + "packages": { + "$ref": "#/components/schemas/PackageList" + }, + "valueAddedServicesDetails": { + "$ref": "#/components/schemas/OneClickShipmentValueAddedServiceDetails" + }, + "taxDetails": { + "$ref": "#/components/schemas/TaxDetailList" + }, + "channelDetails": { + "$ref": "#/components/schemas/ChannelDetails" + }, + "labelSpecifications": { + "$ref": "#/components/schemas/RequestedDocumentSpecification" + }, + "serviceSelection": { + "$ref": "#/components/schemas/ServiceSelection" + }, + "shipperInstruction": { + "$ref": "#/components/schemas/ShipperInstruction" + }, + "destinationAccessPointDetails": { + "$ref": "#/components/schemas/AccessPointDetails" + } + }, + "description": "The request schema for the OneClickShipment operation. When the channelType is not Amazon, shipTo is required and when channelType is Amazon shipTo is ignored." + }, + "OneClickShipmentResponse": { + "type": "object", + "properties": { + "payload": { + "$ref": "#/components/schemas/OneClickShipmentResult" + } + }, + "description": "The response schema for the OneClickShipment operation." + }, + "OneClickShipmentResult": { + "required": [ + "carrier", + "packageDocumentDetails", + "promise", + "service", + "shipmentId", + "totalCharge" + ], + "type": "object", + "properties": { + "shipmentId": { + "$ref": "#/components/schemas/ShipmentId" + }, + "packageDocumentDetails": { + "$ref": "#/components/schemas/PackageDocumentDetailList" + }, + "promise": { + "$ref": "#/components/schemas/Promise" + }, + "carrier": { + "$ref": "#/components/schemas/Carrier" + }, + "service": { + "$ref": "#/components/schemas/Service" + }, + "totalCharge": { + "$ref": "#/components/schemas/Currency" + } + }, + "description": "The payload for the OneClickShipment API." + }, + "GetAccessPointsResponse": { + "type": "object", + "properties": { + "payload": { + "$ref": "#/components/schemas/GetAccessPointsResult" + } + }, + "description": "The response schema for the GetAccessPoints operation." + }, + "GetAccessPointsResult": { + "required": [ + "accessPointsMap" + ], + "type": "object", + "properties": { + "accessPointsMap": { + "$ref": "#/components/schemas/AccessPointsMap" + } + }, + "description": "The payload for the GetAccessPoints API." + }, + "AccessPointType": { + "type": "string", + "description": "The type of access point, like counter (HELIX), lockers, etc.", + "enum": [ + "HELIX", + "CAMPUS_LOCKER", + "OMNI_LOCKER", + "ODIN_LOCKER", + "DOBBY_LOCKER", + "CORE_LOCKER", + "3P", + "CAMPUS_ROOM" + ], + "x-docgen-enum-table-extension": [ + { + "value": "HELIX", + "description": "Counter, aka Helix, is an assisted access point where customers interact with a store associate to collect or return packages. Counter stores do not have Locker" + }, + { + "value": "CAMPUS_LOCKER", + "description": "It denotes a physical Locker present at Locker+ stores" + }, + { + "value": "OMNI_LOCKER", + "description": "Omni lockers are similar to core lockers installed at apartment buildings. Core and Omni will have common base hardware platform" + }, + { + "value": "ODIN_LOCKER", + "description": "Odin lockers rely on Bluetooth connection as there is no screen or scanner on the locker. Drivers, customers, and even technicians can interact with the locker using an app (different depending on the user)." + }, + { + "value": "DOBBY_LOCKER", + "description": "Dobby lockers are Odin lockers installed at apartment complexes and available only to residents." + }, + { + "value": "CORE_LOCKER", + "description": "Core lockers are the traditional and initial style of lockers when Hub was launched. Core lockers have a screen, keypad and scanner. Customer either enter their pickup code using the Locker screen or scan pickup code barcode to pick up their package." + }, + { + "value": "3P", + "description": "Networks that are owned end-to-end by commercial carriers (CC - e.g. DHL, UPS, DPD and Postal organizations), who operate both the transportation leg and the access point aspect. These networks offer a range of pickup points including: 3P Lockers, legacy Postal Offices, 3P Counters (e.g. Gas Stations and Retail Outlets - supermarkets, bookstores, news-stands etc)." + }, + { + "value": "CAMPUS_ROOM", + "description": "Locker+, formerly known as Campus, are attended, physical stores, where the Locker is used dynamically by the staff to keep packages ready for customer pickup. Locker+ store can have multiple Lockers installed," + } + ] + }, + "AccessPointsMap": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AccessPointList" + }, + "description": "Map of type of access point to list of access points" + }, + "AccessPointList": { + "type": "array", + "description": "List of relevant Access points requested by shipper. These access points are sorted by proximity to postal code, and are limited to 40. We have internally defined a radius value to render relevant results.", + "items": { + "$ref": "#/components/schemas/AccessPoint" + } + }, + "AccessPointId": { + "type": "string", + "description": "Unique identifier for the access point" + }, + "AccessPoint": { + "type": "object", + "properties": { + "accessPointId": { + "$ref": "#/components/schemas/AccessPointId" + }, + "name": { + "type": "string", + "description": "Name of entity (store/hub etc) where this access point is located" + }, + "timezone": { + "type": "string", + "description": "Timezone of access point" + }, + "type": { + "$ref": "#/components/schemas/AccessPointType" + }, + "accessibilityAttributes": { + "$ref": "#/components/schemas/AccessibilityAttributes" + }, + "address": { + "$ref": "#/components/schemas/Address" + }, + "exceptionOperatingHours": { + "type": "array", + "description": "Exception operating hours for Access Point", + "items": { + "$ref": "#/components/schemas/ExceptionOperatingHours" + } + }, + "assistanceType": { + "type": "string", + "description": "Assistance type enum for Access point i.e. STAFF_ASSISTED or SELF_ASSISTED", + "enum": [ + "STAFF_ASSISTED", + "SELF_ASSISTED" + ] + }, + "score": { + "type": "string", + "description": "The score of access point, based on proximity to postal code and sorting preference. This can be used to sort access point results on shipper's end." + }, + "standardOperatingHours": { + "$ref": "#/components/schemas/DayOfWeekTimeMap" + } + }, + "description": "Access point details" + }, + "AccessibilityAttributes": { + "type": "object", + "properties": { + "distance": { + "type": "string", + "description": "The approximate distance of access point from input postalCode's centroid." + }, + "driveTime": { + "type": "integer", + "description": "The approximate (static) drive time from input postal code's centroid." + } + }, + "description": "Defines the accessibility details of the access point." + }, + "OperatingHours": { + "type": "object", + "properties": { + "closingTime": { + "$ref": "#/components/schemas/TimeOfDay" + }, + "openingTime": { + "$ref": "#/components/schemas/TimeOfDay" + }, + "midDayClosures": { + "type": "array", + "description": "midDayClosures operating hours array", + "items": { + "$ref": "#/components/schemas/TimeOfDay" + } + } + }, + "description": "The hours in which the access point shall remain operational" + }, + "TimeOfDay": { + "type": "object", + "properties": { + "hourOfDay": { + "type": "integer", + "description": "Denotes hour of the day, used for defining opening or closing time of access points" + }, + "minuteOfHour": { + "type": "integer", + "description": "Denotes minute of the hour, used for defining opening or closing time of access points" + }, + "secondOfMinute": { + "type": "integer", + "description": "Denotes second of the minute, used for defining opening or closing time of access points" + } + }, + "description": "Denotes time of the day, used for defining opening or closing time of access points" + }, + "DayOfWeekTimeMap": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/OperatingHours" + }, + "description": "Map of day of the week to operating hours of that day" + }, + "ExceptionOperatingHours": { + "type": "object", + "properties": { + "dateRange": { + "$ref": "#/components/schemas/DateRange" + }, + "operatingHours": { + "$ref": "#/components/schemas/OperatingHours" + } + }, + "description": "Defines exceptions to standard operating hours for certain date ranges." + }, + "GetAdditionalInputsResult": { + "type": "object", + "additionalProperties": { + "type": "object" + }, + "description": "The JSON schema to use to provide additional inputs when required to purchase a shipping offering." + }, + "GetAdditionalInputsResponse": { + "type": "object", + "properties": { + "payload": { + "$ref": "#/components/schemas/GetAdditionalInputsResult" + } + }, + "description": "The response schema for the getAdditionalInputs operation." + }, + "ClientReferenceDetails": { + "type": "array", + "description": "Object to pass additional information about the MCI Integrator shipperType: List of ClientReferenceDetail", + "items": { + "$ref": "#/components/schemas/ClientReferenceDetail" + } + }, + "ClientReferenceDetail": { + "required": [ + "clientReferenceId", + "clientReferenceType" + ], + "type": "object", + "properties": { + "clientReferenceType": { + "type": "string", + "description": "Client Reference type.", + "enum": [ + "IntegratorShipperId", + "IntegratorMerchantId" + ], + "x-docgen-enum-table-extension": [ + { + "value": "IntegratorShipperId", + "description": "The unique identifier assigned to a 3P seller by the shipping integrator." + }, + { + "value": "IntegratorMerchantId", + "description": "The unique identifier assigned to a 3P shipping integrator by Amazon." + } + ] + }, + "clientReferenceId": { + "type": "string", + "description": "The Client Reference Id." + } + }, + "description": "Client Reference Details" + }, + "ShipmentType": { + "type": "string", + "description": "Shipment type.", + "enum": [ + "FORWARD", + "RETURNS" + ], + "x-docgen-enum-table-extension": [ + { + "value": "FORWARD", + "description": "Additional information about shipment representing package journey from origin address to destination address in the transportation/shipping request." + }, + { + "value": "RETURNS", + "description": "Additional information about shipment representing package journey from destination address to origin/return address in the original transportation/shipping request." + } + ] + }, + "CarrierAccounts": { + "type": "array", + "description": "A list of CarrierAccounts", + "items": { + "$ref": "#/components/schemas/CarrierAccount" + } + }, + "CarrierAccount": { + "required": [ + "carrierAccountId", + "carrierId" + ], + "type": "object", + "properties": { + "carrierAccountId": { + "$ref": "#/components/schemas/AccountId" + }, + "carrierId": { + "$ref": "#/components/schemas/CarrierId" + } + }, + "description": "Carrier Account details used to fetch rates." + }, + "DateRange": { + "type": "object", + "properties": { + "startDate": { + "type": "string", + "description": "Start Date for query .", + "format": "dateTime" + }, + "endDate": { + "type": "string", + "description": "end date for query.", + "format": "dateTime" + } + }, + "description": "Date Range for query the results." + }, + "PaymentType": { + "type": "string", + "description": "Payment type of the purchase.", + "enum": [ + "PAY_THROUGH_AMAZON", + "PAY_DIRECT_TO_CARRIER" + ], + "x-docgen-enum-table-extension": [ + { + "value": "PAY_THROUGH_AMAZON", + "description": "Payment Through Amazon." + }, + { + "value": "PAY_DIRECT_TO_CARRIER", + "description": "Payment Direct to Carrier." + } + ] + }, + "RateItemList": { + "type": "array", + "description": "A list of RateItem", + "items": { + "$ref": "#/components/schemas/RateItem" + } + }, + "RateItem": { + "type": "object", + "properties": { + "rateItemID": { + "$ref": "#/components/schemas/RateItemID" + }, + "rateItemType": { + "$ref": "#/components/schemas/RateItemType" + }, + "rateItemCharge": { + "$ref": "#/components/schemas/Currency" + }, + "rateItemNameLocalization": { + "type": "string", + "description": "Used for the localization." + } + }, + "description": "Rate Item for shipping (base cost, transaction fee, confirmation, insurance, etc.) Data source definition: " + }, + "RateItemID": { + "type": "string", + "description": "Unique ID for the rateItem.", + "enum": [ + "BASE_RATE", + "TRANSACTION_FEE", + "ADULT_SIGNATURE_CONFIRMATION", + "SIGNATURE_CONFIRMATION", + "NO_CONFIRMATION", + "WAIVE_SIGNATURE", + "IMPLIED_LIABILITY", + "HIDDEN_POSTAGE", + "DECLARED_VALUE", + "SUNDAY_HOLIDAY_DELIVERY", + "DELIVERY_CONFIRMATION", + "IMPORT_DUTY_CHARGE", + "VAT", + "NO_SATURDAY_DELIVERY", + "INSURANCE", + "COD", + "FUEL_SURCHARGE", + "INSPECTION_CHARGE", + "DELIVERY_AREA_SURCHARGE", + "WAYBILL_CHARGE", + "AMAZON_SPONSORED_DISCOUNT", + "INTEGRATOR_SPONSORED_DISCOUNT", + "OVERSIZE_SURCHARGE", + "CONGESTION_CHARGE", + "RESIDENTIAL_SURCHARGE", + "ADDITIONAL_SURCHARGE", + "SURCHARGE", + "REBATE", + "HIGH_CUBE_SURCHARGE", + "HIGH_LENGTH_SURCHARGE", + "HIGH_WIDTH_SURCHARGE", + "DEMAND_SURCHARGE", + "NONSTANDARD_FEE" + ], + "x-docgen-enum-table-extension": [ + { + "value": "BASE_RATE", + "description": "for Base Rate." + }, + { + "value": "TRANSACTION_FEE", + "description": "Charge for TransAction Fee." + }, + { + "value": "ADULT_SIGNATURE_CONFIRMATION", + "description": "Charge for Adult Signature Confirmation." + }, + { + "value": "SIGNATURE_CONFIRMATION", + "description": "Charge for signature confirmation." + }, + { + "value": "NO_CONFIRMATION", + "description": "Charge for No Confirmation." + }, + { + "value": "WAIVE_SIGNATURE", + "description": "Charge for Waive Signature." + }, + { + "value": "IMPLIED_LIABILITY", + "description": "Charge for Implied Liability." + }, + { + "value": "HIDDEN_POSTAGE", + "description": "Hidden Postage Charge." + }, + { + "value": "DECLARED_VALUE", + "description": "Declared Valure Coverage Charge." + }, + { + "value": "SUNDAY_HOLIDAY_DELIVERY", + "description": "Sunday Holiday Delivery Charge." + }, + { + "value": "DELIVERY_CONFIRMATION", + "description": "Charge for Delivery Confirmation." + }, + { + "value": "IMPORT_DUTY_CHARGE", + "description": "Import Duty Charge." + }, + { + "value": "VAT", + "description": "Vat Charge." + }, + { + "value": "NO_SATURDAY_DELIVERY", + "description": "Charge for No Satuarday Delivery." + }, + { + "value": "INSURANCE", + "description": "Insurance Charge." + }, + { + "value": "COD", + "description": "COD Charge." + }, + { + "value": "AMAZON_SPONSORED_DISCOUNT", + "description": "Amazon Sponsored Discount." + }, + { + "value": "INTEGRATOR_SPONSORED_DISCOUNT", + "description": "Integrator Sponsored Discount." + }, + { + "value": "FUEL_SURCHARGE", + "description": "Fuel Surcharge." + }, + { + "value": "INSPECTION_CHARGE", + "description": "Inspection Charge." + }, + { + "value": "DELIVERY_AREA_SURCHARGE", + "description": "Delivery Area Surcharge." + }, + { + "value": "WAYBILL_CHARGE", + "description": "WayBill Charge." + }, + { + "value": "OVERSIZE_SURCHARGE", + "description": "OverSize Surcharge." + }, + { + "value": "CONGESTION_CHARGE", + "description": "Congestion Charge." + }, + { + "value": "RESIDENTIAL_SURCHARGE", + "description": "Residential Surcharge." + }, + { + "value": "ADDITIONAL_SURCHARGE", + "description": "Additional Surcharge." + }, + { + "value": "SURCHARGE", + "description": "Surcharge." + }, + { + "value": "REBATE", + "description": "Rebate." + }, + { + "value": "HIGH_CUBE_SURCHARGE", + "description": "High Cube Surcharge." + }, + { + "value": "HIGH_LENGTH_SURCHARGE", + "description": "High Length Surcharge." + }, + { + "value": "HIGH_WIDTH_SURCHARGE", + "description": "High Width Surcharge." + }, + { + "value": "DEMAND_SURCHARGE", + "description": "A fee that is applied during specific periods of increased demand on the network as specified in the Amazon Shipping Service guide." + }, + { + "value": "NONSTANDARD_FEE", + "description": "A fee that applies for packages that are outside the standard size for processing and sorting as specified in the Amazon Shipping Service guide." + } + ] + }, + "RateItemType": { + "type": "string", + "description": "Type of the rateItem.", + "enum": [ + "MANDATORY", + "OPTIONAL", + "INCLUDED" + ], + "x-docgen-enum-table-extension": [ + { + "value": "MANDATORY", + "description": "Rate Item is mandatory." + }, + { + "value": "OPTIONAL", + "description": "Rate Item is Optional." + }, + { + "value": "INCLUDED", + "description": "Rate Item is included." + } + ] + }, + "Benefits": { + "required": [ + "excludedBenefits", + "includedBenefits" + ], + "type": "object", + "properties": { + "includedBenefits": { + "$ref": "#/components/schemas/IncludedBenefits" + }, + "excludedBenefits": { + "$ref": "#/components/schemas/ExcludedBenefits" + } + }, + "description": "Benefits that are included and excluded for each shipping offer. Benefits represents services provided by Amazon (eg. CLAIMS_PROTECTED, etc.) when sellers purchase shipping through Amazon. Benefit details will be made available for any shipment placed on or after January 1st 2024 00:00 UTC." + }, + "IncludedBenefits": { + "type": "array", + "description": "A list of included benefits.", + "items": { + "type": "string" + } + }, + "ExcludedBenefits": { + "type": "array", + "description": "A list of excluded benefit. Refer to the ExcludeBenefit object for further documentation", + "items": { + "$ref": "#/components/schemas/ExcludedBenefit" + } + }, + "ExcludedBenefit": { + "required": [ + "benefit" + ], + "type": "object", + "properties": { + "benefit": { + "type": "string", + "description": "benefit" + }, + "reasonCodes": { + "$ref": "#/components/schemas/ExcludedBenefitReasonCodes" + } + }, + "description": "Object representing a benefit that is excluded for a shipping offer or rate." + }, + "ExcludedBenefitReasonCodes": { + "minItems": 1, + "type": "array", + "description": "List of reasons (eg. LATE_DELIVERY_RISK, etc.) indicating why a benefit is excluded for a shipping offer.", + "items": { + "type": "string" + } + }, + "ServiceSelection": { + "required": [ + "serviceId" + ], + "type": "object", + "properties": { + "serviceId": { + "$ref": "#/components/schemas/ServiceIds" + } + }, + "description": "Service Selection Criteria." + }, + "ServiceIds": { + "type": "array", + "description": "A list of ServiceId.", + "items": { + "type": "string" + } + }, + "OneClickShipmentValueAddedServiceDetails": { + "type": "array", + "description": "The value-added services to be added to a shipping service purchase.", + "items": { + "$ref": "#/components/schemas/OneClickShipmentValueAddedService" + } + }, + "OneClickShipmentValueAddedService": { + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The identifier of the selected value-added service." + }, + "amount": { + "$ref": "#/components/schemas/Currency" + } + }, + "description": "A value-added service to be applied to a shipping service purchase." + }, + "Service": { + "required": [ + "id", + "name" + ], + "type": "object", + "properties": { + "id": { + "$ref": "#/components/schemas/ServiceId" + }, + "name": { + "$ref": "#/components/schemas/ServiceName" + } + }, + "description": "Service Related Info" + }, + "Carrier": { + "required": [ + "id", + "name" + ], + "type": "object", + "properties": { + "id": { + "$ref": "#/components/schemas/CarrierId" + }, + "name": { + "$ref": "#/components/schemas/CarrierName" + } + }, + "description": "Carrier Related Info" + } + } + }, + "x-original-swagger-version": "2.0" +} diff --git a/src/EasyKeys.Shipping.Amazon.Abstractions/Options/AmazonShippingApiOptions.cs b/src/EasyKeys.Shipping.Amazon.Abstractions/Options/AmazonShippingApiOptions.cs new file mode 100644 index 0000000..29922da --- /dev/null +++ b/src/EasyKeys.Shipping.Amazon.Abstractions/Options/AmazonShippingApiOptions.cs @@ -0,0 +1,12 @@ +namespace EasyKeys.Shipping.Amazon.Abstractions.Options; + +public class AmazonShippingApiOptions +{ + public bool IsDevelopment { get; set; } = true; + + public string ClientId { get; set; } = string.Empty; + + public string ClientSecret { get; set; } = string.Empty; + + public string RefreshToken { get; set; } = string.Empty; +} diff --git a/src/EasyKeys.Shipping.Amazon.Abstractions/README.md b/src/EasyKeys.Shipping.Amazon.Abstractions/README.md new file mode 100644 index 0000000..4378051 --- /dev/null +++ b/src/EasyKeys.Shipping.Amazon.Abstractions/README.md @@ -0,0 +1,17 @@ +# EasyKeys.Shipping.Amazon.Abstractions + +[![Build status](https://ci.appveyor.com/api/projects/status/xp52rbpa9vmr1ck9?svg=true)](https://ci.appveyor.com/project/easykeys/easykeys-shipping) +[![NuGet](https://img.shields.io/nuget/v/EasyKeys.Shipping.Amazon.Abstractions.svg)](https://www.nuget.org/packages?q=EasyKeys.Shipping.Amazon.Abstractions) +![Nuget](https://img.shields.io/nuget/dt/EasyKeys.Shipping.Amazon.Abstractions) +[![feedz.io](https://img.shields.io/badge/endpoint.svg?url=https://f.feedz.io/easykeys/core/shield/EasyKeys.Shipping.Amazon.Abstractions/latest)](https://f.feedz.io/easykeys/core/packages/EasyKeys.Shipping.Amazon.Abstractions/latest/download) + +This library provides abstractions for Amazon options, models, and Amazon auth api client. + +## Give a Star! :star: + +If you like or are using this project please give it a star. Thanks! + +## Install + +```bash + dotnet add package EasyKeys.Shipping.Amazon.Abstractions diff --git a/src/EasyKeys.Shipping.Amazon.Abstractions/Services/IAmazonApiAuthenticatorService.cs b/src/EasyKeys.Shipping.Amazon.Abstractions/Services/IAmazonApiAuthenticatorService.cs new file mode 100644 index 0000000..4b3c3ec --- /dev/null +++ b/src/EasyKeys.Shipping.Amazon.Abstractions/Services/IAmazonApiAuthenticatorService.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EasyKeys.Shipping.Amazon.Abstractions.Services; + +public interface IAmazonApiAuthenticatorService +{ + Task GetTokenAsync(CancellationToken cancellationToken = default); +} + +public record AmazonToken(string access_token, string refresh_token, string token_type, int expires_in); diff --git a/src/EasyKeys.Shipping.Amazon.Abstractions/Services/Impl/AmazonApiAuthenticatorService.cs b/src/EasyKeys.Shipping.Amazon.Abstractions/Services/Impl/AmazonApiAuthenticatorService.cs new file mode 100644 index 0000000..6b0a803 --- /dev/null +++ b/src/EasyKeys.Shipping.Amazon.Abstractions/Services/Impl/AmazonApiAuthenticatorService.cs @@ -0,0 +1,78 @@ +using System.Collections.Concurrent; +using System.Net.Http.Json; + +using EasyKeys.Shipping.Amazon.Abstractions.OpenApis.V2.Shipping; +using EasyKeys.Shipping.Amazon.Abstractions.Options; + +using Microsoft.Extensions.Logging; + +using Microsoft.Extensions.Options; + +namespace EasyKeys.Shipping.Amazon.Abstractions.Services.Impl; + +public class AmazonApiAuthenticatorService : IAmazonApiAuthenticatorService +{ + private readonly AmazonShippingApi _httpClient; + private readonly AmazonShippingApiOptions _options; + private readonly ILogger _logger; + private readonly ConcurrentDictionary _token = new(); + private readonly ConcurrentDictionary _expirationClock = new(); + + public AmazonApiAuthenticatorService( + AmazonShippingApi httpClient, + IOptionsMonitor optionsMonitor, + ILogger logger) + { + _options = optionsMonitor.CurrentValue; + _httpClient = httpClient; + _logger = logger; + } + + public async Task GetTokenAsync(CancellationToken cancellationToken = default) + { + try + { + if (DateTimeOffset.Now < _expirationClock.GetValueOrDefault(nameof(_expirationClock))) + { + _token.TryGetValue(nameof(AmazonToken), out var existingToken); + ArgumentNullException.ThrowIfNull(existingToken, nameof(AmazonToken)); + return existingToken; + } + + using var client = new HttpClient(); + var request = new HttpRequestMessage + { + Method = HttpMethod.Post, + RequestUri = new Uri("https://api.amazon.com/auth/o2/token"), + Headers = + { + { "accept", "application/json" }, + }, + Content = new FormUrlEncodedContent(new Dictionary + { + { "grant_type", "refresh_token" }, + { "refresh_token", _options.RefreshToken }, + { "client_id", _options.ClientId }, + { "client_secret", _options.ClientSecret } + }), + }; + var response = await client.SendAsync(request); + var token = await response.Content.ReadFromJsonAsync(); + + _logger.LogDebug("[Amazon][CreateToken] - authentication token returned {createdToken}", token); + + ArgumentNullException.ThrowIfNull(token, nameof(AmazonToken)); + + _token.AddOrUpdate(nameof(AmazonToken), $"{token.access_token}", (x, y) => $"{token.access_token}"); + + _expirationClock.AddOrUpdate(nameof(_expirationClock), (x) => DateTimeOffset.Now.AddSeconds(token.expires_in - 5), (x, y) => y.AddMilliseconds(token.expires_in - 5)); + + return token.access_token; + } + catch (Exception ex) + { + _logger.LogError(ex, "[Fedex.com][GetToken] Failed"); + return string.Empty; + } + } +} diff --git a/src/EasyKeys.Shipping.Amazon.Rates/.editorconfig b/src/EasyKeys.Shipping.Amazon.Rates/.editorconfig new file mode 100644 index 0000000..7cf693a --- /dev/null +++ b/src/EasyKeys.Shipping.Amazon.Rates/.editorconfig @@ -0,0 +1,311 @@ +# EditorConfig is awesome: https://EditorConfig.org +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +# Matches multiple files with brace expansion notation +# Set default charset +[*.js] +charset = utf-8 + +# Solution Files +[*.sln] +indent_style = tab + +# XML Project Files +[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] +indent_size = 2 + +# YAML Files +[*.{yml,yaml}] +indent_size = 2 +indent_style = space + +# Markdown Files +[*.md] +trim_trailing_whitespace = false + +# .NET Code Style Settings +[*.{cs,csx,cake,vb}] + +[*.cshtml.cs] +dotnet_diagnostic.SA1649.severity = none + +# "this." and "Me." qualifiers +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#this_and_me +dotnet_style_qualification_for_field = false:warning +dotnet_style_qualification_for_property = false:warning +dotnet_style_qualification_for_method = false:warning +dotnet_style_qualification_for_event = false:warning + +# Language keywords instead of framework type names for type references +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#language_keywords +dotnet_style_predefined_type_for_locals_parameters_members = true:warning +dotnet_style_predefined_type_for_member_access = true:warning + +# Modifier preferences +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#normalize_modifiers +dotnet_style_require_accessibility_modifiers = always:warning +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:warning +dotnet_style_readonly_field = true:warning + +# Code-block preferences +csharp_prefer_braces = true:silent +csharp_prefer_simple_using_statement = true:suggestion + +# Expression-level preferences +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#expression_level +dotnet_style_object_initializer = true:warning +dotnet_style_collection_initializer = true:warning +dotnet_style_explicit_tuple_names = true:warning +dotnet_style_prefer_inferred_tuple_names = true:warning +dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning +dotnet_style_prefer_auto_properties = true:warning +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning + +# 'using' directive preferences +csharp_using_directive_placement = outside_namespace:silent + +# Null-checking preferences +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#null_checking +dotnet_style_coalesce_expression = true:warning +dotnet_style_null_propagation = true:warning + +# Other (Undocumented) +dotnet_style_prefer_conditional_expression_over_return = false +dotnet_style_prefer_conditional_expression_over_assignment = false + +# C# Code Style Settings +[*.{cs,csx,cake}] +# Implicit and explicit types +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#implicit-and-explicit-types +csharp_style_var_for_built_in_types = true:warning +csharp_style_var_when_type_is_apparent = true:warning +csharp_style_var_elsewhere = true:warning + +# Expression-bodied members +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#expression_bodied_members +csharp_style_expression_bodied_methods = false:warning +csharp_style_expression_bodied_constructors = false:warning +csharp_style_expression_bodied_operators = true:warning +csharp_style_expression_bodied_properties = true:warning +csharp_style_expression_bodied_indexers = true:warning +csharp_style_expression_bodied_accessors = true:warning + +# Pattern matching +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#pattern_matching +csharp_style_pattern_matching_over_is_with_cast_check = true:warning +csharp_style_pattern_matching_over_as_with_null_check = true:warning + +# Inlined variable declarations +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#inlined_variable_declarations +csharp_style_inlined_variable_declaration = true:warning + +# Expression-level preferences +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#expression_level_csharp +csharp_prefer_simple_default_expression = true:warning +csharp_style_deconstructed_variable_declaration = true:warning +csharp_style_pattern_local_over_anonymous_function = true:warning + +# "Null" checking preferences +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#null_checking_csharp +csharp_style_throw_expression = true:warning +csharp_style_conditional_delegate_call = true:warning + +# Code block preferences +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#code_block +csharp_prefer_braces = true:warning + +############################# +# .NET Formatting Conventions +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#formatting-conventions +############################# + +# Organize usings +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#usings +dotnet_sort_system_directives_first = true +dotnet_separate_import_directive_groups = true + +# C# formatting settings +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#c-formatting-settings +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true:warning +csharp_new_line_before_catch = true:warning +csharp_new_line_before_finally = true:warning +csharp_new_line_before_members_in_object_initializers = true:warning +csharp_new_line_before_members_in_anonymous_types = true:warning +csharp_new_line_between_query_expression_clauses = true:warning + +# Indentation options +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#indent +csharp_indent_case_contents = true:warning +csharp_indent_switch_labels = true:warning +csharp_indent_labels = no_change:warning + +# Spacing options +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#spacing +csharp_space_after_cast = false:warning +csharp_space_after_keywords_in_control_flow_statements = true:warning +csharp_space_between_method_declaration_parameter_list_parentheses = false:warning +csharp_space_between_method_call_parameter_list_parentheses = false:warning +csharp_space_between_parentheses = expressions:warning +csharp_space_before_colon_in_inheritance_clause = true:warning +csharp_space_after_colon_in_inheritance_clause = true:warning +csharp_space_around_binary_operators = before_and_after:warning +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false:warning +csharp_space_between_method_call_name_and_opening_parenthesis = false:warning +csharp_space_between_method_call_empty_parameter_list_parentheses = false:warning + +# Wrapping options +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#wrapping +csharp_preserve_single_line_statements = false:warning +csharp_preserve_single_line_blocks = true:warning + +# More Indentation options (Undocumented) +csharp_indent_block_contents = true:warning +csharp_indent_braces = false:warning + +# Spacing Options (Undocumented) +csharp_space_after_comma = true:warning +csharp_space_after_dot = false:warning +csharp_space_after_semicolon_in_for_statement = true:warning +csharp_space_around_declaration_statements = do_not_ignore:warning +csharp_space_before_comma = false:warning +csharp_space_before_dot = false:warning +csharp_space_before_semicolon_in_for_statement = false:warning +csharp_space_before_open_square_brackets = false:warning +csharp_space_between_empty_square_brackets = false:warning +csharp_space_between_method_declaration_name_and_open_parenthesis = false:warning +csharp_space_between_square_brackets = false:warning + +######################### +# .NET Naming conventions +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions +######################### + +[*.{cs,csx,cake,vb}] +# Naming Symbols +# constant_fields - Define constant fields +dotnet_naming_symbols.constant_fields.applicable_kinds = field +dotnet_naming_symbols.constant_fields.required_modifiers = const + +# non_private_readonly_fields - Define public, internal and protected readonly fields +dotnet_naming_symbols.non_private_readonly_fields.applicable_accessibilities = public, internal, protected +dotnet_naming_symbols.non_private_readonly_fields.applicable_kinds = field +dotnet_naming_symbols.non_private_readonly_fields.required_modifiers = readonly + +# static_readonly_fields - Define static and readonly fields +dotnet_naming_symbols.static_readonly_fields.applicable_kinds = field +dotnet_naming_symbols.static_readonly_fields.required_modifiers = static, readonly + +# private_readonly_fields - Define private readonly fields +dotnet_naming_symbols.private_readonly_fields.applicable_accessibilities = private +dotnet_naming_symbols.private_readonly_fields.applicable_kinds = field +dotnet_naming_symbols.private_readonly_fields.required_modifiers = readonly + +# public_internal_fields - Define public and internal fields +dotnet_naming_symbols.public_internal_fields.applicable_accessibilities = public, internal +dotnet_naming_symbols.public_internal_fields.applicable_kinds = field + +# private_protected_fields - Define private and protected fields +dotnet_naming_symbols.private_protected_fields.applicable_accessibilities = private, protected +dotnet_naming_symbols.private_protected_fields.applicable_kinds = field + +# public_symbols - Define any public symbol +dotnet_naming_symbols.public_symbols.applicable_accessibilities = public, internal, protected, protected_internal +dotnet_naming_symbols.public_symbols.applicable_kinds = method, property, event, delegate + +# parameters - Defines any parameter +dotnet_naming_symbols.parameters.applicable_kinds = parameter + +# non_interface_types - Defines class, struct, enum and delegate types +dotnet_naming_symbols.non_interface_types.applicable_kinds = class, struct, enum, delegate + +# interface_types - Defines interfaces +dotnet_naming_symbols.interface_types.applicable_kinds = interface + +######################### +# Naming Styles +######################### + +# camel_case - Define the camelCase style +dotnet_naming_style.camel_case.capitalization = camel_case + +# pascal_case - Define the Pascal_case style +dotnet_naming_style.pascal_case.capitalization = pascal_case + +# first_upper - The first character must start with an upper-case character +dotnet_naming_style.first_upper.capitalization = first_word_upper + +# prefix_interface_interface_with_i - Interfaces must be PascalCase and the first character of an interface must be an 'I' +dotnet_naming_style.prefix_interface_interface_with_i.capitalization = pascal_case +dotnet_naming_style.prefix_interface_interface_with_i.required_prefix = I + +######################### +# Naming Rules +######################### + +# Constant fields must be PascalCase +dotnet_naming_rule.constant_fields_must_be_pascal_case.severity = warning +dotnet_naming_rule.constant_fields_must_be_pascal_case.symbols = constant_fields +dotnet_naming_rule.constant_fields_must_be_pascal_case.style = pascal_case + +# Public, internal and protected readonly fields must be PascalCase +dotnet_naming_rule.non_private_readonly_fields_must_be_pascal_case.severity = warning +dotnet_naming_rule.non_private_readonly_fields_must_be_pascal_case.symbols = non_private_readonly_fields +dotnet_naming_rule.non_private_readonly_fields_must_be_pascal_case.style = pascal_case + +# Static readonly fields must be PascalCase +dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.severity = warning +dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.symbols = static_readonly_fields +dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.style = pascal_case + +# Public and internal fields must be PascalCase +dotnet_naming_rule.public_internal_fields_must_be_pascal_case.severity = warning +dotnet_naming_rule.public_internal_fields_must_be_pascal_case.symbols = public_internal_fields +dotnet_naming_rule.public_internal_fields_must_be_pascal_case.style = pascal_case + +# Public members must be capitalized +dotnet_naming_rule.public_members_must_be_capitalized.severity = warning +dotnet_naming_rule.public_members_must_be_capitalized.symbols = public_symbols +dotnet_naming_rule.public_members_must_be_capitalized.style = first_upper + +# Parameters must be camelCase +dotnet_naming_rule.parameters_must_be_camel_case.severity = warning +dotnet_naming_rule.parameters_must_be_camel_case.symbols = parameters +dotnet_naming_rule.parameters_must_be_camel_case.style = camel_case + +# Class, struct, enum and delegates must be PascalCase +dotnet_naming_rule.non_interface_types_must_be_pascal_case.severity = warning +dotnet_naming_rule.non_interface_types_must_be_pascal_case.symbols = non_interface_types +dotnet_naming_rule.non_interface_types_must_be_pascal_case.style = pascal_case + +# Interfaces must be PascalCase and start with an 'I' +dotnet_naming_rule.interface_types_must_be_prefixed_with_i.severity = warning +dotnet_naming_rule.interface_types_must_be_prefixed_with_i.symbols = interface_types +dotnet_naming_rule.interface_types_must_be_prefixed_with_i.style = prefix_interface_interface_with_i + +dotnet_naming_symbols.private_fields.applicable_kinds = field +dotnet_naming_symbols.private_fields.applicable_accessibilities = private, internal + +# internal and private fields should be _camelCase +dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion +dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields +dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style + +dotnet_naming_symbols.private_internal_fields.applicable_kinds = field +dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal, protected + +dotnet_naming_style.camel_case_underscore_style.required_prefix = _ +dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case + + +[*.cs] + +# CA1815: Override equals and operator equals on value types +dotnet_diagnostic.CA1815.severity = silent diff --git a/src/EasyKeys.Shipping.Amazon.Rates/AmazonShippingRateProvider.cs b/src/EasyKeys.Shipping.Amazon.Rates/AmazonShippingRateProvider.cs new file mode 100644 index 0000000..b6b513b --- /dev/null +++ b/src/EasyKeys.Shipping.Amazon.Rates/AmazonShippingRateProvider.cs @@ -0,0 +1,145 @@ +using EasyKeys.Shipping.Abstractions.Models; +using EasyKeys.Shipping.Amazon.Abstractions.OpenApis.V2.Shipping; +using EasyKeys.Shipping.Amazon.Abstractions.Options; +using EasyKeys.Shipping.Amazon.Abstractions.Services; + +using Microsoft.Extensions.Logging; + +namespace EasyKeys.Shipping.Amazon.Rates; + +public class AmazonShippingRateProvider : IAmazonShippingRateProvider +{ + private readonly IAmazonApiAuthenticatorService _authenticatorService; + private readonly AmazonShippingApiOptions _options; + private readonly AmazonShippingApi _shippingApi; + private readonly ILogger _logger; + + public AmazonShippingRateProvider( + ILogger logger, + AmazonShippingApiOptions options, + IAmazonApiAuthenticatorService authenticatorService, + AmazonShippingApi shippingApi) + { + _logger = logger; + _options = options; + _authenticatorService = authenticatorService; + _shippingApi = shippingApi; + _shippingApi.BaseUrl = _options.IsDevelopment ? _shippingApi.BaseUrl : "https://sellingpartnerapi-na.amazon.com"; + } + + public async Task GetRatesAsync(Shipment shipment, CancellationToken cancellationToken = default) + { + try + { + var rateRequest = new GetRatesRequest() + { + ShipDate = shipment.Options.ShippingDate.ToString("yyyy-MM-dd'T'HH:mm:ss'Z'"), + ShipTo = new Abstractions.OpenApis.V2.Shipping.Address() + { + Name = "unknown name", + AddressLine1 = shipment.DestinationAddress.StreetLine, + AddressLine2 = shipment.DestinationAddress.StreetLine2, + StateOrRegion = shipment.DestinationAddress.StateOrProvince, + City = shipment.DestinationAddress.City, + CountryCode = shipment.DestinationAddress.CountryCode, + PostalCode = shipment.DestinationAddress.PostalCode, + PhoneNumber = "unknown phone number" + }, + ShipFrom = new Abstractions.OpenApis.V2.Shipping.Address() + { + AddressLine1 = shipment.OriginAddress.StreetLine, + AddressLine2 = shipment.OriginAddress.StreetLine2, + StateOrRegion = shipment.OriginAddress.StateOrProvince, + City = shipment.OriginAddress.City, + CountryCode = shipment.OriginAddress.CountryCode, + PostalCode = shipment.OriginAddress.PostalCode, + Name = "Easykeys fullfuilment team", + Email = "devs@easykeys.com", + CompanyName = "EasyKeys", + PhoneNumber = "unknown phone number" + }, + Packages = new () + { + new () + { + Dimensions = new () + { + Unit = DimensionsUnit.INCH, + Length = (double)shipment.Packages.Max(x => x.Dimensions.RoundedLength), + Width = (double)shipment.Packages.Max(x => x.Dimensions.RoundedWidth), + Height = (double)shipment.Packages.Max(x => x.Dimensions.RoundedHeight) + }, + Weight = new () + { + Unit = WeightUnit.POUND, + Value = (double)shipment.Packages.Sum(x => x.RoundedWeight) + }, + InsuredValue = new () + { + Value = (double)shipment.Packages.Sum(x => x.InsuredValue), + Unit = "USD" + }, + PackageClientReferenceId = "packageClientReferenceId", + Items = new () + { + new () + { + Weight = new () + { + Unit = WeightUnit.POUND + }, + LiquidVolume = new () + { + Unit = LiquidVolumeUnit.ML + }, + Description = "Package", + Quantity = 1 + } + } + } + }, + ChannelDetails = new () + { + ChannelType = ChannelType.EXTERNAL + } + }; + + var token = await _authenticatorService.GetTokenAsync(cancellationToken); + + var result = await _shippingApi.GetRatesAsync(token, XAmznShippingBusinessId.AmazonShipping_US, rateRequest); + + foreach (var amazonRate in result.Payload.Rates) + { + var rate = new Shipping.Abstractions.Models.Rate( + amazonRate.ServiceName, + amazonRate.ServiceName, + amazonRate.CarrierName, + (decimal)amazonRate.TotalCharge.Value, + (decimal)amazonRate.TotalCharge.Value, + amazonRate.Promise.DeliveryWindow.End.UtcDateTime); + shipment.Rates.Add(rate); + } + } + catch (ApiException ex) + { + foreach (var error in ex.Result.Errors) + { + shipment.InternalErrors.Add(error.Message); + } + + _logger.LogError(ex, $"Error getting rates from Amazon Shipping API: {string.Join(",",ex.Result.Errors)}"); + } + catch (ApiException ex) + { + shipment.InternalErrors.Add(ex.Message); + _logger.LogError(ex, $"Error getting rates from Amazon Shipping API: {ex.Message}"); + } + catch (Exception ex) + { + shipment.InternalErrors.Add(ex.Message); + _logger.LogError(ex, $"Error getting rates from Amazon Shipping API: {ex.Message}"); + } + + return shipment; + } +} diff --git a/src/EasyKeys.Shipping.Amazon.Rates/DependencyInjection/AmazonRatesServiceCollectionExtensions.cs b/src/EasyKeys.Shipping.Amazon.Rates/DependencyInjection/AmazonRatesServiceCollectionExtensions.cs new file mode 100644 index 0000000..7889c46 --- /dev/null +++ b/src/EasyKeys.Shipping.Amazon.Rates/DependencyInjection/AmazonRatesServiceCollectionExtensions.cs @@ -0,0 +1,25 @@ +using EasyKeys.Shipping.Amazon.Abstractions.Options; + +using Microsoft.Extensions.DependencyInjection; + +namespace EasyKeys.Shipping.Amazon.Rates.DependencyInjection; + +public static class AmazonRatesServiceCollectionExtensions +{ + /// + /// Adds the rest API amazon rate provider.Must add AmazonShippingClient to di container. + /// + /// + /// + /// + /// + public static IServiceCollection AddRestApiAmazonRateProvider( + this IServiceCollection services, + string sectionName = nameof(AmazonShippingApiOptions), + Action? configOptions = null) + { + services.AddTransient(); + + return services; + } +} diff --git a/src/EasyKeys.Shipping.Amazon.Rates/EasyKeys.Shipping.Amazon.Rates.csproj b/src/EasyKeys.Shipping.Amazon.Rates/EasyKeys.Shipping.Amazon.Rates.csproj new file mode 100644 index 0000000..9a02484 --- /dev/null +++ b/src/EasyKeys.Shipping.Amazon.Rates/EasyKeys.Shipping.Amazon.Rates.csproj @@ -0,0 +1,20 @@ + + + + net8.0 + enable + enable + + + + DotNetCore Implementation of Amazon Shipping V2 Api endpoint. + + + DotNetCore, Amazon Shipping,V2, Shipping V2 APIs + + + + + + + diff --git a/src/EasyKeys.Shipping.Amazon.Rates/IAmazonShippingRateProvider.cs b/src/EasyKeys.Shipping.Amazon.Rates/IAmazonShippingRateProvider.cs new file mode 100644 index 0000000..0e7ee12 --- /dev/null +++ b/src/EasyKeys.Shipping.Amazon.Rates/IAmazonShippingRateProvider.cs @@ -0,0 +1,8 @@ +using EasyKeys.Shipping.Abstractions.Models; + +namespace EasyKeys.Shipping.Amazon.Rates; + +public interface IAmazonShippingRateProvider +{ + Task GetRatesAsync(Shipment shipment, CancellationToken cancellationToken = default); +} diff --git a/src/EasyKeys.Shipping.Amazon.Rates/README.md b/src/EasyKeys.Shipping.Amazon.Rates/README.md new file mode 100644 index 0000000..8e7c236 --- /dev/null +++ b/src/EasyKeys.Shipping.Amazon.Rates/README.md @@ -0,0 +1,205 @@ +# EasyKeys.Shipping.Amazon.Rates + +[![Build status](https://ci.appveyor.com/api/projects/status/xp52rbpa9vmr1ck9?svg=true)](https://ci.appveyor.com/project/easykeys/easykeys-shipping) +[![NuGet](https://img.shields.io/nuget/v/EasyKeys.Shipping.Amazon.Rates.svg)](https://www.nuget.org/packages?q=EasyKeys.Shipping.Amazon.Rates) +![Nuget](https://img.shields.io/nuget/dt/EasyKeys.Shipping.Amazon.Rates) +[![feedz.io](https://img.shields.io/badge/endpoint.svg?url=https://f.feedz.io/easykeys/core/shield/EasyKeys.Shipping.Amazon.Rates/latest)](https://f.feedz.io/easykeys/core/packages/EasyKeys.Shipping.Amazon.Rates/latest/download) + +AmazonShippingRateProvider is a lightweight .NET Core library that provides an easy-to-use wrapper around Amazon's Shipping API endpoints for fetching and managing shipping rates. This library simplifies integration with Amazon's shipping services, allowing developers to interact with the API using clean and intuitive methods. + +## Features + +- Fetch shipping rates for different carrier services. +- Support for international and domestic shipping rate queries. +- Easy-to-configure settings for Amazon API credentials. +- Built-in error handling and validation. +- Fully asynchronous API methods for seamless integration. + +## Installation + +Install the package via NuGet Package Manager: + +```bash +Install-Package EasyKeys.Shipping.Amazon.Rates +``` + +Or via the .NET CLI: + +```bash + dotnet add package EasyKeys.Shipping.Amazon.Rates +``` + +## Prerequisites + +Before using this library, ensure you have the following: + +- .NET Core 6.0 or later. +- Amazon Shipping API credentials (Access Key, Secret Key). +- An active Amazon Seller or Partner account with Shipping API access. + +## Getting Started + +### 1. Configure the Library + +Add your Amazon API credentials to your application's configuration file (e.g., `appsettings.json`): + +```json +{ + "AmazonShipping": { + "ClientId": "YourClientId", + "ClientSecret": "YourClientSecret", + "RefreshToken": "YourRefreshToken", + "IsDevelopment": true + } +} +``` + +Alternatively, you can pass these credentials programmatically. + +### 2. Initialize the Provider + +Create an instance of the `AmazonShippingRateProvider` in your application: + +```csharp +using AmazonShippingRateProvider; + +var options = new AmazonShippingApiOptions +{ + ClientId = "YourClientId", + ClientSecret = "YourClientSecret", + RefreshToken = "YourRefreshToken", + IsDevelopment = true +}; + +var authenticatorService = new AmazonApiAuthenticatorService(); // Your implementation +var shippingApi = new AmazonShippingApi(); // API client +var logger = new LoggerFactory().CreateLogger(); + +var rateProvider = new AmazonShippingRateProvider(logger, options, authenticatorService, shippingApi); +``` + +### 3. Fetch Shipping Rates + +Call the `GetRatesAsync` method with the necessary parameters: + +```csharp +var shipment = new Shipment +{ + OriginAddress = new Address + { + StreetLine = "123 Origin St", + City = "OriginCity", + StateOrProvince = "NC", + CountryCode = "US", + PostalCode = "12345" + }, + DestinationAddress = new Address + { + StreetLine = "456 Destination St", + City = "DestinationCity", + StateOrProvince = "CA", + CountryCode = "US", + PostalCode = "67890" + }, + Packages = new List + { + new Package + { + Dimensions = new Dimensions + { + RoundedLength = 10, + RoundedWidth = 5, + RoundedHeight = 5 + }, + RoundedWeight = 1.5M, + InsuredValue = 100.00M + } + }, + Options = new ShipmentOptions + { + ShippingDate = DateTime.UtcNow + } +}; + +var rates = await rateProvider.GetRatesAsync(shipment); + +foreach (var rate in shipment.Rates) +{ + Console.WriteLine($"Carrier: {rate.Carrier}, Service: {rate.Service}, Price: {rate.Price}"); +} +``` + +## Error Handling + +The library throws exceptions for the following scenarios: +- `ApiException`: When the API returns an error response with detailed errors. +- `ApiException`: When there is a general API error. +- `Exception`: For unexpected errors. + +Wrap your calls in try-catch blocks for production use: + +```csharp +try +{ + var rates = await rateProvider.GetRatesAsync(shipment); + // Process rates +} +catch (ApiException ex) +{ + Console.WriteLine($"API Error: {string.Join(",", ex.Result.Errors.Select(e => e.Message))}"); +} +catch (ApiException ex) +{ + Console.WriteLine($"API Error: {ex.Message}"); +} +catch (Exception ex) +{ + Console.WriteLine($"Unexpected Error: {ex.Message}"); +} +``` + +## Implementation Details + +### Dependencies + +The `AmazonShippingRateProvider` depends on the following services: + +- **`IAmazonApiAuthenticatorService`**: Handles the retrieval of authentication tokens for the Amazon Shipping API. +- **`AmazonShippingApiOptions`**: Provides configuration options such as client ID, client secret, and environment details. +- **`AmazonShippingApi`**: The underlying API client used to interact with Amazon's endpoints. +- **`ILogger`**: Used for logging purposes. + +### Initialization + +The constructor of `AmazonShippingRateProvider` takes the following parameters: + +- `ILogger logger` +- `AmazonShippingApiOptions options` +- `IAmazonApiAuthenticatorService authenticatorService` +- `AmazonShippingApi shippingApi` + +### API Flow + +1. **Create `GetRatesRequest`:** Constructs the request object based on shipment details. +2. **Authenticate:** Retrieves an authentication token using `IAmazonApiAuthenticatorService`. +3. **Send Request:** Calls `AmazonShippingApi.GetRatesAsync` with the token and request. +4. **Parse Response:** Processes the API response, converting rates to the internal `Rate` model and attaching them to the shipment object. + +## Contributing + +Contributions are welcome! Feel free to open an issue or submit a pull request if you have suggestions or improvements. + +### Steps to Contribute: +1. Fork the repository. +2. Create a new branch for your feature or bug fix. +3. Commit your changes with descriptive messages. +4. Submit a pull request for review. + +## License + +This library is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details. + +--- + +For any issues or questions, please contact [devs@easykeys.com](mailto:devs@easykeys.com). + diff --git a/src/EasyKeys.Shipping.Amazon.Shipment/.editorconfig b/src/EasyKeys.Shipping.Amazon.Shipment/.editorconfig new file mode 100644 index 0000000..7cf693a --- /dev/null +++ b/src/EasyKeys.Shipping.Amazon.Shipment/.editorconfig @@ -0,0 +1,311 @@ +# EditorConfig is awesome: https://EditorConfig.org +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +# Matches multiple files with brace expansion notation +# Set default charset +[*.js] +charset = utf-8 + +# Solution Files +[*.sln] +indent_style = tab + +# XML Project Files +[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] +indent_size = 2 + +# YAML Files +[*.{yml,yaml}] +indent_size = 2 +indent_style = space + +# Markdown Files +[*.md] +trim_trailing_whitespace = false + +# .NET Code Style Settings +[*.{cs,csx,cake,vb}] + +[*.cshtml.cs] +dotnet_diagnostic.SA1649.severity = none + +# "this." and "Me." qualifiers +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#this_and_me +dotnet_style_qualification_for_field = false:warning +dotnet_style_qualification_for_property = false:warning +dotnet_style_qualification_for_method = false:warning +dotnet_style_qualification_for_event = false:warning + +# Language keywords instead of framework type names for type references +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#language_keywords +dotnet_style_predefined_type_for_locals_parameters_members = true:warning +dotnet_style_predefined_type_for_member_access = true:warning + +# Modifier preferences +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#normalize_modifiers +dotnet_style_require_accessibility_modifiers = always:warning +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:warning +dotnet_style_readonly_field = true:warning + +# Code-block preferences +csharp_prefer_braces = true:silent +csharp_prefer_simple_using_statement = true:suggestion + +# Expression-level preferences +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#expression_level +dotnet_style_object_initializer = true:warning +dotnet_style_collection_initializer = true:warning +dotnet_style_explicit_tuple_names = true:warning +dotnet_style_prefer_inferred_tuple_names = true:warning +dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning +dotnet_style_prefer_auto_properties = true:warning +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning + +# 'using' directive preferences +csharp_using_directive_placement = outside_namespace:silent + +# Null-checking preferences +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#null_checking +dotnet_style_coalesce_expression = true:warning +dotnet_style_null_propagation = true:warning + +# Other (Undocumented) +dotnet_style_prefer_conditional_expression_over_return = false +dotnet_style_prefer_conditional_expression_over_assignment = false + +# C# Code Style Settings +[*.{cs,csx,cake}] +# Implicit and explicit types +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#implicit-and-explicit-types +csharp_style_var_for_built_in_types = true:warning +csharp_style_var_when_type_is_apparent = true:warning +csharp_style_var_elsewhere = true:warning + +# Expression-bodied members +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#expression_bodied_members +csharp_style_expression_bodied_methods = false:warning +csharp_style_expression_bodied_constructors = false:warning +csharp_style_expression_bodied_operators = true:warning +csharp_style_expression_bodied_properties = true:warning +csharp_style_expression_bodied_indexers = true:warning +csharp_style_expression_bodied_accessors = true:warning + +# Pattern matching +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#pattern_matching +csharp_style_pattern_matching_over_is_with_cast_check = true:warning +csharp_style_pattern_matching_over_as_with_null_check = true:warning + +# Inlined variable declarations +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#inlined_variable_declarations +csharp_style_inlined_variable_declaration = true:warning + +# Expression-level preferences +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#expression_level_csharp +csharp_prefer_simple_default_expression = true:warning +csharp_style_deconstructed_variable_declaration = true:warning +csharp_style_pattern_local_over_anonymous_function = true:warning + +# "Null" checking preferences +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#null_checking_csharp +csharp_style_throw_expression = true:warning +csharp_style_conditional_delegate_call = true:warning + +# Code block preferences +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#code_block +csharp_prefer_braces = true:warning + +############################# +# .NET Formatting Conventions +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#formatting-conventions +############################# + +# Organize usings +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#usings +dotnet_sort_system_directives_first = true +dotnet_separate_import_directive_groups = true + +# C# formatting settings +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#c-formatting-settings +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true:warning +csharp_new_line_before_catch = true:warning +csharp_new_line_before_finally = true:warning +csharp_new_line_before_members_in_object_initializers = true:warning +csharp_new_line_before_members_in_anonymous_types = true:warning +csharp_new_line_between_query_expression_clauses = true:warning + +# Indentation options +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#indent +csharp_indent_case_contents = true:warning +csharp_indent_switch_labels = true:warning +csharp_indent_labels = no_change:warning + +# Spacing options +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#spacing +csharp_space_after_cast = false:warning +csharp_space_after_keywords_in_control_flow_statements = true:warning +csharp_space_between_method_declaration_parameter_list_parentheses = false:warning +csharp_space_between_method_call_parameter_list_parentheses = false:warning +csharp_space_between_parentheses = expressions:warning +csharp_space_before_colon_in_inheritance_clause = true:warning +csharp_space_after_colon_in_inheritance_clause = true:warning +csharp_space_around_binary_operators = before_and_after:warning +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false:warning +csharp_space_between_method_call_name_and_opening_parenthesis = false:warning +csharp_space_between_method_call_empty_parameter_list_parentheses = false:warning + +# Wrapping options +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#wrapping +csharp_preserve_single_line_statements = false:warning +csharp_preserve_single_line_blocks = true:warning + +# More Indentation options (Undocumented) +csharp_indent_block_contents = true:warning +csharp_indent_braces = false:warning + +# Spacing Options (Undocumented) +csharp_space_after_comma = true:warning +csharp_space_after_dot = false:warning +csharp_space_after_semicolon_in_for_statement = true:warning +csharp_space_around_declaration_statements = do_not_ignore:warning +csharp_space_before_comma = false:warning +csharp_space_before_dot = false:warning +csharp_space_before_semicolon_in_for_statement = false:warning +csharp_space_before_open_square_brackets = false:warning +csharp_space_between_empty_square_brackets = false:warning +csharp_space_between_method_declaration_name_and_open_parenthesis = false:warning +csharp_space_between_square_brackets = false:warning + +######################### +# .NET Naming conventions +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions +######################### + +[*.{cs,csx,cake,vb}] +# Naming Symbols +# constant_fields - Define constant fields +dotnet_naming_symbols.constant_fields.applicable_kinds = field +dotnet_naming_symbols.constant_fields.required_modifiers = const + +# non_private_readonly_fields - Define public, internal and protected readonly fields +dotnet_naming_symbols.non_private_readonly_fields.applicable_accessibilities = public, internal, protected +dotnet_naming_symbols.non_private_readonly_fields.applicable_kinds = field +dotnet_naming_symbols.non_private_readonly_fields.required_modifiers = readonly + +# static_readonly_fields - Define static and readonly fields +dotnet_naming_symbols.static_readonly_fields.applicable_kinds = field +dotnet_naming_symbols.static_readonly_fields.required_modifiers = static, readonly + +# private_readonly_fields - Define private readonly fields +dotnet_naming_symbols.private_readonly_fields.applicable_accessibilities = private +dotnet_naming_symbols.private_readonly_fields.applicable_kinds = field +dotnet_naming_symbols.private_readonly_fields.required_modifiers = readonly + +# public_internal_fields - Define public and internal fields +dotnet_naming_symbols.public_internal_fields.applicable_accessibilities = public, internal +dotnet_naming_symbols.public_internal_fields.applicable_kinds = field + +# private_protected_fields - Define private and protected fields +dotnet_naming_symbols.private_protected_fields.applicable_accessibilities = private, protected +dotnet_naming_symbols.private_protected_fields.applicable_kinds = field + +# public_symbols - Define any public symbol +dotnet_naming_symbols.public_symbols.applicable_accessibilities = public, internal, protected, protected_internal +dotnet_naming_symbols.public_symbols.applicable_kinds = method, property, event, delegate + +# parameters - Defines any parameter +dotnet_naming_symbols.parameters.applicable_kinds = parameter + +# non_interface_types - Defines class, struct, enum and delegate types +dotnet_naming_symbols.non_interface_types.applicable_kinds = class, struct, enum, delegate + +# interface_types - Defines interfaces +dotnet_naming_symbols.interface_types.applicable_kinds = interface + +######################### +# Naming Styles +######################### + +# camel_case - Define the camelCase style +dotnet_naming_style.camel_case.capitalization = camel_case + +# pascal_case - Define the Pascal_case style +dotnet_naming_style.pascal_case.capitalization = pascal_case + +# first_upper - The first character must start with an upper-case character +dotnet_naming_style.first_upper.capitalization = first_word_upper + +# prefix_interface_interface_with_i - Interfaces must be PascalCase and the first character of an interface must be an 'I' +dotnet_naming_style.prefix_interface_interface_with_i.capitalization = pascal_case +dotnet_naming_style.prefix_interface_interface_with_i.required_prefix = I + +######################### +# Naming Rules +######################### + +# Constant fields must be PascalCase +dotnet_naming_rule.constant_fields_must_be_pascal_case.severity = warning +dotnet_naming_rule.constant_fields_must_be_pascal_case.symbols = constant_fields +dotnet_naming_rule.constant_fields_must_be_pascal_case.style = pascal_case + +# Public, internal and protected readonly fields must be PascalCase +dotnet_naming_rule.non_private_readonly_fields_must_be_pascal_case.severity = warning +dotnet_naming_rule.non_private_readonly_fields_must_be_pascal_case.symbols = non_private_readonly_fields +dotnet_naming_rule.non_private_readonly_fields_must_be_pascal_case.style = pascal_case + +# Static readonly fields must be PascalCase +dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.severity = warning +dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.symbols = static_readonly_fields +dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.style = pascal_case + +# Public and internal fields must be PascalCase +dotnet_naming_rule.public_internal_fields_must_be_pascal_case.severity = warning +dotnet_naming_rule.public_internal_fields_must_be_pascal_case.symbols = public_internal_fields +dotnet_naming_rule.public_internal_fields_must_be_pascal_case.style = pascal_case + +# Public members must be capitalized +dotnet_naming_rule.public_members_must_be_capitalized.severity = warning +dotnet_naming_rule.public_members_must_be_capitalized.symbols = public_symbols +dotnet_naming_rule.public_members_must_be_capitalized.style = first_upper + +# Parameters must be camelCase +dotnet_naming_rule.parameters_must_be_camel_case.severity = warning +dotnet_naming_rule.parameters_must_be_camel_case.symbols = parameters +dotnet_naming_rule.parameters_must_be_camel_case.style = camel_case + +# Class, struct, enum and delegates must be PascalCase +dotnet_naming_rule.non_interface_types_must_be_pascal_case.severity = warning +dotnet_naming_rule.non_interface_types_must_be_pascal_case.symbols = non_interface_types +dotnet_naming_rule.non_interface_types_must_be_pascal_case.style = pascal_case + +# Interfaces must be PascalCase and start with an 'I' +dotnet_naming_rule.interface_types_must_be_prefixed_with_i.severity = warning +dotnet_naming_rule.interface_types_must_be_prefixed_with_i.symbols = interface_types +dotnet_naming_rule.interface_types_must_be_prefixed_with_i.style = prefix_interface_interface_with_i + +dotnet_naming_symbols.private_fields.applicable_kinds = field +dotnet_naming_symbols.private_fields.applicable_accessibilities = private, internal + +# internal and private fields should be _camelCase +dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion +dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields +dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style + +dotnet_naming_symbols.private_internal_fields.applicable_kinds = field +dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal, protected + +dotnet_naming_style.camel_case_underscore_style.required_prefix = _ +dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case + + +[*.cs] + +# CA1815: Override equals and operator equals on value types +dotnet_diagnostic.CA1815.severity = silent diff --git a/src/EasyKeys.Shipping.Amazon.Shipment/AmazonShippingShipmentProvider.cs b/src/EasyKeys.Shipping.Amazon.Shipment/AmazonShippingShipmentProvider.cs new file mode 100644 index 0000000..e8606cb --- /dev/null +++ b/src/EasyKeys.Shipping.Amazon.Shipment/AmazonShippingShipmentProvider.cs @@ -0,0 +1,233 @@ +using System.Collections.ObjectModel; +using System.Text; +using EasyKeys.Shipping.Abstractions.Models; +using EasyKeys.Shipping.Amazon.Abstractions.OpenApis.V2.Shipping; +using EasyKeys.Shipping.Amazon.Abstractions.Options; +using EasyKeys.Shipping.Amazon.Abstractions.Services; +using EasyKeys.Shipping.Amazon.Shipment.Models; +using Microsoft.Extensions.Logging; + +namespace EasyKeys.Shipping.Amazon.Shipment; + +public class AmazonShippingShipmentProvider : IAmazonShippingShipmentProvider +{ + private readonly AmazonShippingApi _shippingApi; + private readonly AmazonShippingApiOptions _options; + private readonly IAmazonApiAuthenticatorService _authenticatorService; + private readonly ILogger _logger; + + public AmazonShippingShipmentProvider( + ILogger logger, + AmazonShippingApiOptions options, + AmazonShippingApi amazonShippingApi, + IAmazonApiAuthenticatorService amazonApiAuthenticator) + { + _logger = logger; + _options = options; + _shippingApi = amazonShippingApi; + _authenticatorService = amazonApiAuthenticator; + _shippingApi.BaseUrl = _options.IsDevelopment ? _shippingApi.BaseUrl : "https://sellingpartnerapi-na.amazon.com"; + } + + public Task CreateShipmentAsync( + string RateId, + Shipping.Abstractions.Models.Shipment shipment, + ShippingDetails shippingDetails, + CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + + public async Task CreateSmartShipmentAsync( + Shipping.Abstractions.Models.Shipment shipment, + ShippingDetails shippingDetails, + CancellationToken cancellationToken = default) + { + var label = new ShipmentLabel(); + + try + { + var request = new OneClickShipmentRequest() + { + ShipDate = shipment.Options.ShippingDate.ToString("yyyy-MM-dd'T'HH:mm:ss'Z'"), + ShipTo = new Abstractions.OpenApis.V2.Shipping.Address() + { + Name = shippingDetails.Recipient.FullName, + CompanyName = shippingDetails.Recipient.Company, + AddressLine1 = shipment.DestinationAddress.StreetLine, + AddressLine2 = shipment.DestinationAddress.StreetLine2, + StateOrRegion = shipment.DestinationAddress.StateOrProvince, + City = shipment.DestinationAddress.City, + CountryCode = shipment.DestinationAddress.CountryCode, + PostalCode = shipment.DestinationAddress.PostalCode, + Email = shippingDetails.Recipient.Email, + PhoneNumber = shippingDetails.Recipient.PhoneNumber + }, + ShipFrom = new Abstractions.OpenApis.V2.Shipping.Address() + { + AddressLine1 = shipment.OriginAddress.StreetLine, + AddressLine2 = shipment.OriginAddress.StreetLine2, + StateOrRegion = shipment.OriginAddress.StateOrProvince, + City = shipment.OriginAddress.City, + CountryCode = shipment.OriginAddress.CountryCode, + PostalCode = shipment.OriginAddress.PostalCode, + Email = shippingDetails.Sender.Email, + CompanyName = shippingDetails.Sender.Company, + PhoneNumber = shippingDetails.Sender.PhoneNumber, + Name = shippingDetails.Sender.FullName + }, + Packages = new () + { + new () + { + Dimensions = new () + { + Unit = DimensionsUnit.INCH, + Length = (double)shipment.Packages.Max(x => x.Dimensions.RoundedLength), + Width = (double)shipment.Packages.Max(x => x.Dimensions.RoundedWidth), + Height = (double)shipment.Packages.Max(x => x.Dimensions.RoundedHeight) + }, + Weight = new () + { + Unit = WeightUnit.POUND, + Value = (double)shipment.Packages.Sum(x => x.RoundedWeight) + }, + InsuredValue = new () + { + Value = (double)shipment.Packages.Sum(x => x.InsuredValue), + Unit = "USD" + }, + PackageClientReferenceId = "packageClientReferenceId", + Items = new () + { + new () + { + Weight = new () + { + Unit = WeightUnit.POUND + }, + LiquidVolume = new () + { + Unit = LiquidVolumeUnit.ML + }, + Description = "Package", + Quantity = 1 + } + } + } + }, + ChannelDetails = new () + { + ChannelType = ChannelType.EXTERNAL + }, + ServiceSelection = new () + { + ServiceId = new () { shippingDetails.ServiceId } + }, + LabelSpecifications = new () + { + Format = shippingDetails.LabelFormat switch + { + "PNG" => DocumentFormat.PNG, + "PDF" => DocumentFormat.PDF, + _ => DocumentFormat.PNG + }, + Size = new () + { + Length = (double)shippingDetails.LabelDimensions.Length, + Width = (double)shippingDetails.LabelDimensions.Width, + Unit = shippingDetails.LabelUnit switch + { + "INCH" => DocumentSizeUnit.INCH, + "CM" => DocumentSizeUnit.CENTIMETER, + _ => DocumentSizeUnit.INCH + } + }, + Dpi = shippingDetails.LabelDpi, + PageLayout = "DEFAULT", + NeedFileJoining = false, + RequestedDocumentTypes = new Collection { DocumentType.LABEL } + } + }; + + var accessToken = await _authenticatorService.GetTokenAsync(cancellationToken); + + var shipmentResult = await _shippingApi + .OneClickShipmentAsync( + accessToken, + XAmznShippingBusinessId3.AmazonShipping_US, + request, + cancellationToken); + + foreach (var details in shipmentResult.Payload.PackageDocumentDetails) + { + label.Labels.Add( + new PackageLabelDetails + { + TotalCharges = new ShipmentCharges + { + NetCharge = (decimal)shipmentResult.Payload.TotalCharge.Value, + Surcharges = 0.0m + }, + ProviderLabelId = shipmentResult.Payload.ShipmentId, + TrackingId = details.TrackingId, + ImageType = "PNG", + Bytes = details.PackageDocuments.Select(x => Encoding.UTF8.GetBytes(x.Contents)).ToList() + }); + } + } + catch (ApiException ex) + { + foreach (var error in ex.Result.Errors) + { + label.InternalErrors.Add(error.Message); + } + + _logger.LogError(ex, $"Error creating shipment from Amazon Shipping API: {string.Join(",", ex.Result.Errors)}"); + } + catch (ApiException ex) + { + label.InternalErrors.Add(ex.Message); + _logger.LogError(ex, $"Error creating shipment from Amazon Shipping API: {ex.Message}"); + } + catch (Exception ex) + { + label.InternalErrors.Add(ex.Message); + _logger.LogError(ex, $"Error creating shipment from Amazon Shipping API: {ex.Message}"); + } + + return label; + } + + public async Task CancelShipmentAsync(string shipmentId, CancellationToken cancellationToken = default) + { + var result = new ShipmentCancelledResult(); + try + { + var accessToken = await _authenticatorService.GetTokenAsync(cancellationToken); + + await _shippingApi.CancelShipmentAsync( + shipmentId, + accessToken, + XAmznShippingBusinessId6.AmazonShipping_US, + cancellationToken); + } + catch (ApiException ex) + { + foreach (var error in ex.Result.Errors) + { + result.Errors.Add(error.Message); + } + } + catch (ApiException ex) + { + result.Errors.Add(ex.Message); + } + catch (Exception ex) + { + result.Errors.Add(ex.Message); + } + + return result; + } +} diff --git a/src/EasyKeys.Shipping.Amazon.Shipment/DependencyInjection/AmazonRatesServiceCollectionExtensions.cs b/src/EasyKeys.Shipping.Amazon.Shipment/DependencyInjection/AmazonRatesServiceCollectionExtensions.cs new file mode 100644 index 0000000..2768a67 --- /dev/null +++ b/src/EasyKeys.Shipping.Amazon.Shipment/DependencyInjection/AmazonRatesServiceCollectionExtensions.cs @@ -0,0 +1,24 @@ +using EasyKeys.Shipping.Amazon.Abstractions.Options; +using Microsoft.Extensions.DependencyInjection; + +namespace EasyKeys.Shipping.Amazon.Shipment.DependencyInjection; + +public static class AmazonRatesServiceCollectionExtensions +{ + /// + /// Adds the rest API amazon rate provider.Must add AmazonShippingClient to di container. + /// + /// + /// + /// + /// + public static IServiceCollection AddRestApiAmazonShipmentProvider( + this IServiceCollection services, + string sectionName = nameof(AmazonShippingApiOptions), + Action? configOptions = null) + { + services.AddTransient(); + + return services; + } +} diff --git a/src/EasyKeys.Shipping.Amazon.Shipment/EasyKeys.Shipping.Amazon.Shipment.csproj b/src/EasyKeys.Shipping.Amazon.Shipment/EasyKeys.Shipping.Amazon.Shipment.csproj new file mode 100644 index 0000000..c75bcd2 --- /dev/null +++ b/src/EasyKeys.Shipping.Amazon.Shipment/EasyKeys.Shipping.Amazon.Shipment.csproj @@ -0,0 +1,18 @@ + + + + net8.0 + enable + enable + + + DotNetCore Implementation of Amazon Shipping Shipment Endpoints. + + DotNetCore, Amazon Shipping V2, Shipping V2 APIs + + + + + + + diff --git a/src/EasyKeys.Shipping.Amazon.Shipment/IAmazonShippingShipmentProvider.cs b/src/EasyKeys.Shipping.Amazon.Shipment/IAmazonShippingShipmentProvider.cs new file mode 100644 index 0000000..40dcfb0 --- /dev/null +++ b/src/EasyKeys.Shipping.Amazon.Shipment/IAmazonShippingShipmentProvider.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using EasyKeys.Shipping.Abstractions.Models; +using EasyKeys.Shipping.Amazon.Shipment.Models; + +namespace EasyKeys.Shipping.Amazon.Shipment; +public interface IAmazonShippingShipmentProvider +{ + Task CreateSmartShipmentAsync( + Shipping.Abstractions.Models.Shipment shipment, + ShippingDetails shippingDetails, + CancellationToken cancellationToken = default); + + Task CreateShipmentAsync( + string RateId, + Shipping.Abstractions.Models.Shipment shipment, + ShippingDetails shippingDetails, + CancellationToken cancellationToken = default); + + Task CancelShipmentAsync( + string shipmentId, + CancellationToken cancellationToken = default); +} diff --git a/src/EasyKeys.Shipping.Amazon.Shipment/Models/ShippingDetails.cs b/src/EasyKeys.Shipping.Amazon.Shipment/Models/ShippingDetails.cs new file mode 100644 index 0000000..834f622 --- /dev/null +++ b/src/EasyKeys.Shipping.Amazon.Shipment/Models/ShippingDetails.cs @@ -0,0 +1,30 @@ +using EasyKeys.Shipping.Abstractions.Models; + +namespace EasyKeys.Shipping.Amazon.Shipment.Models; + +public class ShippingDetails +{ + /// + /// Sender Contact Info. + /// + public ContactInfo Sender { get; set; } = new ContactInfo(); + + /// + /// Recipient Contact Info. + /// + public ContactInfo Recipient { get; set; } = new ContactInfo(); + + public string LabelFormat { get; set; } = "PNG"; + + public Dimensions LabelDimensions { get; set; } = new Dimensions + { + Length = 6, + Width = 4 + }; + + public string LabelUnit { get; set; } = "INCH"; + + public int LabelDpi { get; set; } = 300; + + public string ServiceId { get; set; } = "std-us-swa-mfn"; +} diff --git a/src/EasyKeys.Shipping.Amazon.Shipment/README.md b/src/EasyKeys.Shipping.Amazon.Shipment/README.md new file mode 100644 index 0000000..1c4088a --- /dev/null +++ b/src/EasyKeys.Shipping.Amazon.Shipment/README.md @@ -0,0 +1,236 @@ +# EasyKeys.Shipping.Amazon.Shipment + +[![Build status](https://ci.appveyor.com/api/projects/status/xp52rbpa9vmr1ck9?svg=true)](https://ci.appveyor.com/project/easykeys/easykeys-shipping) +[![NuGet](https://img.shields.io/nuget/v/EasyKeys.Shipping.Amazon.Shipment.svg)](https://www.nuget.org/packages?q=EasyKeys.Shipping.Amazon.Shipment) +![Nuget](https://img.shields.io/nuget/dt/EasyKeys.Shipping.Amazon.Shipment) +[![feedz.io](https://img.shields.io/badge/endpoint.svg?url=https://f.feedz.io/easykeys/core/shield/EasyKeys.Shipping.Amazon.Shipment/latest)](https://f.feedz.io/easykeys/core/packages/EasyKeys.Shipping.Amazon.Shipment/latest/download) + +AmazonShippingShipmentProvider is a .NET Core library designed to simplify interactions with Amazon's Shipping API for creating, managing, and canceling shipments. It provides a streamlined API interface for handling shipments and generating shipping labels. + +## Features + +- Create shipments and generate shipping labels. +- Cancel existing shipments. +- Flexible support for label formats (PNG, PDF). +- Supports asynchronous operations for better performance. +- Built-in error handling with detailed logging. + +## Installation + +Install the package via NuGet Package Manager: + +```bash +Install-Package EasyKeys.Shipping.Amazon.Shipment +``` + +Or via the .NET CLI: + +```bash + dotnet add package EasyKeys.Shipping.Amazon.Shipment +``` + +## Prerequisites + +Before using this library, ensure you have the following: + +- .NET Core 6.0 or later. +- Amazon Shipping API credentials (Client ID, Client Secret, and Refresh Token). +- An active Amazon Seller or Partner account with Shipping API access. + +## Getting Started + +### 1. Configure the Library + +Add your Amazon API credentials to your application's configuration file (e.g., `appsettings.json`): + +```json +{ + "AmazonShipping": { + "ClientId": "YourClientId", + "ClientSecret": "YourClientSecret", + "RefreshToken": "YourRefreshToken", + "IsDevelopment": true + } +} +``` + +Alternatively, you can pass these credentials programmatically. + +### 2. Initialize the Provider + +Create an instance of the `AmazonShippingShipmentProvider` in your application: + +```csharp +using AmazonShippingShipmentProvider; + +var options = new AmazonShippingApiOptions +{ + ClientId = "YourClientId", + ClientSecret = "YourClientSecret", + RefreshToken = "YourRefreshToken", + IsDevelopment = true +}; + +var authenticatorService = new AmazonApiAuthenticatorService(); // Your implementation +var shippingApi = new AmazonShippingApi(); // API client +var logger = new LoggerFactory().CreateLogger(); + +var shipmentProvider = new AmazonShippingShipmentProvider(logger, options, shippingApi, authenticatorService); +``` + +### 3. Create a Smart Shipment + +Call the `CreateSmartShipmentAsync` method to generate a shipment and its associated label: + +```csharp +var shipment = new Shipment +{ + OriginAddress = new Address + { + StreetLine = "123 Origin St", + City = "OriginCity", + StateOrProvince = "NC", + CountryCode = "US", + PostalCode = "12345" + }, + DestinationAddress = new Address + { + StreetLine = "456 Destination St", + City = "DestinationCity", + StateOrProvince = "CA", + CountryCode = "US", + PostalCode = "67890" + }, + Packages = new List + { + new Package + { + Dimensions = new Dimensions + { + RoundedLength = 10, + RoundedWidth = 5, + RoundedHeight = 5 + }, + RoundedWeight = 1.5M, + InsuredValue = 100.00M + } + }, + Options = new ShipmentOptions + { + ShippingDate = DateTime.UtcNow + } +}; + +var shippingDetails = new ShippingDetails +{ + Recipient = new Contact + { + FullName = "John Doe", + Email = "john.doe@example.com", + PhoneNumber = "1234567890", + Company = "Recipient Company" + }, + Sender = new Contact + { + FullName = "Jane Doe", + Email = "jane.doe@example.com", + PhoneNumber = "9876543210", + Company = "Sender Company" + }, + ServiceId = "ServiceId123", + LabelFormat = "PDF", + LabelDimensions = new Dimensions { Length = 8.5, Width = 11 }, + LabelUnit = "INCH", + LabelDpi = 300 +}; + +var shipmentLabel = await shipmentProvider.CreateSmartShipmentAsync(shipment, shippingDetails); + +foreach (var label in shipmentLabel.Labels) +{ + Console.WriteLine($"Label Tracking ID: {label.TrackingId}, Net Charge: {label.TotalCharges.NetCharge}"); +} +``` + +### 4. Cancel a Shipment + +To cancel an existing shipment, call the `CancelShipmentAsync` method: + +```csharp +var cancellationResult = await shipmentProvider.CancelShipmentAsync("ShipmentId123"); + +if (cancellationResult.Errors.Any()) +{ + Console.WriteLine("Failed to cancel shipment: " + string.Join(",", cancellationResult.Errors)); +} +else +{ + Console.WriteLine("Shipment canceled successfully."); +} +``` + +## Error Handling + +The library throws exceptions for the following scenarios: +- `ApiException`: When the API returns an error response with detailed errors. +- `ApiException`: When there is a general API error. +- `Exception`: For unexpected errors. + +Wrap your calls in try-catch blocks for production use: + +```csharp +try +{ + var shipmentLabel = await shipmentProvider.CreateSmartShipmentAsync(shipment, shippingDetails); + // Process labels +} +catch (ApiException ex) +{ + Console.WriteLine($"API Error: {string.Join(",", ex.Result.Errors.Select(e => e.Message))}"); +} +catch (ApiException ex) +{ + Console.WriteLine($"API Error: {ex.Message}"); +} +catch (Exception ex) +{ + Console.WriteLine($"Unexpected Error: {ex.Message}"); +} +``` + +## Implementation Details + +### Dependencies + +The `AmazonShippingShipmentProvider` depends on the following services: + +- **`IAmazonApiAuthenticatorService`**: Handles the retrieval of authentication tokens for the Amazon Shipping API. +- **`AmazonShippingApiOptions`**: Provides configuration options such as client ID, client secret, and environment details. +- **`AmazonShippingApi`**: The underlying API client used to interact with Amazon's endpoints. +- **`ILogger`**: Used for logging purposes. + +### API Flow + +1. **Create `OneClickShipmentRequest`:** Constructs the request object based on shipment details and shipping options. +2. **Authenticate:** Retrieves an authentication token using `IAmazonApiAuthenticatorService`. +3. **Send Request:** Calls `AmazonShippingApi.OneClickShipmentAsync` to create the shipment. +4. **Parse Response:** Processes the API response, extracting labels and attaching them to the shipment object. + +## Contributing + +Contributions are welcome! Feel free to open an issue or submit a pull request if you have suggestions or improvements. + +### Steps to Contribute: +1. Fork the repository. +2. Create a new branch for your feature or bug fix. +3. Commit your changes with descriptive messages. +4. Submit a pull request for review. + +## License + +This library is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details. + +--- + +For any issues or questions, please contact [devs@easykeys.com](mailto:devs@easykeys.com). + diff --git a/src/EasyKeys.Shipping.FedEx.Abstractions/.editorconfig b/src/EasyKeys.Shipping.FedEx.Abstractions/.editorconfig index e3dc801..f6509eb 100644 --- a/src/EasyKeys.Shipping.FedEx.Abstractions/.editorconfig +++ b/src/EasyKeys.Shipping.FedEx.Abstractions/.editorconfig @@ -303,6 +303,12 @@ dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = priva dotnet_naming_style.camel_case_underscore_style.required_prefix = _ dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case +dotnet_style_operator_placement_when_wrapping = beginning_of_line +tab_width = 4 +indent_size = 4 +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion [*.cs] @@ -312,3 +318,20 @@ dotnet_diagnostic.CA1815.severity = silent # SA1000: Keywords should be spaced correctly dotnet_diagnostic.SA1000.severity = silent +csharp_indent_labels = no_change +csharp_using_directive_placement = outside_namespace:silent +csharp_prefer_simple_using_statement = true:suggestion +csharp_prefer_braces = true:warning +csharp_style_namespace_declarations = block_scoped:silent +csharp_style_prefer_method_group_conversion = true:silent +csharp_style_prefer_top_level_statements = true:silent +csharp_style_prefer_primary_constructors = true:suggestion +csharp_prefer_system_threading_lock = true:suggestion +csharp_style_expression_bodied_methods = false:warning +csharp_style_expression_bodied_constructors = false:warning +csharp_style_expression_bodied_operators = true:warning +csharp_style_expression_bodied_properties = true:warning +csharp_style_expression_bodied_indexers = true:warning +csharp_style_expression_bodied_accessors = true:warning +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = false:silent diff --git a/src/EasyKeys.Shipping.FedEx.Abstractions/DependencyInjection/FedExServiceCollectionExtensions.cs b/src/EasyKeys.Shipping.FedEx.Abstractions/DependencyInjection/FedExServiceCollectionExtensions.cs index c5e0f60..4678ca1 100644 --- a/src/EasyKeys.Shipping.FedEx.Abstractions/DependencyInjection/FedExServiceCollectionExtensions.cs +++ b/src/EasyKeys.Shipping.FedEx.Abstractions/DependencyInjection/FedExServiceCollectionExtensions.cs @@ -43,6 +43,8 @@ public static IServiceCollection AddFedExApiClients( string sectionName = nameof(FedExApiOptions), Action? configure = null) { + services.AddLogging(); + services.AddChangeTokenOptions(sectionName, null, (options, config) => configure?.Invoke(options, config)); services.AddSingleton(); diff --git a/src/EasyKeys.Shipping.FedEx.AddressValidation/DependencyInjection/AddressValidationServiceExtensions.cs b/src/EasyKeys.Shipping.FedEx.AddressValidation/DependencyInjection/AddressValidationServiceExtensions.cs index 6d8a499..458b45e 100644 --- a/src/EasyKeys.Shipping.FedEx.AddressValidation/DependencyInjection/AddressValidationServiceExtensions.cs +++ b/src/EasyKeys.Shipping.FedEx.AddressValidation/DependencyInjection/AddressValidationServiceExtensions.cs @@ -49,14 +49,6 @@ public static IServiceCollection AddRestApiFedExAddressValidationProvider( string sectionName = nameof(FedExApiOptions), Action? configOptions = null) { - services.AddChangeTokenOptions( - sectionName: sectionName, - configureAction: (options, sp) => configOptions?.Invoke(options, sp)); - - services.AddLogging(); - - services.AddFedExApiClients(); - services.AddTransient(); services.AddTransient(); diff --git a/src/EasyKeys.Shipping.FedEx.Rates/DependencyInjection/FedExRatesServiceCollectionExtensions.cs b/src/EasyKeys.Shipping.FedEx.Rates/DependencyInjection/FedExRatesServiceCollectionExtensions.cs index 7f9b0a6..35aa860 100644 --- a/src/EasyKeys.Shipping.FedEx.Rates/DependencyInjection/FedExRatesServiceCollectionExtensions.cs +++ b/src/EasyKeys.Shipping.FedEx.Rates/DependencyInjection/FedExRatesServiceCollectionExtensions.cs @@ -39,9 +39,6 @@ public static IServiceCollection AddRestApiFedExRateProvider( string sectionName = nameof(FedExApiOptions), Action? configOptions = null) { - services.AddLogging(); - - services.AddFedExApiClients(); services.AddTransient(); diff --git a/src/EasyKeys.Shipping.FedEx.Shipment/DependencyInjection/FedExShippingServiceCollectionExtensions.cs b/src/EasyKeys.Shipping.FedEx.Shipment/DependencyInjection/FedExShippingServiceCollectionExtensions.cs index f12eb16..782d407 100644 --- a/src/EasyKeys.Shipping.FedEx.Shipment/DependencyInjection/FedExShippingServiceCollectionExtensions.cs +++ b/src/EasyKeys.Shipping.FedEx.Shipment/DependencyInjection/FedExShippingServiceCollectionExtensions.cs @@ -39,9 +39,6 @@ public static IServiceCollection AddRestApiFedExShipmentProvider( string sectionName = nameof(FedExApiOptions), Action? configOptions = null) { - services.AddLogging(); - - services.AddFedExApiClients(); services.AddTransient(); diff --git a/src/Minimal.Apis/Minimal.Apis.csproj b/src/Minimal.Apis/Minimal.Apis.csproj index d767430..c65ee69 100644 --- a/src/Minimal.Apis/Minimal.Apis.csproj +++ b/src/Minimal.Apis/Minimal.Apis.csproj @@ -12,6 +12,7 @@ + diff --git a/src/Minimal.Apis/Program.cs b/src/Minimal.Apis/Program.cs index 3d48c40..5bd4b0a 100644 --- a/src/Minimal.Apis/Program.cs +++ b/src/Minimal.Apis/Program.cs @@ -1,5 +1,4 @@ using System.Text.Json; - using EasyKeys.Shipping.Abstractions.Models; using EasyKeys.Shipping.FedEx.Abstractions.Models; using EasyKeys.Shipping.FedEx.AddressValidation; diff --git a/test/EasyKeys.Shipping.FuncTest/Amazon/AmazonRateProviderTests.cs b/test/EasyKeys.Shipping.FuncTest/Amazon/AmazonRateProviderTests.cs new file mode 100644 index 0000000..89617d7 --- /dev/null +++ b/test/EasyKeys.Shipping.FuncTest/Amazon/AmazonRateProviderTests.cs @@ -0,0 +1,40 @@ +using EasyKeys.Shipping.Amazon.Rates; +using EasyKeys.Shipping.Stamps.Shipment; + +using EasyKeysShipping.FuncTest.TestHelpers; + +using Microsoft.Extensions.DependencyInjection; + +namespace EasyKeys.Shipping.FuncTest.Amazon; + +public class AmazonShippingRateProviderTests +{ + private readonly IAmazonShippingRateProvider _rateProvider; + private readonly ITestOutputHelper _output; + + public AmazonShippingRateProviderTests(ITestOutputHelper output) + { + _output = output; + _rateProvider = ServiceProviderInstance.GetAmazonServices(output) + .GetRequiredService(); + } + + [Fact] + public async Task Return_Shipment_With_Rates_Successfully() + { + var shipment = TestShipments.CreateDomesticShipment(); + + var result = await _rateProvider.GetRatesAsync(shipment, CancellationToken.None); + + Assert.NotNull(result); + + Assert.NotNull(result.Rates); + + Assert.Empty(result.InternalErrors); + + foreach (var rate in result.Rates) + { + _output.WriteLine($"{rate.ServiceName} - {rate.TotalCharges} / {rate.TotalCharges2}"); + } + } +} diff --git a/test/EasyKeys.Shipping.FuncTest/Amazon/AmazonShippingShipmentProviderTests.cs b/test/EasyKeys.Shipping.FuncTest/Amazon/AmazonShippingShipmentProviderTests.cs new file mode 100644 index 0000000..dc76cfb --- /dev/null +++ b/test/EasyKeys.Shipping.FuncTest/Amazon/AmazonShippingShipmentProviderTests.cs @@ -0,0 +1,48 @@ +using EasyKeys.Shipping.Amazon.Shipment; +using EasyKeys.Shipping.Amazon.Shipment.Models; +using EasyKeys.Shipping.Stamps.Abstractions.Models; +using EasyKeys.Shipping.Stamps.Rates.Models; + +using EasyKeysShipping.FuncTest.TestHelpers; + +using Microsoft.Extensions.DependencyInjection; + +namespace EasyKeys.Shipping.FuncTest.Amazon; + +public class AmazonShippingShipmentProviderTests +{ + private readonly ITestOutputHelper _output; + private readonly IAmazonShippingShipmentProvider _shipmentProvider; + + public AmazonShippingShipmentProviderTests(ITestOutputHelper output) + { + _output = output; + _shipmentProvider = ServiceProviderInstance.GetAmazonServices(output).GetRequiredService(); + } + + [Fact] + public async Task Process_Domestic_Shipment_Successfully() + { + var (sender, recipient) = TestShipments.CreateContactInfo(); + + var shipmentDetails = new ShippingDetails(); + + shipmentDetails.Sender = sender; + shipmentDetails.Recipient = recipient; + + var rateOptions = new RateOptions() + { + Sender = sender, + Recipient = recipient, + ServiceType = StampsServiceType.Priority + }; + + var labels = await _shipmentProvider.CreateSmartShipmentAsync( + TestShipments.CreateDomesticShipment(), + shipmentDetails, + CancellationToken.None); + + Assert.NotNull(labels); + Assert.NotNull(labels.Labels[0].Bytes[0]); + } +} diff --git a/test/EasyKeys.Shipping.FuncTest/EasyKeys.Shipping.FuncTest.csproj b/test/EasyKeys.Shipping.FuncTest/EasyKeys.Shipping.FuncTest.csproj index 668f91e..18c18e2 100644 --- a/test/EasyKeys.Shipping.FuncTest/EasyKeys.Shipping.FuncTest.csproj +++ b/test/EasyKeys.Shipping.FuncTest/EasyKeys.Shipping.FuncTest.csproj @@ -31,6 +31,8 @@ + + diff --git a/test/EasyKeys.Shipping.FuncTest/TestHelpers/ServiceProviderInstance.cs b/test/EasyKeys.Shipping.FuncTest/TestHelpers/ServiceProviderInstance.cs index fbcf940..c1377a0 100644 --- a/test/EasyKeys.Shipping.FuncTest/TestHelpers/ServiceProviderInstance.cs +++ b/test/EasyKeys.Shipping.FuncTest/TestHelpers/ServiceProviderInstance.cs @@ -1,5 +1,7 @@ using Bet.Extensions.Testing.Logging; +using EasyKeys.Shipping.Amazon.Rates.DependencyInjection; +using EasyKeys.Shipping.Amazon.Shipment.DependencyInjection; using EasyKeys.Shipping.Stamps.Shipment.DependencyInjection; using EasyKeys.Shipping.Stamps.Tracking.DependencyInjection; @@ -10,6 +12,28 @@ namespace EasyKeysShipping.FuncTest.TestHelpers; public static class ServiceProviderInstance { + public static IServiceProvider GetAmazonServices(ITestOutputHelper output) + { + var services = new ServiceCollection(); + var dic = new Dictionary + { + { "AzureVault:BaseUrl", "https://easykeysshipping.vault.azure.net/" }, + { "AmazonShippingApiOptions:IsDevelopment", "true" } + }; + + var configBuilder = new ConfigurationBuilder().AddInMemoryCollection(dic); + configBuilder.AddAzureKeyVault(hostingEnviromentName: "Development", usePrefix: true); + Environment.SetEnvironmentVariable("DOTNET_ENVIRONMENT", "Development"); + services.AddLogging(x => x.AddXunit(output)); + + services.AddSingleton(configBuilder.Build()); + services.AddAmazonShippingClient(); + services.AddRestApiAmazonRateProvider(); + services.AddRestApiAmazonShipmentProvider(); + + return services.BuildServiceProvider(); + } + public static IServiceProvider GetFedExServices(ITestOutputHelper output) { var services = new ServiceCollection(); @@ -34,9 +58,11 @@ public static IServiceProvider GetFedExServices(ITestOutputHelper output) services.AddFedExTrackingProvider(); // adress validation apis + services.AddFedExApiClients(); services.AddRestApiFedExAddressValidationProvider(); services.AddRestApiFedExRateProvider(); services.AddRestApiFedExShipmentProvider(); + return services.BuildServiceProvider(); } diff --git a/test/EasyKeys.Shipping.FuncTest/TestHelpers/TestShipments.cs b/test/EasyKeys.Shipping.FuncTest/TestHelpers/TestShipments.cs index 34dc565..7361097 100644 --- a/test/EasyKeys.Shipping.FuncTest/TestHelpers/TestShipments.cs +++ b/test/EasyKeys.Shipping.FuncTest/TestHelpers/TestShipments.cs @@ -38,7 +38,7 @@ public static Shipment CreateDomesticShipment() }; var validatedAddress = new ValidateAddress(Guid.NewGuid().ToString(), destinationAddress); - var shipmentOptions = new ShipmentOptions(StampsPackageType.Package.Name, DateTime.Now); + var shipmentOptions = new ShipmentOptions(StampsPackageType.Package.Name, DateTime.Now.AddDays(1)); return new Shipment( originAddress, validatedAddress.ProposedAddress ?? validatedAddress.OriginalAddress,