├── .cr └── personal │ └── FavoritesList │ └── List.xml ├── .gitattributes ├── .gitignore ├── DigiKey.Api.ConsoleClient ├── OriginalCircuit.DigiKey.Api.ConsoleClient.csproj └── Program.cs ├── DigiKey.Api.OAuth2ConsoleClient ├── OriginalCircuit.DigiKey.Api.OAuth2ConsoleClient.csproj └── Program.cs ├── DigiKey.Api ├── BaseApi.cs ├── Client │ ├── ApiClient.cs │ ├── ApiException.cs │ ├── ApiResponse.cs │ ├── ExceptionFactory.cs │ ├── RateLimit.cs │ └── SwaggerDateConverter.cs ├── Configuration │ ├── ApiClientConfig.cs │ ├── ConfigurationHelper.cs │ ├── IApiClientConfigHelper.cs │ └── IConfigurationHelper.cs ├── DigiKey.Api.nuspec ├── Model │ ├── ApiErrorResponse.cs │ ├── ApiValidationError.cs │ ├── AssociatedProduct.cs │ ├── BasicProduct.cs │ ├── CategoriesResponse.cs │ ├── Category.cs │ ├── ChangeNotification.cs │ ├── DigiReelPricingDto.cs │ ├── Filters.cs │ ├── IsoSearchLocale.cs │ ├── KeywordSearchRequest.cs │ ├── KeywordSearchResponse.cs │ ├── KitPart.cs │ ├── LimitedParameter.cs │ ├── LimitedTaxonomy.cs │ ├── ManufacturerInfo.cs │ ├── ManufacturerProductDetailsRequest.cs │ ├── ManufacturersResponse.cs │ ├── MediaLinks.cs │ ├── PackageTypeByQuantityProduct.cs │ ├── PackageTypeByQuantityResponse.cs │ ├── ParametricFilter.cs │ ├── PcnResponse.cs │ ├── PidVid.cs │ ├── PriceBreak.cs │ ├── Product.cs │ ├── ProductDetails.cs │ ├── ProductDetailsResponse.cs │ ├── ProductTracingResponse.cs │ ├── ProductWithSuggestions.cs │ ├── RecommendedProduct.cs │ ├── RecommendedProductsCollection.cs │ ├── RecommendedProductsResponse.cs │ ├── SearchOption.cs │ ├── SortDirection.cs │ ├── SortOption.cs │ ├── SortParameters.cs │ └── ValuePair.cs ├── OAuth2 │ ├── Models │ │ ├── OAuth2AccessToken.cs │ │ └── OAuth2Error.cs │ ├── OAuth2Helpers.cs │ └── OAuth2Service.cs ├── OriginalCircuit.DigiKey.Api.csproj ├── PackageTypeByQuantityApi.cs ├── PartSearchApi.cs ├── PcnApi.cs ├── ProductTracingApi.cs ├── RecommendedProductsApi.cs ├── TaxonomyApi.cs └── packages.config ├── DigiKeyApi.sln ├── LICENSE ├── README.md ├── apiclient.config └── docs ├── ApiErrorResponse.md ├── ApiValidationError.md ├── AssociatedProduct.md ├── BasicProduct.md ├── CategoriesResponse.md ├── Category.md ├── ChangeNotification.md ├── DigiReelPricingDto.md ├── Filters.md ├── IsoSearchLocale.md ├── KeywordSearchRequest.md ├── KeywordSearchResponse.md ├── KitPart.md ├── LimitedParameter.md ├── LimitedTaxonomy.md ├── ManufacturerInfo.md ├── ManufacturerProductDetailsRequest.md ├── ManufacturersResponse.md ├── MediaLinks.md ├── PackageTypeByQuantityApi.md ├── PackageTypeByQuantityProduct.md ├── PackageTypeByQuantityResponse.md ├── ParametricFilter.md ├── PartSearchApi.md ├── PcnApi.md ├── PcnResponse.md ├── PidVid.md ├── PriceBreak.md ├── Product.md ├── ProductDetails.md ├── ProductDetailsResponse.md ├── ProductTracingApi.md ├── ProductTracingResponse.md ├── ProductWithSuggestions.md ├── RecommendedProduct.md ├── RecommendedProductsApi.md ├── RecommendedProductsCollection.md ├── RecommendedProductsResponse.md ├── SearchOption.md ├── SortDirection.md ├── SortOption.md ├── SortParameters.md ├── TaxonomyApi.md └── ValuePair.md /.cr/personal/FavoritesList/List.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ref: https://gist.github.com/kmorcinek/2710267 2 | # Download this file using PowerShell v3 under Windows with the following comand 3 | # Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore 4 | 5 | # User-specific files 6 | *.suo 7 | *.user 8 | *.sln.docstates 9 | ./nuget 10 | 11 | # Build results 12 | 13 | [Dd]ebug/ 14 | [Rr]elease/ 15 | x64/ 16 | build/ 17 | [Bb]in/ 18 | [Oo]bj/ 19 | 20 | # NuGet Packages 21 | *.nupkg 22 | # The packages folder can be ignored because of Package Restore 23 | **/packages/* 24 | # except build/, which is used as an MSBuild target. 25 | !**/packages/build/ 26 | # Uncomment if necessary however generally it will be regenerated when needed 27 | #!**/packages/repositories.config 28 | 29 | # MSTest test Results 30 | [Tt]est[Rr]esult*/ 31 | [Bb]uild[Ll]og.* 32 | 33 | *_i.c 34 | *_p.c 35 | *.ilk 36 | *.meta 37 | *.obj 38 | *.pch 39 | *.pdb 40 | *.pgc 41 | *.pgd 42 | *.rsp 43 | *.sbr 44 | *.tlb 45 | *.tli 46 | *.tlh 47 | *.tmp 48 | *.tmp_proj 49 | *.log 50 | *.vspscc 51 | *.vssscc 52 | .builds 53 | *.pidb 54 | *.log 55 | *.scc 56 | 57 | # OS generated files # 58 | .DS_Store* 59 | ehthumbs.db 60 | Icon? 61 | Thumbs.db 62 | 63 | # Visual C++ cache files 64 | ipch/ 65 | *.aps 66 | *.ncb 67 | *.opensdf 68 | *.sdf 69 | *.cachefile 70 | 71 | # Visual Studio profiler 72 | *.psess 73 | *.vsp 74 | *.vspx 75 | 76 | # Guidance Automation Toolkit 77 | *.gpState 78 | 79 | # ReSharper is a .NET coding add-in 80 | _ReSharper*/ 81 | *.[Rr]e[Ss]harper 82 | 83 | # TeamCity is a build add-in 84 | _TeamCity* 85 | 86 | # DotCover is a Code Coverage Tool 87 | *.dotCover 88 | 89 | # NCrunch 90 | *.ncrunch* 91 | .*crunch*.local.xml 92 | 93 | # Installshield output folder 94 | [Ee]xpress/ 95 | 96 | # DocProject is a documentation generator add-in 97 | DocProject/buildhelp/ 98 | DocProject/Help/*.HxT 99 | DocProject/Help/*.HxC 100 | DocProject/Help/*.hhc 101 | DocProject/Help/*.hhk 102 | DocProject/Help/*.hhp 103 | DocProject/Help/Html2 104 | DocProject/Help/html 105 | 106 | # Click-Once directory 107 | publish/ 108 | 109 | # Publish Web Output 110 | *.Publish.xml 111 | 112 | # Windows Azure Build Output 113 | csx 114 | *.build.csdef 115 | 116 | # Windows Store app package directory 117 | AppPackages/ 118 | 119 | # Others 120 | sql/ 121 | *.Cache 122 | ClientBin/ 123 | [Ss]tyle[Cc]op.* 124 | ~$* 125 | *~ 126 | *.dbmdl 127 | *.[Pp]ublish.xml 128 | *.pfx 129 | *.publishsettings 130 | modulesbin/ 131 | tempbin/ 132 | 133 | # EPiServer Site file (VPP) 134 | AppData/ 135 | 136 | # RIA/Silverlight projects 137 | Generated_Code/ 138 | 139 | # Backup & report files from converting an old project file to a newer 140 | # Visual Studio version. Backup files are not needed, because we have git ;-) 141 | _UpgradeReport_Files/ 142 | Backup*/ 143 | UpgradeLog*.XML 144 | UpgradeLog*.htm 145 | 146 | # vim 147 | *.txt~ 148 | *.swp 149 | *.swo 150 | 151 | # svn 152 | .svn 153 | 154 | # SQL Server files 155 | **/App_Data/*.mdf 156 | **/App_Data/*.ldf 157 | **/App_Data/*.sdf 158 | 159 | 160 | #LightSwitch generated files 161 | GeneratedArtifacts/ 162 | _Pvt_Extensions/ 163 | ModelManifest.xml 164 | 165 | # ========================= 166 | # Windows detritus 167 | # ========================= 168 | 169 | # Windows image file caches 170 | Thumbs.db 171 | ehthumbs.db 172 | 173 | # Folder config file 174 | Desktop.ini 175 | 176 | # Recycle Bin used on file shares 177 | $RECYCLE.BIN/ 178 | 179 | # Mac desktop service store files 180 | .DS_Store 181 | 182 | # SASS Compiler cache 183 | .sass-cache 184 | 185 | # Visual Studio 2014 CTP 186 | **/*.sln.ide 187 | 188 | 189 | .vs/* 190 | 191 | apiclient.config -------------------------------------------------------------------------------- /DigiKey.Api.ConsoleClient/OriginalCircuit.DigiKey.Api.ConsoleClient.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /DigiKey.Api.OAuth2ConsoleClient/OriginalCircuit.DigiKey.Api.OAuth2ConsoleClient.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /DigiKey.Api.OAuth2ConsoleClient/Program.cs: -------------------------------------------------------------------------------- 1 | using OriginalCircuit.DigiKey.Api.Configuration; 2 | using OriginalCircuit.DigiKey.Api.OAuth2; 3 | using System; 4 | using System.Diagnostics; 5 | using System.Net; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Web; 9 | 10 | namespace OriginalCircuit.DigiKey.Api.OAuth2ConsoleClient 11 | { 12 | class Program 13 | { 14 | static async Task Main(string[] args) 15 | { 16 | // This console client is strongly based on the ideas from Digi-Key's API OAuth2 client: 17 | // https://github.com/Digi-Key/ApiClient.V3 18 | 19 | var oAuth2Service = new OAuth2Service(); 20 | var authUrl = oAuth2Service.GenerateAuthUrl(""); 21 | 22 | var processInfo = new ProcessStartInfo(authUrl) { UseShellExecute = true }; 23 | Process.Start(processInfo); 24 | 25 | using (var httpListener = new HttpListener()) 26 | { 27 | var localUrl = ApiClientConfig.Instance.RedirectUri.EndsWith("/") ? ApiClientConfig.Instance.RedirectUri : ApiClientConfig.Instance.RedirectUri + "/"; 28 | httpListener.Prefixes.Add(localUrl); 29 | Console.WriteLine($"listening to {ApiClientConfig.Instance.RedirectUri}"); 30 | Console.WriteLine(); 31 | httpListener.Start(); 32 | 33 | var context = await httpListener.GetContextAsync(); 34 | HttpListenerResponse response = context.Response; 35 | 36 | var queryString = context.Request.Url.Query; 37 | var code = HttpUtility.ParseQueryString(queryString)["code"]; 38 | var result = await oAuth2Service.FinishAuthorization(code); 39 | 40 | if (result.IsError) 41 | { 42 | Console.WriteLine("Failed to retrieve token."); 43 | Console.WriteLine($"Error : {result.Error}"); 44 | Console.WriteLine($"Description: {result.ErrorDescription}"); 45 | 46 | await SendErrorResponse(response, result.Error, result.ErrorDescription); 47 | } 48 | else 49 | { 50 | ApiClientConfig.Instance.AccessToken = result.AccessToken; 51 | ApiClientConfig.Instance.RefreshToken = result.RefreshToken; 52 | ApiClientConfig.Instance.ExpirationDateTime = DateTime.Now.AddSeconds(result.ExpiresIn); 53 | 54 | Console.WriteLine("Successfully retrieved token!"); 55 | ApiClientConfig.Instance.Save(); 56 | 57 | Console.WriteLine("Token details saved."); 58 | 59 | await SendApiClientResponse(response); 60 | 61 | Console.WriteLine(); 62 | Console.WriteLine($"Access token : {result.AccessToken}"); 63 | Console.WriteLine($"Refresh token: {result.RefreshToken}"); 64 | Console.WriteLine($"Expires in : {result.ExpiresIn} seconds"); 65 | } 66 | 67 | httpListener.Stop(); 68 | } 69 | 70 | 71 | Console.WriteLine(); 72 | Console.WriteLine(); 73 | Console.WriteLine("Press [Any Key] to exit..."); 74 | Console.ReadKey(); 75 | } 76 | 77 | private static async Task SendErrorResponse(HttpListenerResponse response, string error, string description) 78 | { 79 | byte[] buffer = Encoding.UTF8.GetBytes( 80 | $"

Error During OAuth2


Error:{error}

Description:{description}

" 81 | ); 82 | 83 | response.ContentLength64 = buffer.Length; 84 | System.IO.Stream output = response.OutputStream; 85 | await output.WriteAsync(buffer, 0, buffer.Length); 86 | output.Close(); 87 | } 88 | 89 | 90 | private static async Task SendApiClientResponse(HttpListenerResponse response) 91 | { 92 | StringBuilder responseContent = new StringBuilder(); 93 | responseContent.AppendLine(""); 94 | responseContent.AppendLine(""); 95 | responseContent.AppendLine(" "); 96 | responseContent.AppendLine(" "); 97 | responseContent.AppendLine($" "); 98 | responseContent.AppendLine($" "); 99 | responseContent.AppendLine($" "); 100 | responseContent.AppendLine($" "); 101 | responseContent.AppendLine($" "); 102 | responseContent.AppendLine($" "); 103 | responseContent.AppendLine($" "); 104 | responseContent.AppendLine(" "); 105 | responseContent.AppendLine(""); 106 | HttpUtility.HtmlEncode(responseContent); 107 | 108 | byte[] buffer = Encoding.UTF8.GetBytes("

apiclient.config


" + HttpUtility.HtmlEncode(responseContent) + "
"); 109 | 110 | response.ContentLength64 = buffer.Length; 111 | System.IO.Stream output = response.OutputStream; 112 | await output.WriteAsync(buffer, 0, buffer.Length); 113 | output.Close(); 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /DigiKey.Api/BaseApi.cs: -------------------------------------------------------------------------------- 1 | using OriginalCircuit.DigiKey.Api.Client; 2 | using RestSharp; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | 6 | namespace OriginalCircuit.DigiKey.Api 7 | { 8 | public enum LocaleSite 9 | { 10 | US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH 11 | } 12 | 13 | public enum LocaleLanguage 14 | { 15 | EN, JA, DE, FR, KO, ZHS, ZHT, IT, ES, HE, NL, SV, PL, FI, DA, NO 16 | } 17 | 18 | public enum LocaleCurrency 19 | { 20 | USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP 21 | } 22 | 23 | public abstract class BaseApi 24 | { 25 | internal async Task MakeGetRequest(string path, Dictionary pathParams = null, 26 | List> queryParams = null, Dictionary headerParams = null) 27 | { 28 | if (headerParams == null) 29 | { 30 | headerParams = new Dictionary(); 31 | } 32 | 33 | headerParams.Add("accepts", "application/json, text/json"); 34 | 35 | // make the HTTP request 36 | return await ApiClient.Instance.CallApi(path, 37 | Method.Get, queryParams, null, headerParams, pathParams); 38 | } 39 | 40 | internal async Task MakePostRequest(string path, object body, Dictionary pathParams = null, 41 | List> queryParams = null, Dictionary headerParams = null) 42 | { 43 | if (headerParams == null) 44 | { 45 | headerParams = new Dictionary(); 46 | } 47 | 48 | headerParams.Add("accepts", "application/json, text/json"); 49 | 50 | // make the HTTP request 51 | return await ApiClient.Instance.CallApi(path, 52 | Method.Post, queryParams, body, headerParams, pathParams); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /DigiKey.Api/Client/ApiException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * PartSearch Api 3 | * 4 | * Search for products and retrieve details and pricing. 5 | * 6 | * OpenAPI spec version: v3 7 | * 8 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | */ 10 | 11 | using System; 12 | 13 | namespace OriginalCircuit.DigiKey.Api.Client 14 | { 15 | /// 16 | /// API Exception 17 | /// 18 | public class ApiException : Exception 19 | { 20 | /// 21 | /// Gets or sets the error code(HTTP status code) 22 | /// 23 | /// The error code(HTTP status code). 24 | public int ErrorCode { get; set; } 25 | 26 | /// 27 | /// Gets or sets the error content(body json object) 28 | /// 29 | /// The error content(Http response body). 30 | public dynamic ErrorContent { get; private set; } 31 | 32 | /// 33 | /// Initializes a new instance of the class. 34 | /// 35 | public ApiException() { } 36 | 37 | /// 38 | /// Initializes a new instance of the class. 39 | /// 40 | /// HTTP status code. 41 | /// Error message. 42 | public ApiException(int errorCode, string message) : base(message) 43 | { 44 | this.ErrorCode = errorCode; 45 | } 46 | 47 | /// 48 | /// Initializes a new instance of the class. 49 | /// 50 | /// HTTP status code. 51 | /// Error message. 52 | /// Error content. 53 | public ApiException(int errorCode, string message, dynamic errorContent = null) : base(message) 54 | { 55 | this.ErrorCode = errorCode; 56 | this.ErrorContent = errorContent; 57 | } 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /DigiKey.Api/Client/ApiResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace OriginalCircuit.DigiKey.Api.Client 4 | { 5 | /// 6 | /// API Response 7 | /// 8 | public class ApiResponse 9 | { 10 | /// 11 | /// Gets or sets the status code(HTTP status code) 12 | /// 13 | /// The status code. 14 | public int StatusCode { get; private set; } 15 | 16 | /// 17 | /// Gets or sets the HTTP headers 18 | /// 19 | /// HTTP headers 20 | public IDictionary Headers { get; private set; } 21 | 22 | /// 23 | /// Gets or sets the data(parsed HTTP body) 24 | /// 25 | /// The data. 26 | public T Data { get; private set; } 27 | 28 | /// 29 | /// Initializes a new instance of the class. 30 | /// 31 | /// HTTP status code. 32 | /// HTTP headers. 33 | /// Data(parsed HTTP body) 34 | public ApiResponse(int statusCode, IDictionary headers, T data) 35 | { 36 | this.StatusCode = statusCode; 37 | this.Headers = headers; 38 | this.Data = data; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /DigiKey.Api/Client/ExceptionFactory.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * PartSearch Api 3 | * 4 | * Search for products and retrieve details and pricing. 5 | * 6 | * OpenAPI spec version: v3 7 | * 8 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | */ 10 | 11 | 12 | using RestSharp; 13 | using System; 14 | 15 | namespace OriginalCircuit.DigiKey.Api.Client 16 | { 17 | /// 18 | /// A delegate to ExceptionFactory method 19 | /// 20 | /// Method name 21 | /// Response 22 | /// Exceptions 23 | public delegate Exception ExceptionFactory(string methodName, RestResponse response); 24 | } 25 | -------------------------------------------------------------------------------- /DigiKey.Api/Client/RateLimit.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | namespace OriginalCircuit.DigiKey.Api.Client 5 | { 6 | public class RateLimit 7 | { 8 | public RateLimit(int retryAfter, int limit, int remaining, int reset, DateTime resetTime) 9 | { 10 | RetryAfter = retryAfter; 11 | Limit = limit; 12 | Remaining = remaining; 13 | Reset = reset; 14 | ResetTime = resetTime; 15 | } 16 | 17 | /// 18 | /// The seconds until you can retry the request 19 | /// 20 | public int RetryAfter { get; set; } 21 | /// 22 | /// The number of milliseconds until you can retry the request 23 | /// 24 | public int RetryAfterMilliseconds { get { return RetryAfter * 1000; } } 25 | /// 26 | /// The maximum number of requests allowed for the API, number per minute 27 | /// 28 | public int Limit { get; set; } 29 | /// 30 | /// The number of requests remaining in the current rate limit window. 31 | /// 32 | public int Remaining { get; set; } 33 | /// 34 | /// The seconds until the burst limit window resets 35 | /// 36 | public int Reset { get; set; } 37 | /// 38 | /// The number of milliseconds until the burst limit window resets 39 | /// 40 | public int ResetMilliseconds { get { return Reset * 1000; } } 41 | /// 42 | /// The time when the burst limit window resets 43 | /// 44 | public DateTime ResetTime { get; set; } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /DigiKey.Api/Client/SwaggerDateConverter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * PartSearch Api 3 | * 4 | * Search for products and retrieve details and pricing. 5 | * 6 | * OpenAPI spec version: v3 7 | * 8 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | */ 10 | 11 | using Newtonsoft.Json.Converters; 12 | 13 | namespace OriginalCircuit.DigiKey.Api.Client 14 | { 15 | /// 16 | /// Formatter for 'date' swagger formats ss defined by full-date - RFC3339 17 | /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types 18 | /// 19 | public class SwaggerDateConverter : IsoDateTimeConverter 20 | { 21 | /// 22 | /// Initializes a new instance of the class. 23 | /// 24 | public SwaggerDateConverter() 25 | { 26 | // full-date = date-fullyear "-" date-month "-" date-mday 27 | DateTimeFormat = "yyyy-MM-dd"; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /DigiKey.Api/Configuration/ApiClientConfig.cs: -------------------------------------------------------------------------------- 1 | using OriginalCircuit.DigiKey.Api.Client; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Configuration; 5 | using System.Globalization; 6 | using System.IO; 7 | using System.Text.RegularExpressions; 8 | 9 | namespace OriginalCircuit.DigiKey.Api.Configuration 10 | { 11 | public class ApiClientConfig : ConfigurationHelper, IApiClientConfigHelper 12 | { 13 | private static Lazy lazy = new Lazy(() => new ApiClientConfig()); 14 | private static IApiClientConfigHelper userSet; 15 | 16 | private const string clientId = "ApiClient.ClientId"; 17 | private const string clientSecret = "ApiClient.ClientSecret"; 18 | private const string redirectUri = "ApiClient.RedirectUri"; 19 | private const string accessToken = "ApiClient.AccessToken"; 20 | private const string refreshToken = "ApiClient.RefreshToken"; 21 | private const string expirationDateTime = "ApiClient.ExpirationDateTime"; 22 | private const string baseAddress = "ApiClient.BaseAddress"; 23 | 24 | private ApiClientConfig() 25 | { 26 | try 27 | { 28 | var baseDir = AppDomain.CurrentDomain.BaseDirectory.TrimEnd('\\'); 29 | List searchPaths = new List(); 30 | searchPaths.Add(baseDir); 31 | searchPaths.Add(Environment.CurrentDirectory); 32 | searchPaths.Add(Directory.GetCurrentDirectory()); 33 | searchPaths.Add(Directory.GetParent(baseDir).FullName); 34 | searchPaths.Add(Directory.GetParent(baseDir).Parent.Parent.FullName); 35 | ///DigiKeyApi\OriginalCircuit.DigiKey.Api.ConsoleClient\bin\Debug\netcoreapp3.1\ 36 | searchPaths.Add(Directory.GetParent(baseDir).Parent.Parent.Parent.FullName); 37 | 38 | string apiConfigPath = null; 39 | 40 | foreach (var path in searchPaths) 41 | { 42 | try // some paths may be restricted access on production servers 43 | { 44 | if (File.Exists(Path.Combine(path, "apiclient.config"))) 45 | { 46 | apiConfigPath = Path.Combine(path, "apiclient.config"); 47 | break; 48 | } 49 | } 50 | finally 51 | { } 52 | } 53 | 54 | if (apiConfigPath == null) 55 | { 56 | throw new ApiException(0, $"Unable to locate apiclient.config in the search paths"); 57 | } 58 | 59 | var map = new ExeConfigurationFileMap 60 | { 61 | ExeConfigFilename = apiConfigPath 62 | }; 63 | Console.WriteLine($"map.ExeConfigFilename {map.ExeConfigFilename}"); 64 | config = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None); 65 | } 66 | catch (System.Exception ex) 67 | { 68 | throw new ApiException(0, $"Error in ApiClientConfigHelper on opening up apiclient.config {ex.Message}"); 69 | } 70 | } 71 | 72 | public static IApiClientConfigHelper Instance 73 | { 74 | get 75 | { 76 | if (userSet != null) 77 | return userSet; 78 | 79 | // default if instance is not set 80 | return lazy.Value; 81 | } 82 | set 83 | { 84 | userSet = value; 85 | } 86 | } 87 | 88 | public static string TokenEndpoint => "/v1/oauth2/token"; 89 | public static string AuthorizationEndpoint => "/v1/oauth2/authorize"; 90 | 91 | /// 92 | /// ClientId for ApiClient usage 93 | /// 94 | public string ClientId 95 | { 96 | get { return GetAttribute(clientId); } 97 | set { Update(clientId, value); } 98 | } 99 | 100 | /// 101 | /// ClientSecret for ApiClient usage 102 | /// 103 | public string ClientSecret 104 | { 105 | get { return GetAttribute(clientSecret); } 106 | set { Update(clientSecret, value); } 107 | } 108 | 109 | /// 110 | /// RedirectUri for ApiClient usage 111 | /// 112 | public string RedirectUri 113 | { 114 | get { return GetAttribute(redirectUri); } 115 | set { Update(redirectUri, value); } 116 | } 117 | 118 | /// 119 | /// AccessToken for ApiClient usage 120 | /// 121 | public string AccessToken 122 | { 123 | get { return GetAttribute(accessToken); } 124 | set { Update(accessToken, value); } 125 | } 126 | 127 | /// 128 | /// RefreshToken for ApiClient usage 129 | /// 130 | public string RefreshToken 131 | { 132 | get { return GetAttribute(refreshToken); } 133 | set { Update(refreshToken, value); } 134 | } 135 | 136 | /// 137 | /// Client for ApiClient usage 138 | /// 139 | public DateTime ExpirationDateTime 140 | { 141 | get 142 | { 143 | var dateTime = GetAttribute(expirationDateTime); 144 | if (string.IsNullOrEmpty(dateTime)) 145 | { 146 | return DateTime.MinValue; 147 | } 148 | return DateTime.Parse(dateTime, null, DateTimeStyles.RoundtripKind); 149 | } 150 | set 151 | { 152 | var dateTime = value.ToString("o"); // "o" is "roundtrip" 153 | Update(expirationDateTime, dateTime); 154 | } 155 | } 156 | 157 | public string BaseAddress 158 | { 159 | get { return GetAttribute(baseAddress); } 160 | set { Update(baseAddress, value); } 161 | } 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /DigiKey.Api/Configuration/ConfigurationHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Configuration; 3 | using System.Diagnostics; 4 | using System.Diagnostics.CodeAnalysis; 5 | 6 | namespace OriginalCircuit.DigiKey.Api.Configuration 7 | { 8 | 9 | /// 10 | /// Helper class that wraps up working with System.Configuration.Configuration 11 | /// 12 | [ExcludeFromCodeCoverage] 13 | public class ConfigurationHelper : IConfigurationHelper 14 | { 15 | /// 16 | /// This object represents the config file 17 | /// 18 | protected System.Configuration.Configuration config; 19 | 20 | /// 21 | /// Updates the value for the specified key in the AppSettings of the Config file. 22 | /// 23 | /// The key. 24 | /// The value. 25 | public void Update(string key, string value) 26 | { 27 | if (config.AppSettings.Settings[key] == null) 28 | { 29 | config.AppSettings.Settings.Add(key, value); 30 | } 31 | else 32 | { 33 | config.AppSettings.Settings[key].Value = value; 34 | } 35 | } 36 | 37 | /// 38 | /// Gets the attribute or value of the key. 39 | /// 40 | /// Name of the attribute. 41 | /// string value of attribute 42 | public string GetAttribute(string attrName) 43 | { 44 | try 45 | { 46 | return config.AppSettings.Settings[attrName] == null 47 | ? null 48 | : config.AppSettings.Settings[attrName].Value; 49 | } 50 | catch (System.Exception) 51 | { 52 | return null; 53 | } 54 | } 55 | 56 | /// 57 | /// Gets the boolean attribute or value. 58 | /// 59 | /// Name of the attribute. 60 | /// true of false 61 | public bool GetBooleanAttribute(string attrName) 62 | { 63 | try 64 | { 65 | var value = GetAttribute(attrName); 66 | return value != null && Convert.ToBoolean(value); 67 | } 68 | catch (System.Exception) 69 | { 70 | return false; 71 | } 72 | } 73 | 74 | /// 75 | /// Saves this instance. 76 | /// 77 | public void Save() 78 | { 79 | try 80 | { 81 | config.Save(ConfigurationSaveMode.Full); 82 | ConfigurationManager.RefreshSection("appSettings"); 83 | } 84 | catch (System.Exception ex) 85 | { 86 | #if DEBUG 87 | Debug.WriteLine($"Exception Message {ex.Message}"); 88 | #endif 89 | throw; 90 | } 91 | } 92 | 93 | /// 94 | /// Refreshes the application settings. 95 | /// 96 | public void RefreshAppSettings() 97 | { 98 | ConfigurationManager.RefreshSection("appSettings"); 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /DigiKey.Api/Configuration/IApiClientConfigHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace OriginalCircuit.DigiKey.Api.Configuration 4 | { 5 | public interface IApiClientConfigHelper 6 | { 7 | /// 8 | /// ClientId for ApiClient Usage 9 | /// 10 | string ClientId { get; set; } 11 | 12 | /// 13 | /// ClientSecret for ApiClient Usage 14 | /// 15 | string ClientSecret { get; set; } 16 | 17 | /// 18 | /// RedirectUri for ApiClient Usage 19 | /// 20 | string RedirectUri { get; set; } 21 | 22 | /// 23 | /// AccessToken for ApiClient Usage 24 | /// 25 | string AccessToken { get; set; } 26 | 27 | /// 28 | /// RefreshToken for ApiClient Usage 29 | /// 30 | string RefreshToken { get; set; } 31 | 32 | /// 33 | /// ExpirationDateTime for ApiClient Usage 34 | /// 35 | DateTime ExpirationDateTime { get; set; } 36 | 37 | string BaseAddress { get; set; } 38 | 39 | void Save(); 40 | 41 | void RefreshAppSettings(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /DigiKey.Api/Configuration/IConfigurationHelper.cs: -------------------------------------------------------------------------------- 1 | namespace OriginalCircuit.DigiKey.Api.Configuration 2 | { 3 | public interface IConfigurationHelper 4 | { 5 | /// 6 | /// Updates the value for the specified key in the AppSettings of the Config file. 7 | /// 8 | /// The key. 9 | /// The value. 10 | void Update(string key, string value); 11 | 12 | /// 13 | /// Gets the attribute or value of the key. 14 | /// 15 | /// Name of the attribute. 16 | /// string value of attribute 17 | string GetAttribute(string attrName); 18 | 19 | /// 20 | /// Gets the boolean attribute or value. 21 | /// 22 | /// Name of the attribute. 23 | /// true or false 24 | bool GetBooleanAttribute(string attrName); 25 | 26 | /// 27 | /// Saves changes to the Config file 28 | /// 29 | void Save(); 30 | 31 | /// 32 | /// Refreshes the application settingses. 33 | /// 34 | void RefreshAppSettings(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /DigiKey.Api/DigiKey.Api.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $id$ 6 | Digi-Key API V3 7 | 8 | 9 | $version$ 10 | 11 | 12 | $author$ 13 | 14 | 16 | $author$ 17 | false 18 | false 19 | 20 | 22 | Digi-Key API Client by Issus on GitHub 23 | https://www.digikey.com/en/terms-and-conditions 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /DigiKey.Api/Model/ApiValidationError.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.Runtime.Serialization; 6 | using System.Text; 7 | 8 | 9 | namespace OriginalCircuit.DigiKey.Api.Model 10 | { 11 | /// 12 | /// Error with API input. 13 | /// 14 | [DataContract] 15 | public partial class ApiValidationError : IEquatable, IValidatableObject 16 | { 17 | /// 18 | /// Initializes a new instance of the class. 19 | /// 20 | /// The field that generated the error.. 21 | /// The error message that was generated. This often explains how to fix your API input to be valid.. 22 | public ApiValidationError(string field = default(string), string message = default(string)) 23 | { 24 | this.Field = field; 25 | this.Message = message; 26 | } 27 | 28 | /// 29 | /// The field that generated the error. 30 | /// 31 | /// The field that generated the error. 32 | [DataMember(Name = "Field", EmitDefaultValue = false)] 33 | public string Field { get; set; } 34 | 35 | /// 36 | /// The error message that was generated. This often explains how to fix your API input to be valid. 37 | /// 38 | /// The error message that was generated. This often explains how to fix your API input to be valid. 39 | [DataMember(Name = "Message", EmitDefaultValue = false)] 40 | public string Message { get; set; } 41 | 42 | /// 43 | /// Returns the string presentation of the object 44 | /// 45 | /// string presentation of the object 46 | public override string ToString() 47 | { 48 | var sb = new StringBuilder(); 49 | sb.Append("class ApiValidationError {\n"); 50 | sb.Append(" Field: ").Append(Field).Append("\n"); 51 | sb.Append(" Message: ").Append(Message).Append("\n"); 52 | sb.Append("}\n"); 53 | return sb.ToString(); 54 | } 55 | 56 | /// 57 | /// Returns the JSON string presentation of the object 58 | /// 59 | /// JSON string presentation of the object 60 | public virtual string ToJson() 61 | { 62 | return JsonConvert.SerializeObject(this, Formatting.Indented); 63 | } 64 | 65 | /// 66 | /// Returns true if objects are equal 67 | /// 68 | /// Object to be compared 69 | /// Boolean 70 | public override bool Equals(object input) 71 | { 72 | return this.Equals(input as ApiValidationError); 73 | } 74 | 75 | /// 76 | /// Returns true if ApiValidationError instances are equal 77 | /// 78 | /// Instance of ApiValidationError to be compared 79 | /// Boolean 80 | public bool Equals(ApiValidationError input) 81 | { 82 | if (input == null) 83 | return false; 84 | 85 | return 86 | ( 87 | this.Field == input.Field || 88 | (this.Field != null && 89 | this.Field.Equals(input.Field)) 90 | ) && 91 | ( 92 | this.Message == input.Message || 93 | (this.Message != null && 94 | this.Message.Equals(input.Message)) 95 | ); 96 | } 97 | 98 | /// 99 | /// Gets the hash code 100 | /// 101 | /// Hash code 102 | public override int GetHashCode() 103 | { 104 | unchecked // Overflow is fine, just wrap 105 | { 106 | int hashCode = 41; 107 | if (this.Field != null) 108 | hashCode = hashCode * 59 + this.Field.GetHashCode(); 109 | if (this.Message != null) 110 | hashCode = hashCode * 59 + this.Message.GetHashCode(); 111 | return hashCode; 112 | } 113 | } 114 | 115 | /// 116 | /// To validate all properties of the instance 117 | /// 118 | /// Validation context 119 | /// Validation Result 120 | IEnumerable IValidatableObject.Validate(ValidationContext validationContext) 121 | { 122 | yield break; 123 | } 124 | } 125 | 126 | } 127 | -------------------------------------------------------------------------------- /DigiKey.Api/Model/CategoriesResponse.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * PartSearch Api 3 | * 4 | * Search for products and retrieve details and pricing. 5 | * 6 | * OpenAPI spec version: v3 7 | * 8 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | */ 10 | 11 | using Newtonsoft.Json; 12 | using System; 13 | using System.Collections.Generic; 14 | using System.ComponentModel.DataAnnotations; 15 | using System.Linq; 16 | using System.Runtime.Serialization; 17 | using System.Text; 18 | 19 | 20 | namespace OriginalCircuit.DigiKey.Api.Model 21 | { 22 | /// 23 | /// Response model for Categories call. 24 | /// 25 | [DataContract] 26 | public partial class CategoriesResponse : IEquatable, IValidatableObject 27 | { 28 | /// 29 | /// Initializes a new instance of the class. 30 | /// 31 | /// Count of Products. 32 | /// List of Categories. 33 | public CategoriesResponse(int? productCount = default(int?), List categories = default(List)) 34 | { 35 | this.ProductCount = productCount; 36 | this.Categories = categories; 37 | } 38 | 39 | /// 40 | /// Count of Products 41 | /// 42 | /// Count of Products 43 | [DataMember(Name = "ProductCount", EmitDefaultValue = false)] 44 | public int? ProductCount { get; set; } 45 | 46 | /// 47 | /// List of Categories 48 | /// 49 | /// List of Categories 50 | [DataMember(Name = "Categories", EmitDefaultValue = false)] 51 | public List Categories { get; set; } 52 | 53 | /// 54 | /// Returns the string presentation of the object 55 | /// 56 | /// string presentation of the object 57 | public override string ToString() 58 | { 59 | var sb = new StringBuilder(); 60 | sb.Append("class CategoriesResponse {\n"); 61 | sb.Append(" ProductCount: ").Append(ProductCount).Append("\n"); 62 | sb.Append(" Categories: ").Append(Categories).Append("\n"); 63 | sb.Append("}\n"); 64 | return sb.ToString(); 65 | } 66 | 67 | /// 68 | /// Returns the JSON string presentation of the object 69 | /// 70 | /// JSON string presentation of the object 71 | public virtual string ToJson() 72 | { 73 | return JsonConvert.SerializeObject(this, Formatting.Indented); 74 | } 75 | 76 | /// 77 | /// Returns true if objects are equal 78 | /// 79 | /// Object to be compared 80 | /// Boolean 81 | public override bool Equals(object input) 82 | { 83 | return this.Equals(input as CategoriesResponse); 84 | } 85 | 86 | /// 87 | /// Returns true if CategoriesResponse instances are equal 88 | /// 89 | /// Instance of CategoriesResponse to be compared 90 | /// Boolean 91 | public bool Equals(CategoriesResponse input) 92 | { 93 | if (input == null) 94 | return false; 95 | 96 | return 97 | ( 98 | this.ProductCount == input.ProductCount || 99 | (this.ProductCount != null && 100 | this.ProductCount.Equals(input.ProductCount)) 101 | ) && 102 | ( 103 | this.Categories == input.Categories || 104 | this.Categories != null && 105 | this.Categories.SequenceEqual(input.Categories) 106 | ); 107 | } 108 | 109 | /// 110 | /// Gets the hash code 111 | /// 112 | /// Hash code 113 | public override int GetHashCode() 114 | { 115 | unchecked // Overflow is fine, just wrap 116 | { 117 | int hashCode = 41; 118 | if (this.ProductCount != null) 119 | hashCode = hashCode * 59 + this.ProductCount.GetHashCode(); 120 | if (this.Categories != null) 121 | hashCode = hashCode * 59 + this.Categories.GetHashCode(); 122 | return hashCode; 123 | } 124 | } 125 | 126 | /// 127 | /// To validate all properties of the instance 128 | /// 129 | /// Validation context 130 | /// Validation Result 131 | IEnumerable IValidatableObject.Validate(ValidationContext validationContext) 132 | { 133 | yield break; 134 | } 135 | } 136 | 137 | } 138 | -------------------------------------------------------------------------------- /DigiKey.Api/Model/KitPart.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * PartSearch Api 3 | * 4 | * Search for products and retrieve details and pricing. 5 | * 6 | * OpenAPI spec version: v3 7 | * 8 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | */ 10 | 11 | using Newtonsoft.Json; 12 | using System; 13 | using System.Collections.Generic; 14 | using System.ComponentModel.DataAnnotations; 15 | using System.Runtime.Serialization; 16 | using System.Text; 17 | 18 | 19 | namespace OriginalCircuit.DigiKey.Api.Model 20 | { 21 | /// 22 | /// Product contained within a Kit. 23 | /// 24 | [DataContract] 25 | public partial class KitPart : IEquatable, IValidatableObject 26 | { 27 | /// 28 | /// Initializes a new instance of the class. 29 | /// 30 | /// associatedProduct. 31 | /// Number of the product in the Kit.. 32 | public KitPart(AssociatedProduct associatedProduct = default(AssociatedProduct), int? kitPartQuantity = default(int?)) 33 | { 34 | this.AssociatedProduct = associatedProduct; 35 | this.KitPartQuantity = kitPartQuantity; 36 | } 37 | 38 | /// 39 | /// Gets or Sets AssociatedProduct 40 | /// 41 | [DataMember(Name = "AssociatedProduct", EmitDefaultValue = false)] 42 | public AssociatedProduct AssociatedProduct { get; set; } 43 | 44 | /// 45 | /// Number of the product in the Kit. 46 | /// 47 | /// Number of the product in the Kit. 48 | [DataMember(Name = "KitPartQuantity", EmitDefaultValue = false)] 49 | public int? KitPartQuantity { get; set; } 50 | 51 | /// 52 | /// Returns the string presentation of the object 53 | /// 54 | /// string presentation of the object 55 | public override string ToString() 56 | { 57 | var sb = new StringBuilder(); 58 | sb.Append("class KitPart {\n"); 59 | sb.Append(" AssociatedProduct: ").Append(AssociatedProduct).Append("\n"); 60 | sb.Append(" KitPartQuantity: ").Append(KitPartQuantity).Append("\n"); 61 | sb.Append("}\n"); 62 | return sb.ToString(); 63 | } 64 | 65 | /// 66 | /// Returns the JSON string presentation of the object 67 | /// 68 | /// JSON string presentation of the object 69 | public virtual string ToJson() 70 | { 71 | return JsonConvert.SerializeObject(this, Formatting.Indented); 72 | } 73 | 74 | /// 75 | /// Returns true if objects are equal 76 | /// 77 | /// Object to be compared 78 | /// Boolean 79 | public override bool Equals(object input) 80 | { 81 | return this.Equals(input as KitPart); 82 | } 83 | 84 | /// 85 | /// Returns true if KitPart instances are equal 86 | /// 87 | /// Instance of KitPart to be compared 88 | /// Boolean 89 | public bool Equals(KitPart input) 90 | { 91 | if (input == null) 92 | return false; 93 | 94 | return 95 | ( 96 | this.AssociatedProduct == input.AssociatedProduct || 97 | (this.AssociatedProduct != null && 98 | this.AssociatedProduct.Equals(input.AssociatedProduct)) 99 | ) && 100 | ( 101 | this.KitPartQuantity == input.KitPartQuantity || 102 | (this.KitPartQuantity != null && 103 | this.KitPartQuantity.Equals(input.KitPartQuantity)) 104 | ); 105 | } 106 | 107 | /// 108 | /// Gets the hash code 109 | /// 110 | /// Hash code 111 | public override int GetHashCode() 112 | { 113 | unchecked // Overflow is fine, just wrap 114 | { 115 | int hashCode = 41; 116 | if (this.AssociatedProduct != null) 117 | hashCode = hashCode * 59 + this.AssociatedProduct.GetHashCode(); 118 | if (this.KitPartQuantity != null) 119 | hashCode = hashCode * 59 + this.KitPartQuantity.GetHashCode(); 120 | return hashCode; 121 | } 122 | } 123 | 124 | /// 125 | /// To validate all properties of the instance 126 | /// 127 | /// Validation context 128 | /// Validation Result 129 | IEnumerable IValidatableObject.Validate(ValidationContext validationContext) 130 | { 131 | yield break; 132 | } 133 | } 134 | 135 | } 136 | -------------------------------------------------------------------------------- /DigiKey.Api/Model/LimitedParameter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * PartSearch Api 3 | * 4 | * Search for products and retrieve details and pricing. 5 | * 6 | * OpenAPI spec version: v3 7 | * 8 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | */ 10 | 11 | using Newtonsoft.Json; 12 | using System; 13 | using System.Collections.Generic; 14 | using System.ComponentModel.DataAnnotations; 15 | using System.Linq; 16 | using System.Runtime.Serialization; 17 | using System.Text; 18 | 19 | 20 | namespace OriginalCircuit.DigiKey.Api.Model 21 | { 22 | /// 23 | /// Parameters for filtering that are limited to parameters for the products in the response. 24 | /// 25 | [DataContract] 26 | public partial class LimitedParameter : IEquatable, IValidatableObject 27 | { 28 | /// 29 | /// Initializes a new instance of the class. 30 | /// 31 | /// List of values for the parameter that are contained in the products.. 32 | /// The Id of the parameter.. 33 | /// The name of the parameter.. 34 | public LimitedParameter(List values = default(List), int? parameterId = default(int?), string _parameter = default(string)) 35 | { 36 | this.Values = values; 37 | this.ParameterId = parameterId; 38 | this.Parameter = _parameter; 39 | } 40 | 41 | /// 42 | /// List of values for the parameter that are contained in the products. 43 | /// 44 | /// List of values for the parameter that are contained in the products. 45 | [DataMember(Name = "Values", EmitDefaultValue = false)] 46 | public List Values { get; set; } 47 | 48 | /// 49 | /// The Id of the parameter. 50 | /// 51 | /// The Id of the parameter. 52 | [DataMember(Name = "ParameterId", EmitDefaultValue = false)] 53 | public int? ParameterId { get; set; } 54 | 55 | /// 56 | /// The name of the parameter. 57 | /// 58 | /// The name of the parameter. 59 | [DataMember(Name = "Parameter", EmitDefaultValue = false)] 60 | public string Parameter { get; set; } 61 | 62 | /// 63 | /// Returns the string presentation of the object 64 | /// 65 | /// string presentation of the object 66 | public override string ToString() 67 | { 68 | var sb = new StringBuilder(); 69 | sb.Append("class LimitedParameter {\n"); 70 | sb.Append(" Values: ").Append(Values).Append("\n"); 71 | sb.Append(" ParameterId: ").Append(ParameterId).Append("\n"); 72 | sb.Append(" Parameter: ").Append(Parameter).Append("\n"); 73 | sb.Append("}\n"); 74 | return sb.ToString(); 75 | } 76 | 77 | /// 78 | /// Returns the JSON string presentation of the object 79 | /// 80 | /// JSON string presentation of the object 81 | public virtual string ToJson() 82 | { 83 | return JsonConvert.SerializeObject(this, Formatting.Indented); 84 | } 85 | 86 | /// 87 | /// Returns true if objects are equal 88 | /// 89 | /// Object to be compared 90 | /// Boolean 91 | public override bool Equals(object input) 92 | { 93 | return this.Equals(input as LimitedParameter); 94 | } 95 | 96 | /// 97 | /// Returns true if LimitedParameter instances are equal 98 | /// 99 | /// Instance of LimitedParameter to be compared 100 | /// Boolean 101 | public bool Equals(LimitedParameter input) 102 | { 103 | if (input == null) 104 | return false; 105 | 106 | return 107 | ( 108 | this.Values == input.Values || 109 | this.Values != null && 110 | this.Values.SequenceEqual(input.Values) 111 | ) && 112 | ( 113 | this.ParameterId == input.ParameterId || 114 | (this.ParameterId != null && 115 | this.ParameterId.Equals(input.ParameterId)) 116 | ) && 117 | ( 118 | this.Parameter == input.Parameter || 119 | (this.Parameter != null && 120 | this.Parameter.Equals(input.Parameter)) 121 | ); 122 | } 123 | 124 | /// 125 | /// Gets the hash code 126 | /// 127 | /// Hash code 128 | public override int GetHashCode() 129 | { 130 | unchecked // Overflow is fine, just wrap 131 | { 132 | int hashCode = 41; 133 | if (this.Values != null) 134 | hashCode = hashCode * 59 + this.Values.GetHashCode(); 135 | if (this.ParameterId != null) 136 | hashCode = hashCode * 59 + this.ParameterId.GetHashCode(); 137 | if (this.Parameter != null) 138 | hashCode = hashCode * 59 + this.Parameter.GetHashCode(); 139 | return hashCode; 140 | } 141 | } 142 | 143 | /// 144 | /// To validate all properties of the instance 145 | /// 146 | /// Validation context 147 | /// Validation Result 148 | IEnumerable IValidatableObject.Validate(ValidationContext validationContext) 149 | { 150 | yield break; 151 | } 152 | } 153 | 154 | } 155 | -------------------------------------------------------------------------------- /DigiKey.Api/Model/ManufacturerInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * PartSearch Api 3 | * 4 | * Search for products and retrieve details and pricing. 5 | * 6 | * OpenAPI spec version: v3 7 | * 8 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | */ 10 | 11 | using Newtonsoft.Json; 12 | using System; 13 | using System.Collections.Generic; 14 | using System.ComponentModel.DataAnnotations; 15 | using System.Runtime.Serialization; 16 | using System.Text; 17 | 18 | 19 | namespace OriginalCircuit.DigiKey.Api.Model 20 | { 21 | /// 22 | /// Response class for Manufacturer information which include and id and name. 23 | /// 24 | [DataContract] 25 | public partial class ManufacturerInfo : IEquatable, IValidatableObject 26 | { 27 | /// 28 | /// Initializes a new instance of the class. 29 | /// 30 | /// Internal Id for the manufacturer. 31 | /// Name of the manufacturer. 32 | public ManufacturerInfo(int? id = default(int?), string name = default(string)) 33 | { 34 | this.Id = id; 35 | this.Name = name; 36 | } 37 | 38 | /// 39 | /// Internal Id for the manufacturer 40 | /// 41 | /// Internal Id for the manufacturer 42 | [DataMember(Name = "Id", EmitDefaultValue = false)] 43 | public int? Id { get; set; } 44 | 45 | /// 46 | /// Name of the manufacturer 47 | /// 48 | /// Name of the manufacturer 49 | [DataMember(Name = "Name", EmitDefaultValue = false)] 50 | public string Name { get; set; } 51 | 52 | /// 53 | /// Returns the string presentation of the object 54 | /// 55 | /// string presentation of the object 56 | public override string ToString() 57 | { 58 | var sb = new StringBuilder(); 59 | sb.Append("class ManufacturerInfo {\n"); 60 | sb.Append(" Id: ").Append(Id).Append("\n"); 61 | sb.Append(" Name: ").Append(Name).Append("\n"); 62 | sb.Append("}\n"); 63 | return sb.ToString(); 64 | } 65 | 66 | /// 67 | /// Returns the JSON string presentation of the object 68 | /// 69 | /// JSON string presentation of the object 70 | public virtual string ToJson() 71 | { 72 | return JsonConvert.SerializeObject(this, Formatting.Indented); 73 | } 74 | 75 | /// 76 | /// Returns true if objects are equal 77 | /// 78 | /// Object to be compared 79 | /// Boolean 80 | public override bool Equals(object input) 81 | { 82 | return this.Equals(input as ManufacturerInfo); 83 | } 84 | 85 | /// 86 | /// Returns true if ManufacturerInfo instances are equal 87 | /// 88 | /// Instance of ManufacturerInfo to be compared 89 | /// Boolean 90 | public bool Equals(ManufacturerInfo input) 91 | { 92 | if (input == null) 93 | return false; 94 | 95 | return 96 | ( 97 | this.Id == input.Id || 98 | (this.Id != null && 99 | this.Id.Equals(input.Id)) 100 | ) && 101 | ( 102 | this.Name == input.Name || 103 | (this.Name != null && 104 | this.Name.Equals(input.Name)) 105 | ); 106 | } 107 | 108 | /// 109 | /// Gets the hash code 110 | /// 111 | /// Hash code 112 | public override int GetHashCode() 113 | { 114 | unchecked // Overflow is fine, just wrap 115 | { 116 | int hashCode = 41; 117 | if (this.Id != null) 118 | hashCode = hashCode * 59 + this.Id.GetHashCode(); 119 | if (this.Name != null) 120 | hashCode = hashCode * 59 + this.Name.GetHashCode(); 121 | return hashCode; 122 | } 123 | } 124 | 125 | /// 126 | /// To validate all properties of the instance 127 | /// 128 | /// Validation context 129 | /// Validation Result 130 | IEnumerable IValidatableObject.Validate(ValidationContext validationContext) 131 | { 132 | yield break; 133 | } 134 | } 135 | 136 | } 137 | -------------------------------------------------------------------------------- /DigiKey.Api/Model/ManufacturersResponse.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * PartSearch Api 3 | * 4 | * Search for products and retrieve details and pricing. 5 | * 6 | * OpenAPI spec version: v3 7 | * 8 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | */ 10 | 11 | using Newtonsoft.Json; 12 | using System; 13 | using System.Collections.Generic; 14 | using System.ComponentModel.DataAnnotations; 15 | using System.Linq; 16 | using System.Runtime.Serialization; 17 | using System.Text; 18 | 19 | 20 | namespace OriginalCircuit.DigiKey.Api.Model 21 | { 22 | /// 23 | /// List of Manufacturers and information about each manufacturer 24 | /// 25 | [DataContract] 26 | public partial class ManufacturersResponse : IEquatable, IValidatableObject 27 | { 28 | /// 29 | /// Initializes a new instance of the class. 30 | /// 31 | /// List of Manufacturer Information. 32 | public ManufacturersResponse(List manufacturers = default(List)) 33 | { 34 | this.Manufacturers = manufacturers; 35 | } 36 | 37 | /// 38 | /// List of Manufacturer Information 39 | /// 40 | /// List of Manufacturer Information 41 | [DataMember(Name = "Manufacturers", EmitDefaultValue = false)] 42 | public List Manufacturers { get; set; } 43 | 44 | /// 45 | /// Returns the string presentation of the object 46 | /// 47 | /// string presentation of the object 48 | public override string ToString() 49 | { 50 | var sb = new StringBuilder(); 51 | sb.Append("class ManufacturersResponse {\n"); 52 | sb.Append(" Manufacturers: ").Append(Manufacturers).Append("\n"); 53 | sb.Append("}\n"); 54 | return sb.ToString(); 55 | } 56 | 57 | /// 58 | /// Returns the JSON string presentation of the object 59 | /// 60 | /// JSON string presentation of the object 61 | public virtual string ToJson() 62 | { 63 | return JsonConvert.SerializeObject(this, Formatting.Indented); 64 | } 65 | 66 | /// 67 | /// Returns true if objects are equal 68 | /// 69 | /// Object to be compared 70 | /// Boolean 71 | public override bool Equals(object input) 72 | { 73 | return this.Equals(input as ManufacturersResponse); 74 | } 75 | 76 | /// 77 | /// Returns true if ManufacturersResponse instances are equal 78 | /// 79 | /// Instance of ManufacturersResponse to be compared 80 | /// Boolean 81 | public bool Equals(ManufacturersResponse input) 82 | { 83 | if (input == null) 84 | return false; 85 | 86 | return 87 | ( 88 | this.Manufacturers == input.Manufacturers || 89 | this.Manufacturers != null && 90 | this.Manufacturers.SequenceEqual(input.Manufacturers) 91 | ); 92 | } 93 | 94 | /// 95 | /// Gets the hash code 96 | /// 97 | /// Hash code 98 | public override int GetHashCode() 99 | { 100 | unchecked // Overflow is fine, just wrap 101 | { 102 | int hashCode = 41; 103 | if (this.Manufacturers != null) 104 | hashCode = hashCode * 59 + this.Manufacturers.GetHashCode(); 105 | return hashCode; 106 | } 107 | } 108 | 109 | /// 110 | /// To validate all properties of the instance 111 | /// 112 | /// Validation context 113 | /// Validation Result 114 | IEnumerable IValidatableObject.Validate(ValidationContext validationContext) 115 | { 116 | yield break; 117 | } 118 | } 119 | 120 | } 121 | -------------------------------------------------------------------------------- /DigiKey.Api/Model/PackageTypeByQuantityResponse.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * PackageTypeByQuantity Api 3 | * 4 | * PackageTypeByQuantity searches Digi-Key products and tries to find the best package types to purchase given a requested quantity and optional packaging preference. Made for Cut Tape, Tape and Reel, and Digi-Reel products. 5 | * 6 | * OpenAPI spec version: v3 7 | * 8 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | */ 10 | 11 | using System; 12 | using System.Linq; 13 | using System.IO; 14 | using System.Text; 15 | using System.Text.RegularExpressions; 16 | using System.Collections; 17 | using System.Collections.Generic; 18 | using System.Collections.ObjectModel; 19 | using System.Runtime.Serialization; 20 | using Newtonsoft.Json; 21 | using Newtonsoft.Json.Converters; 22 | using System.ComponentModel.DataAnnotations; 23 | 24 | namespace OriginalCircuit.DigiKey.Api.Model 25 | { 26 | /// 27 | /// Response from a PackageTypeByQuantity Search Service request 28 | /// 29 | [DataContract] 30 | public partial class PackageTypeByQuantityResponse : IEquatable, IValidatableObject 31 | { 32 | /// 33 | /// Initializes a new instance of the class. 34 | /// 35 | /// List of products that matched the PackageTypeByQuantitySearchService request.. 36 | public PackageTypeByQuantityResponse(List products = default(List)) 37 | { 38 | this.Products = products; 39 | } 40 | 41 | /// 42 | /// List of products that matched the PackageTypeByQuantitySearchService request. 43 | /// 44 | /// List of products that matched the PackageTypeByQuantitySearchService request. 45 | [DataMember(Name="Products", EmitDefaultValue=false)] 46 | public List Products { get; set; } 47 | 48 | /// 49 | /// Returns the string presentation of the object 50 | /// 51 | /// String presentation of the object 52 | public override string ToString() 53 | { 54 | var sb = new StringBuilder(); 55 | sb.Append("class PackageTypeByQuantityResponse {\n"); 56 | sb.Append(" Products: ").Append(Products).Append("\n"); 57 | sb.Append("}\n"); 58 | return sb.ToString(); 59 | } 60 | 61 | /// 62 | /// Returns the JSON string presentation of the object 63 | /// 64 | /// JSON string presentation of the object 65 | public virtual string ToJson() 66 | { 67 | return JsonConvert.SerializeObject(this, Formatting.Indented); 68 | } 69 | 70 | /// 71 | /// Returns true if objects are equal 72 | /// 73 | /// Object to be compared 74 | /// Boolean 75 | public override bool Equals(object input) 76 | { 77 | return this.Equals(input as PackageTypeByQuantityResponse); 78 | } 79 | 80 | /// 81 | /// Returns true if PackageTypeByQuantityResponse instances are equal 82 | /// 83 | /// Instance of PackageTypeByQuantityResponse to be compared 84 | /// Boolean 85 | public bool Equals(PackageTypeByQuantityResponse input) 86 | { 87 | if (input == null) 88 | return false; 89 | 90 | return 91 | ( 92 | this.Products == input.Products || 93 | this.Products != null && 94 | this.Products.SequenceEqual(input.Products) 95 | ); 96 | } 97 | 98 | /// 99 | /// Gets the hash code 100 | /// 101 | /// Hash code 102 | public override int GetHashCode() 103 | { 104 | unchecked // Overflow is fine, just wrap 105 | { 106 | int hashCode = 41; 107 | if (this.Products != null) 108 | hashCode = hashCode * 59 + this.Products.GetHashCode(); 109 | return hashCode; 110 | } 111 | } 112 | 113 | /// 114 | /// To validate all properties of the instance 115 | /// 116 | /// Validation context 117 | /// Validation Result 118 | IEnumerable IValidatableObject.Validate(ValidationContext validationContext) 119 | { 120 | yield break; 121 | } 122 | } 123 | 124 | } 125 | -------------------------------------------------------------------------------- /DigiKey.Api/Model/ParametricFilter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * PartSearch Api 3 | * 4 | * Search for products and retrieve details and pricing. 5 | * 6 | * OpenAPI spec version: v3 7 | * 8 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | */ 10 | 11 | using Newtonsoft.Json; 12 | using System; 13 | using System.Collections.Generic; 14 | using System.ComponentModel.DataAnnotations; 15 | using System.Runtime.Serialization; 16 | using System.Text; 17 | 18 | 19 | namespace OriginalCircuit.DigiKey.Api.Model 20 | { 21 | /// 22 | /// A filter used to refine a keyword search on any parameter. 23 | /// 24 | [DataContract] 25 | public partial class ParametricFilter : IEquatable, IValidatableObject 26 | { 27 | /// 28 | /// Initializes a new instance of the class. 29 | /// 30 | /// The parameter identifier.. 31 | /// The value identifier.. 32 | public ParametricFilter(int? parameterId = default(int?), string valueId = default(string)) 33 | { 34 | this.ParameterId = parameterId; 35 | this.ValueId = valueId; 36 | } 37 | 38 | /// 39 | /// The parameter identifier. 40 | /// 41 | /// The parameter identifier. 42 | [DataMember(Name = "ParameterId", EmitDefaultValue = false)] 43 | public int? ParameterId { get; set; } 44 | 45 | /// 46 | /// The value identifier. 47 | /// 48 | /// The value identifier. 49 | [DataMember(Name = "ValueId", EmitDefaultValue = false)] 50 | public string ValueId { get; set; } 51 | 52 | /// 53 | /// Returns the string presentation of the object 54 | /// 55 | /// string presentation of the object 56 | public override string ToString() 57 | { 58 | var sb = new StringBuilder(); 59 | sb.Append("class ParametricFilter {\n"); 60 | sb.Append(" ParameterId: ").Append(ParameterId).Append("\n"); 61 | sb.Append(" ValueId: ").Append(ValueId).Append("\n"); 62 | sb.Append("}\n"); 63 | return sb.ToString(); 64 | } 65 | 66 | /// 67 | /// Returns the JSON string presentation of the object 68 | /// 69 | /// JSON string presentation of the object 70 | public virtual string ToJson() 71 | { 72 | return JsonConvert.SerializeObject(this, Formatting.Indented); 73 | } 74 | 75 | /// 76 | /// Returns true if objects are equal 77 | /// 78 | /// Object to be compared 79 | /// Boolean 80 | public override bool Equals(object input) 81 | { 82 | return this.Equals(input as ParametricFilter); 83 | } 84 | 85 | /// 86 | /// Returns true if ParametricFilter instances are equal 87 | /// 88 | /// Instance of ParametricFilter to be compared 89 | /// Boolean 90 | public bool Equals(ParametricFilter input) 91 | { 92 | if (input == null) 93 | return false; 94 | 95 | return 96 | ( 97 | this.ParameterId == input.ParameterId || 98 | (this.ParameterId != null && 99 | this.ParameterId.Equals(input.ParameterId)) 100 | ) && 101 | ( 102 | this.ValueId == input.ValueId || 103 | (this.ValueId != null && 104 | this.ValueId.Equals(input.ValueId)) 105 | ); 106 | } 107 | 108 | /// 109 | /// Gets the hash code 110 | /// 111 | /// Hash code 112 | public override int GetHashCode() 113 | { 114 | unchecked // Overflow is fine, just wrap 115 | { 116 | int hashCode = 41; 117 | if (this.ParameterId != null) 118 | hashCode = hashCode * 59 + this.ParameterId.GetHashCode(); 119 | if (this.ValueId != null) 120 | hashCode = hashCode * 59 + this.ValueId.GetHashCode(); 121 | return hashCode; 122 | } 123 | } 124 | 125 | /// 126 | /// To validate all properties of the instance 127 | /// 128 | /// Validation context 129 | /// Validation Result 130 | IEnumerable IValidatableObject.Validate(ValidationContext validationContext) 131 | { 132 | // ParameterId(int?) maximum 133 | if (this.ParameterId > (int?)2147483647) 134 | { 135 | yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ParameterId, must be a value less than or equal to 2147483647.", new[] { "ParameterId" }); 136 | } 137 | 138 | // ParameterId(int?) minimum 139 | if (this.ParameterId < (int?)-2147483648) 140 | { 141 | yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ParameterId, must be a value greater than or equal to -2147483648.", new[] { "ParameterId" }); 142 | } 143 | 144 | // ValueId(string) maxLength 145 | if (this.ValueId != null && this.ValueId.Length > 100) 146 | { 147 | yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ValueId, length must be less than 100.", new[] { "ValueId" }); 148 | } 149 | 150 | // ValueId(string) minLength 151 | if (this.ValueId != null && this.ValueId.Length < 1) 152 | { 153 | yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for ValueId, length must be greater than 1.", new[] { "ValueId" }); 154 | } 155 | 156 | yield break; 157 | } 158 | } 159 | 160 | } 161 | -------------------------------------------------------------------------------- /DigiKey.Api/Model/PcnResponse.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Product Change Notifications Api 3 | * 4 | * Display all Product Change Notifications for a given DigiKey product 5 | * 6 | * OpenAPI spec version: v3 7 | * 8 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | */ 10 | 11 | using System; 12 | using System.Linq; 13 | using System.IO; 14 | using System.Text; 15 | using System.Text.RegularExpressions; 16 | using System.Collections; 17 | using System.Collections.Generic; 18 | using System.Collections.ObjectModel; 19 | using System.Runtime.Serialization; 20 | using Newtonsoft.Json; 21 | using Newtonsoft.Json.Converters; 22 | using System.ComponentModel.DataAnnotations; 23 | 24 | namespace OriginalCircuit.DigiKey.Api.Model 25 | { 26 | /// 27 | /// The response containing the Product Change Notifications 28 | /// 29 | [DataContract] 30 | public partial class PcnResponse : IEquatable, IValidatableObject 31 | { 32 | /// 33 | /// Initializes a new instance of the class. 34 | /// 35 | [JsonConstructorAttribute] 36 | protected PcnResponse() { } 37 | /// 38 | /// Initializes a new instance of the class. 39 | /// 40 | /// The product for which we are returning the change notifications. (required). 41 | /// The list of change notifications for the requested product. (required). 42 | public PcnResponse(string digiKeyPartNumber = default(string), List productChangeNotifications = default(List)) 43 | { 44 | // to ensure "digiKeyPartNumber" is required (not null) 45 | if (digiKeyPartNumber == null) 46 | { 47 | throw new InvalidDataException("digiKeyPartNumber is a required property for PcnResponse and cannot be null"); 48 | } 49 | else 50 | { 51 | this.DigiKeyPartNumber = digiKeyPartNumber; 52 | } 53 | // to ensure "productChangeNotifications" is required (not null) 54 | if (productChangeNotifications == null) 55 | { 56 | throw new InvalidDataException("productChangeNotifications is a required property for PcnResponse and cannot be null"); 57 | } 58 | else 59 | { 60 | this.ProductChangeNotifications = productChangeNotifications; 61 | } 62 | } 63 | 64 | /// 65 | /// The product for which we are returning the change notifications. 66 | /// 67 | /// The product for which we are returning the change notifications. 68 | [DataMember(Name="DigiKeyPartNumber", EmitDefaultValue=false)] 69 | public string DigiKeyPartNumber { get; set; } 70 | 71 | /// 72 | /// The list of change notifications for the requested product. 73 | /// 74 | /// The list of change notifications for the requested product. 75 | [DataMember(Name="ProductChangeNotifications", EmitDefaultValue=false)] 76 | public List ProductChangeNotifications { get; set; } 77 | 78 | /// 79 | /// Returns the string presentation of the object 80 | /// 81 | /// String presentation of the object 82 | public override string ToString() 83 | { 84 | var sb = new StringBuilder(); 85 | sb.Append("class PcnResponse {\n"); 86 | sb.Append(" DigiKeyPartNumber: ").Append(DigiKeyPartNumber).Append("\n"); 87 | sb.Append(" ProductChangeNotifications: ").Append(ProductChangeNotifications).Append("\n"); 88 | sb.Append("}\n"); 89 | return sb.ToString(); 90 | } 91 | 92 | /// 93 | /// Returns the JSON string presentation of the object 94 | /// 95 | /// JSON string presentation of the object 96 | public virtual string ToJson() 97 | { 98 | return JsonConvert.SerializeObject(this, Formatting.Indented); 99 | } 100 | 101 | /// 102 | /// Returns true if objects are equal 103 | /// 104 | /// Object to be compared 105 | /// Boolean 106 | public override bool Equals(object input) 107 | { 108 | return this.Equals(input as PcnResponse); 109 | } 110 | 111 | /// 112 | /// Returns true if PcnResponse instances are equal 113 | /// 114 | /// Instance of PcnResponse to be compared 115 | /// Boolean 116 | public bool Equals(PcnResponse input) 117 | { 118 | if (input == null) 119 | return false; 120 | 121 | return 122 | ( 123 | this.DigiKeyPartNumber == input.DigiKeyPartNumber || 124 | (this.DigiKeyPartNumber != null && 125 | this.DigiKeyPartNumber.Equals(input.DigiKeyPartNumber)) 126 | ) && 127 | ( 128 | this.ProductChangeNotifications == input.ProductChangeNotifications || 129 | this.ProductChangeNotifications != null && 130 | this.ProductChangeNotifications.SequenceEqual(input.ProductChangeNotifications) 131 | ); 132 | } 133 | 134 | /// 135 | /// Gets the hash code 136 | /// 137 | /// Hash code 138 | public override int GetHashCode() 139 | { 140 | unchecked // Overflow is fine, just wrap 141 | { 142 | int hashCode = 41; 143 | if (this.DigiKeyPartNumber != null) 144 | hashCode = hashCode * 59 + this.DigiKeyPartNumber.GetHashCode(); 145 | if (this.ProductChangeNotifications != null) 146 | hashCode = hashCode * 59 + this.ProductChangeNotifications.GetHashCode(); 147 | return hashCode; 148 | } 149 | } 150 | 151 | /// 152 | /// To validate all properties of the instance 153 | /// 154 | /// Validation context 155 | /// Validation Result 156 | IEnumerable IValidatableObject.Validate(ValidationContext validationContext) 157 | { 158 | yield break; 159 | } 160 | } 161 | 162 | } 163 | -------------------------------------------------------------------------------- /DigiKey.Api/Model/PidVid.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * PartSearch Api 3 | * 4 | * Search for products and retrieve details and pricing. 5 | * 6 | * OpenAPI spec version: v3 7 | * 8 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | */ 10 | 11 | using Newtonsoft.Json; 12 | using System; 13 | using System.Collections.Generic; 14 | using System.ComponentModel.DataAnnotations; 15 | using System.Runtime.Serialization; 16 | using System.Text; 17 | 18 | 19 | namespace OriginalCircuit.DigiKey.Api.Model 20 | { 21 | /// 22 | /// Combination of a parameter Id and Value Id. Used for filtering search results. 23 | /// 24 | [DataContract] 25 | public partial class PidVid : IEquatable, IValidatableObject 26 | { 27 | /// 28 | /// Initializes a new instance of the class. 29 | /// 30 | /// The Id of the parameter.. 31 | /// The Id of the value.. 32 | /// The name of the parameter.. 33 | /// The name of the value.. 34 | public PidVid(int? parameterId = default(int?), string valueId = default(string), string _parameter = default(string), string value = default(string)) 35 | { 36 | this.ParameterId = parameterId; 37 | this.ValueId = valueId; 38 | this.Parameter = _parameter; 39 | this.Value = value; 40 | } 41 | 42 | /// 43 | /// The Id of the parameter. 44 | /// 45 | /// The Id of the parameter. 46 | [DataMember(Name = "ParameterId", EmitDefaultValue = false)] 47 | public int? ParameterId { get; set; } 48 | 49 | /// 50 | /// The Id of the value. 51 | /// 52 | /// The Id of the value. 53 | [DataMember(Name = "ValueId", EmitDefaultValue = false)] 54 | public string ValueId { get; set; } 55 | 56 | /// 57 | /// The name of the parameter. 58 | /// 59 | /// The name of the parameter. 60 | [DataMember(Name = "Parameter", EmitDefaultValue = false)] 61 | public string Parameter { get; set; } 62 | 63 | /// 64 | /// The name of the value. 65 | /// 66 | /// The name of the value. 67 | [DataMember(Name = "Value", EmitDefaultValue = false)] 68 | public string Value { get; set; } 69 | 70 | /// 71 | /// Returns the string presentation of the object 72 | /// 73 | /// string presentation of the object 74 | public override string ToString() 75 | { 76 | var sb = new StringBuilder(); 77 | sb.Append("class PidVid {\n"); 78 | sb.Append(" ParameterId: ").Append(ParameterId).Append("\n"); 79 | sb.Append(" ValueId: ").Append(ValueId).Append("\n"); 80 | sb.Append(" Parameter: ").Append(Parameter).Append("\n"); 81 | sb.Append(" Value: ").Append(Value).Append("\n"); 82 | sb.Append("}\n"); 83 | return sb.ToString(); 84 | } 85 | 86 | /// 87 | /// Returns the JSON string presentation of the object 88 | /// 89 | /// JSON string presentation of the object 90 | public virtual string ToJson() 91 | { 92 | return JsonConvert.SerializeObject(this, Formatting.Indented); 93 | } 94 | 95 | /// 96 | /// Returns true if objects are equal 97 | /// 98 | /// Object to be compared 99 | /// Boolean 100 | public override bool Equals(object input) 101 | { 102 | return this.Equals(input as PidVid); 103 | } 104 | 105 | /// 106 | /// Returns true if PidVid instances are equal 107 | /// 108 | /// Instance of PidVid to be compared 109 | /// Boolean 110 | public bool Equals(PidVid input) 111 | { 112 | if (input == null) 113 | return false; 114 | 115 | return 116 | ( 117 | this.ParameterId == input.ParameterId || 118 | (this.ParameterId != null && 119 | this.ParameterId.Equals(input.ParameterId)) 120 | ) && 121 | ( 122 | this.ValueId == input.ValueId || 123 | (this.ValueId != null && 124 | this.ValueId.Equals(input.ValueId)) 125 | ) && 126 | ( 127 | this.Parameter == input.Parameter || 128 | (this.Parameter != null && 129 | this.Parameter.Equals(input.Parameter)) 130 | ) && 131 | ( 132 | this.Value == input.Value || 133 | (this.Value != null && 134 | this.Value.Equals(input.Value)) 135 | ); 136 | } 137 | 138 | /// 139 | /// Gets the hash code 140 | /// 141 | /// Hash code 142 | public override int GetHashCode() 143 | { 144 | unchecked // Overflow is fine, just wrap 145 | { 146 | int hashCode = 41; 147 | if (this.ParameterId != null) 148 | hashCode = hashCode * 59 + this.ParameterId.GetHashCode(); 149 | if (this.ValueId != null) 150 | hashCode = hashCode * 59 + this.ValueId.GetHashCode(); 151 | if (this.Parameter != null) 152 | hashCode = hashCode * 59 + this.Parameter.GetHashCode(); 153 | if (this.Value != null) 154 | hashCode = hashCode * 59 + this.Value.GetHashCode(); 155 | return hashCode; 156 | } 157 | } 158 | 159 | /// 160 | /// To validate all properties of the instance 161 | /// 162 | /// Validation context 163 | /// Validation Result 164 | IEnumerable IValidatableObject.Validate(ValidationContext validationContext) 165 | { 166 | yield break; 167 | } 168 | } 169 | 170 | } 171 | -------------------------------------------------------------------------------- /DigiKey.Api/Model/PriceBreak.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * PartSearch Api 3 | * 4 | * Search for products and retrieve details and pricing. 5 | * 6 | * OpenAPI spec version: v3 7 | * 8 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | */ 10 | 11 | using Newtonsoft.Json; 12 | using System; 13 | using System.Collections.Generic; 14 | using System.ComponentModel.DataAnnotations; 15 | using System.Runtime.Serialization; 16 | using System.Text; 17 | 18 | 19 | namespace OriginalCircuit.DigiKey.Api.Model 20 | { 21 | /// 22 | /// PriceBreak of a product. Note that all pricing when keyword searching is cached catalog pricing. 23 | /// 24 | [DataContract] 25 | public partial class PriceBreak : IEquatable, IValidatableObject 26 | { 27 | /// 28 | /// Initializes a new instance of the class. 29 | /// 30 | /// Price tiers based on the available quantities of the product.. 31 | /// Price of a single unit of the product at this break.. 32 | /// Price of BreakQuantity units of the product.. 33 | public PriceBreak(int? breakQuantity = default(int?), double? unitPrice = default(double?), double? totalPrice = default(double?)) 34 | { 35 | this.BreakQuantity = breakQuantity; 36 | this.UnitPrice = unitPrice; 37 | this.TotalPrice = totalPrice; 38 | } 39 | 40 | /// 41 | /// Price tiers based on the available quantities of the product. 42 | /// 43 | /// Price tiers based on the available quantities of the product. 44 | [DataMember(Name = "BreakQuantity", EmitDefaultValue = false)] 45 | public int? BreakQuantity { get; set; } 46 | 47 | /// 48 | /// Price of a single unit of the product at this break. 49 | /// 50 | /// Price of a single unit of the product at this break. 51 | [DataMember(Name = "UnitPrice", EmitDefaultValue = false)] 52 | public double? UnitPrice { get; set; } 53 | 54 | /// 55 | /// Price of BreakQuantity units of the product. 56 | /// 57 | /// Price of BreakQuantity units of the product. 58 | [DataMember(Name = "TotalPrice", EmitDefaultValue = false)] 59 | public double? TotalPrice { get; set; } 60 | 61 | /// 62 | /// Returns the string presentation of the object 63 | /// 64 | /// string presentation of the object 65 | public override string ToString() 66 | { 67 | var sb = new StringBuilder(); 68 | sb.Append("class PriceBreak {\n"); 69 | sb.Append(" BreakQuantity: ").Append(BreakQuantity).Append("\n"); 70 | sb.Append(" UnitPrice: ").Append(UnitPrice).Append("\n"); 71 | sb.Append(" TotalPrice: ").Append(TotalPrice).Append("\n"); 72 | sb.Append("}\n"); 73 | return sb.ToString(); 74 | } 75 | 76 | /// 77 | /// Returns the JSON string presentation of the object 78 | /// 79 | /// JSON string presentation of the object 80 | public virtual string ToJson() 81 | { 82 | return JsonConvert.SerializeObject(this, Formatting.Indented); 83 | } 84 | 85 | /// 86 | /// Returns true if objects are equal 87 | /// 88 | /// Object to be compared 89 | /// Boolean 90 | public override bool Equals(object input) 91 | { 92 | return this.Equals(input as PriceBreak); 93 | } 94 | 95 | /// 96 | /// Returns true if PriceBreak instances are equal 97 | /// 98 | /// Instance of PriceBreak to be compared 99 | /// Boolean 100 | public bool Equals(PriceBreak input) 101 | { 102 | if (input == null) 103 | return false; 104 | 105 | return 106 | ( 107 | this.BreakQuantity == input.BreakQuantity || 108 | (this.BreakQuantity != null && 109 | this.BreakQuantity.Equals(input.BreakQuantity)) 110 | ) && 111 | ( 112 | this.UnitPrice == input.UnitPrice || 113 | (this.UnitPrice != null && 114 | this.UnitPrice.Equals(input.UnitPrice)) 115 | ) && 116 | ( 117 | this.TotalPrice == input.TotalPrice || 118 | (this.TotalPrice != null && 119 | this.TotalPrice.Equals(input.TotalPrice)) 120 | ); 121 | } 122 | 123 | /// 124 | /// Gets the hash code 125 | /// 126 | /// Hash code 127 | public override int GetHashCode() 128 | { 129 | unchecked // Overflow is fine, just wrap 130 | { 131 | int hashCode = 41; 132 | if (this.BreakQuantity != null) 133 | hashCode = hashCode * 59 + this.BreakQuantity.GetHashCode(); 134 | if (this.UnitPrice != null) 135 | hashCode = hashCode * 59 + this.UnitPrice.GetHashCode(); 136 | if (this.TotalPrice != null) 137 | hashCode = hashCode * 59 + this.TotalPrice.GetHashCode(); 138 | return hashCode; 139 | } 140 | } 141 | 142 | /// 143 | /// To validate all properties of the instance 144 | /// 145 | /// Validation context 146 | /// Validation Result 147 | IEnumerable IValidatableObject.Validate(ValidationContext validationContext) 148 | { 149 | yield break; 150 | } 151 | } 152 | 153 | } 154 | -------------------------------------------------------------------------------- /DigiKey.Api/Model/ProductDetailsResponse.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * PartSearch Api 3 | * 4 | * Search for products and retrieve details and pricing. 5 | * 6 | * OpenAPI spec version: v3 7 | * 8 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | */ 10 | 11 | using Newtonsoft.Json; 12 | using System; 13 | using System.Collections.Generic; 14 | using System.ComponentModel.DataAnnotations; 15 | using System.Linq; 16 | using System.Runtime.Serialization; 17 | using System.Text; 18 | 19 | 20 | namespace OriginalCircuit.DigiKey.Api.Model 21 | { 22 | /// 23 | /// Response for list Manufacturer Product Details 24 | /// 25 | [DataContract] 26 | public partial class ProductDetailsResponse : IEquatable, IValidatableObject 27 | { 28 | /// 29 | /// Initializes a new instance of the class. 30 | /// 31 | /// List of ProductDetails. 32 | public ProductDetailsResponse(List productDetails = default(List)) 33 | { 34 | this.ProductDetails = productDetails; 35 | } 36 | 37 | /// 38 | /// List of ProductDetails 39 | /// 40 | /// List of ProductDetails 41 | [DataMember(Name = "ProductDetails", EmitDefaultValue = false)] 42 | public List ProductDetails { get; set; } 43 | 44 | /// 45 | /// Returns the string presentation of the object 46 | /// 47 | /// string presentation of the object 48 | public override string ToString() 49 | { 50 | var sb = new StringBuilder(); 51 | sb.Append("class ProductDetailsResponse {\n"); 52 | sb.Append(" ProductDetails: ").Append(ProductDetails).Append("\n"); 53 | sb.Append("}\n"); 54 | return sb.ToString(); 55 | } 56 | 57 | /// 58 | /// Returns the JSON string presentation of the object 59 | /// 60 | /// JSON string presentation of the object 61 | public virtual string ToJson() 62 | { 63 | return JsonConvert.SerializeObject(this, Formatting.Indented); 64 | } 65 | 66 | /// 67 | /// Returns true if objects are equal 68 | /// 69 | /// Object to be compared 70 | /// Boolean 71 | public override bool Equals(object input) 72 | { 73 | return this.Equals(input as ProductDetailsResponse); 74 | } 75 | 76 | /// 77 | /// Returns true if ProductDetailsResponse instances are equal 78 | /// 79 | /// Instance of ProductDetailsResponse to be compared 80 | /// Boolean 81 | public bool Equals(ProductDetailsResponse input) 82 | { 83 | if (input == null) 84 | return false; 85 | 86 | return 87 | ( 88 | this.ProductDetails == input.ProductDetails || 89 | this.ProductDetails != null && 90 | this.ProductDetails.SequenceEqual(input.ProductDetails) 91 | ); 92 | } 93 | 94 | /// 95 | /// Gets the hash code 96 | /// 97 | /// Hash code 98 | public override int GetHashCode() 99 | { 100 | unchecked // Overflow is fine, just wrap 101 | { 102 | int hashCode = 41; 103 | if (this.ProductDetails != null) 104 | hashCode = hashCode * 59 + this.ProductDetails.GetHashCode(); 105 | return hashCode; 106 | } 107 | } 108 | 109 | /// 110 | /// To validate all properties of the instance 111 | /// 112 | /// Validation context 113 | /// Validation Result 114 | IEnumerable IValidatableObject.Validate(ValidationContext validationContext) 115 | { 116 | yield break; 117 | } 118 | } 119 | 120 | } 121 | -------------------------------------------------------------------------------- /DigiKey.Api/Model/ProductWithSuggestions.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * PartSearch Api 3 | * 4 | * Search for products and retrieve details and pricing. 5 | * 6 | * OpenAPI spec version: v3 7 | * 8 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | */ 10 | 11 | using Newtonsoft.Json; 12 | using System; 13 | using System.Collections.Generic; 14 | using System.ComponentModel.DataAnnotations; 15 | using System.Linq; 16 | using System.Runtime.Serialization; 17 | using System.Text; 18 | 19 | 20 | namespace OriginalCircuit.DigiKey.Api.Model 21 | { 22 | /// 23 | /// ProductWithSuggestions 24 | /// 25 | [DataContract] 26 | public partial class ProductWithSuggestions : IEquatable, IValidatableObject 27 | { 28 | /// 29 | /// Initializes a new instance of the class. 30 | /// 31 | /// product. 32 | /// suggestedProducts. 33 | public ProductWithSuggestions(ProductDetails product = default(ProductDetails), List suggestedProducts = default(List)) 34 | { 35 | this.Product = product; 36 | this.SuggestedProducts = suggestedProducts; 37 | } 38 | 39 | /// 40 | /// Gets or Sets Product 41 | /// 42 | [DataMember(Name = "Product", EmitDefaultValue = false)] 43 | public ProductDetails Product { get; set; } 44 | 45 | /// 46 | /// Gets or Sets SuggestedProducts 47 | /// 48 | [DataMember(Name = "SuggestedProducts", EmitDefaultValue = false)] 49 | public List SuggestedProducts { get; set; } 50 | 51 | /// 52 | /// Returns the string presentation of the object 53 | /// 54 | /// string presentation of the object 55 | public override string ToString() 56 | { 57 | var sb = new StringBuilder(); 58 | sb.Append("class ProductWithSuggestions {\n"); 59 | sb.Append(" Product: ").Append(Product).Append("\n"); 60 | sb.Append(" SuggestedProducts: ").Append(SuggestedProducts).Append("\n"); 61 | sb.Append("}\n"); 62 | return sb.ToString(); 63 | } 64 | 65 | /// 66 | /// Returns the JSON string presentation of the object 67 | /// 68 | /// JSON string presentation of the object 69 | public virtual string ToJson() 70 | { 71 | return JsonConvert.SerializeObject(this, Formatting.Indented); 72 | } 73 | 74 | /// 75 | /// Returns true if objects are equal 76 | /// 77 | /// Object to be compared 78 | /// Boolean 79 | public override bool Equals(object input) 80 | { 81 | return this.Equals(input as ProductWithSuggestions); 82 | } 83 | 84 | /// 85 | /// Returns true if ProductWithSuggestions instances are equal 86 | /// 87 | /// Instance of ProductWithSuggestions to be compared 88 | /// Boolean 89 | public bool Equals(ProductWithSuggestions input) 90 | { 91 | if (input == null) 92 | return false; 93 | 94 | return 95 | ( 96 | this.Product == input.Product || 97 | (this.Product != null && 98 | this.Product.Equals(input.Product)) 99 | ) && 100 | ( 101 | this.SuggestedProducts == input.SuggestedProducts || 102 | this.SuggestedProducts != null && 103 | this.SuggestedProducts.SequenceEqual(input.SuggestedProducts) 104 | ); 105 | } 106 | 107 | /// 108 | /// Gets the hash code 109 | /// 110 | /// Hash code 111 | public override int GetHashCode() 112 | { 113 | unchecked // Overflow is fine, just wrap 114 | { 115 | int hashCode = 41; 116 | if (this.Product != null) 117 | hashCode = hashCode * 59 + this.Product.GetHashCode(); 118 | if (this.SuggestedProducts != null) 119 | hashCode = hashCode * 59 + this.SuggestedProducts.GetHashCode(); 120 | return hashCode; 121 | } 122 | } 123 | 124 | /// 125 | /// To validate all properties of the instance 126 | /// 127 | /// Validation context 128 | /// Validation Result 129 | IEnumerable IValidatableObject.Validate(ValidationContext validationContext) 130 | { 131 | yield break; 132 | } 133 | } 134 | 135 | } 136 | -------------------------------------------------------------------------------- /DigiKey.Api/Model/RecommendedProductsCollection.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * RecommendedParts Api 3 | * 4 | * Provides a collection of recommended products for a given product. These are products that you may be interested in given your interest in the provided part number. 5 | * 6 | * OpenAPI spec version: v3 7 | * 8 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | */ 10 | 11 | using System; 12 | using System.Linq; 13 | using System.IO; 14 | using System.Text; 15 | using System.Text.RegularExpressions; 16 | using System.Collections; 17 | using System.Collections.Generic; 18 | using System.Collections.ObjectModel; 19 | using System.Runtime.Serialization; 20 | using Newtonsoft.Json; 21 | using Newtonsoft.Json.Converters; 22 | using System.ComponentModel.DataAnnotations; 23 | 24 | namespace OriginalCircuit.DigiKey.Api.Model 25 | { 26 | /// 27 | /// The collection of recommended products for the given part number. 28 | /// 29 | [DataContract] 30 | public partial class RecommendedProductsCollection : IEquatable, IValidatableObject 31 | { 32 | /// 33 | /// Initializes a new instance of the class. 34 | /// 35 | /// The part number that the recommendations are for.. 36 | /// The list of recommended products.. 37 | /// searchLocaleUsed. 38 | public RecommendedProductsCollection(string partNumber = default(string), List recommendedProducts = default(List), IsoSearchLocale searchLocaleUsed = default(IsoSearchLocale)) 39 | { 40 | this.PartNumber = partNumber; 41 | this.RecommendedProducts = recommendedProducts; 42 | this.SearchLocaleUsed = searchLocaleUsed; 43 | } 44 | 45 | /// 46 | /// The part number that the recommendations are for. 47 | /// 48 | /// The part number that the recommendations are for. 49 | [DataMember(Name="PartNumber", EmitDefaultValue=false)] 50 | public string PartNumber { get; set; } 51 | 52 | /// 53 | /// The list of recommended products. 54 | /// 55 | /// The list of recommended products. 56 | [DataMember(Name="RecommendedProducts", EmitDefaultValue=false)] 57 | public List RecommendedProducts { get; set; } 58 | 59 | /// 60 | /// Gets or Sets SearchLocaleUsed 61 | /// 62 | [DataMember(Name="SearchLocaleUsed", EmitDefaultValue=false)] 63 | public IsoSearchLocale SearchLocaleUsed { get; set; } 64 | 65 | /// 66 | /// Returns the string presentation of the object 67 | /// 68 | /// String presentation of the object 69 | public override string ToString() 70 | { 71 | var sb = new StringBuilder(); 72 | sb.Append("class RecommendedProductsCollection {\n"); 73 | sb.Append(" PartNumber: ").Append(PartNumber).Append("\n"); 74 | sb.Append(" RecommendedProducts: ").Append(RecommendedProducts).Append("\n"); 75 | sb.Append(" SearchLocaleUsed: ").Append(SearchLocaleUsed).Append("\n"); 76 | sb.Append("}\n"); 77 | return sb.ToString(); 78 | } 79 | 80 | /// 81 | /// Returns the JSON string presentation of the object 82 | /// 83 | /// JSON string presentation of the object 84 | public virtual string ToJson() 85 | { 86 | return JsonConvert.SerializeObject(this, Formatting.Indented); 87 | } 88 | 89 | /// 90 | /// Returns true if objects are equal 91 | /// 92 | /// Object to be compared 93 | /// Boolean 94 | public override bool Equals(object input) 95 | { 96 | return this.Equals(input as RecommendedProductsCollection); 97 | } 98 | 99 | /// 100 | /// Returns true if RecommendedProductsCollection instances are equal 101 | /// 102 | /// Instance of RecommendedProductsCollection to be compared 103 | /// Boolean 104 | public bool Equals(RecommendedProductsCollection input) 105 | { 106 | if (input == null) 107 | return false; 108 | 109 | return 110 | ( 111 | this.PartNumber == input.PartNumber || 112 | (this.PartNumber != null && 113 | this.PartNumber.Equals(input.PartNumber)) 114 | ) && 115 | ( 116 | this.RecommendedProducts == input.RecommendedProducts || 117 | this.RecommendedProducts != null && 118 | this.RecommendedProducts.SequenceEqual(input.RecommendedProducts) 119 | ) && 120 | ( 121 | this.SearchLocaleUsed == input.SearchLocaleUsed || 122 | (this.SearchLocaleUsed != null && 123 | this.SearchLocaleUsed.Equals(input.SearchLocaleUsed)) 124 | ); 125 | } 126 | 127 | /// 128 | /// Gets the hash code 129 | /// 130 | /// Hash code 131 | public override int GetHashCode() 132 | { 133 | unchecked // Overflow is fine, just wrap 134 | { 135 | int hashCode = 41; 136 | if (this.PartNumber != null) 137 | hashCode = hashCode * 59 + this.PartNumber.GetHashCode(); 138 | if (this.RecommendedProducts != null) 139 | hashCode = hashCode * 59 + this.RecommendedProducts.GetHashCode(); 140 | if (this.SearchLocaleUsed != null) 141 | hashCode = hashCode * 59 + this.SearchLocaleUsed.GetHashCode(); 142 | return hashCode; 143 | } 144 | } 145 | 146 | /// 147 | /// To validate all properties of the instance 148 | /// 149 | /// Validation context 150 | /// Validation Result 151 | IEnumerable IValidatableObject.Validate(ValidationContext validationContext) 152 | { 153 | yield break; 154 | } 155 | } 156 | 157 | } 158 | -------------------------------------------------------------------------------- /DigiKey.Api/Model/RecommendedProductsResponse.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * RecommendedParts Api 3 | * 4 | * Provides a collection of recommended products for a given product. These are products that you may be interested in given your interest in the provided part number. 5 | * 6 | * OpenAPI spec version: v3 7 | * 8 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | */ 10 | 11 | using System; 12 | using System.Linq; 13 | using System.IO; 14 | using System.Text; 15 | using System.Text.RegularExpressions; 16 | using System.Collections; 17 | using System.Collections.Generic; 18 | using System.Collections.ObjectModel; 19 | using System.Runtime.Serialization; 20 | using Newtonsoft.Json; 21 | using Newtonsoft.Json.Converters; 22 | using System.ComponentModel.DataAnnotations; 23 | 24 | namespace OriginalCircuit.DigiKey.Api.Model 25 | { 26 | /// 27 | /// The recommended products returned grouped in collections. 28 | /// 29 | [DataContract] 30 | public partial class RecommendedProductsResponse : IEquatable, IValidatableObject 31 | { 32 | /// 33 | /// Initializes a new instance of the class. 34 | /// 35 | /// The list of RecommendedProductsCollections - each containing a Product and its recommendations.. 36 | public RecommendedProductsResponse(List recommendedProductsCollection = default(List)) 37 | { 38 | this.RecommendedProductsCollection = recommendedProductsCollection; 39 | } 40 | 41 | /// 42 | /// The list of RecommendedProductsCollections - each containing a Product and its recommendations. 43 | /// 44 | /// The list of RecommendedProductsCollections - each containing a Product and its recommendations. 45 | [DataMember(Name="RecommendedProductsCollection", EmitDefaultValue=false)] 46 | public List RecommendedProductsCollection { get; set; } 47 | 48 | /// 49 | /// Returns the string presentation of the object 50 | /// 51 | /// String presentation of the object 52 | public override string ToString() 53 | { 54 | var sb = new StringBuilder(); 55 | sb.Append("class RecommendedProductsResponse {\n"); 56 | sb.Append(" RecommendedProductsCollection: ").Append(RecommendedProductsCollection).Append("\n"); 57 | sb.Append("}\n"); 58 | return sb.ToString(); 59 | } 60 | 61 | /// 62 | /// Returns the JSON string presentation of the object 63 | /// 64 | /// JSON string presentation of the object 65 | public virtual string ToJson() 66 | { 67 | return JsonConvert.SerializeObject(this, Formatting.Indented); 68 | } 69 | 70 | /// 71 | /// Returns true if objects are equal 72 | /// 73 | /// Object to be compared 74 | /// Boolean 75 | public override bool Equals(object input) 76 | { 77 | return this.Equals(input as RecommendedProductsResponse); 78 | } 79 | 80 | /// 81 | /// Returns true if RecommendedProductsResponse instances are equal 82 | /// 83 | /// Instance of RecommendedProductsResponse to be compared 84 | /// Boolean 85 | public bool Equals(RecommendedProductsResponse input) 86 | { 87 | if (input == null) 88 | return false; 89 | 90 | return 91 | ( 92 | this.RecommendedProductsCollection == input.RecommendedProductsCollection || 93 | this.RecommendedProductsCollection != null && 94 | this.RecommendedProductsCollection.SequenceEqual(input.RecommendedProductsCollection) 95 | ); 96 | } 97 | 98 | /// 99 | /// Gets the hash code 100 | /// 101 | /// Hash code 102 | public override int GetHashCode() 103 | { 104 | unchecked // Overflow is fine, just wrap 105 | { 106 | int hashCode = 41; 107 | if (this.RecommendedProductsCollection != null) 108 | hashCode = hashCode * 59 + this.RecommendedProductsCollection.GetHashCode(); 109 | return hashCode; 110 | } 111 | } 112 | 113 | /// 114 | /// To validate all properties of the instance 115 | /// 116 | /// Validation context 117 | /// Validation Result 118 | IEnumerable IValidatableObject.Validate(ValidationContext validationContext) 119 | { 120 | yield break; 121 | } 122 | } 123 | 124 | } 125 | -------------------------------------------------------------------------------- /DigiKey.Api/Model/SearchOption.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * PartSearch Api 3 | * 4 | * Search for products and retrieve details and pricing. 5 | * 6 | * OpenAPI spec version: v3 7 | * 8 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | */ 10 | 11 | using Newtonsoft.Json; 12 | using Newtonsoft.Json.Converters; 13 | using System.Runtime.Serialization; 14 | 15 | 16 | namespace OriginalCircuit.DigiKey.Api.Model 17 | { 18 | /// 19 | /// SearchOption - Options to search by. 20 | /// 21 | /// SearchOption - Options to search by. 22 | 23 | [JsonConverter(typeof(StringEnumConverter))] 24 | 25 | public enum SearchOption 26 | { 27 | 28 | /// 29 | /// Enum ManufacturerPartSearch for value: ManufacturerPartSearch 30 | /// 31 | [EnumMember(Value = "ManufacturerPartSearch")] 32 | ManufacturerPartSearch = 1, 33 | 34 | /// 35 | /// Enum InStock for value: InStock 36 | /// 37 | [EnumMember(Value = "InStock")] 38 | InStock = 2, 39 | 40 | /// 41 | /// Enum NewProductsOnly for value: NewProductsOnly 42 | /// 43 | [EnumMember(Value = "NewProductsOnly")] 44 | NewProductsOnly = 3, 45 | 46 | /// 47 | /// Enum RoHSCompliant for value: RoHSCompliant 48 | /// 49 | [EnumMember(Value = "RoHSCompliant")] 50 | RoHSCompliant = 4, 51 | 52 | /// 53 | /// Enum LeadFree for value: LeadFree 54 | /// 55 | [EnumMember(Value = "LeadFree")] 56 | LeadFree = 5, 57 | 58 | /// 59 | /// Enum CollapsePackagingTypes for value: CollapsePackagingTypes 60 | /// 61 | [EnumMember(Value = "CollapsePackagingTypes")] 62 | CollapsePackagingTypes = 6, 63 | 64 | /// 65 | /// Enum ExcludeNonStock for value: ExcludeNonStock 66 | /// 67 | [EnumMember(Value = "ExcludeNonStock")] 68 | ExcludeNonStock = 7, 69 | 70 | /// 71 | /// Enum Has3DModel for value: Has3DModel 72 | /// 73 | [EnumMember(Value = "Has3DModel")] 74 | Has3DModel = 8, 75 | 76 | /// 77 | /// Enum HasMentorFootprint for value: HasMentorFootprint 78 | /// 79 | [EnumMember(Value = "HasMentorFootprint")] 80 | HasMentorFootprint = 9 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /DigiKey.Api/Model/SortDirection.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * PartSearch Api 3 | * 4 | * Search for products and retrieve details and pricing. 5 | * 6 | * OpenAPI spec version: v3 7 | * 8 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | */ 10 | 11 | using Newtonsoft.Json; 12 | using Newtonsoft.Json.Converters; 13 | using System.Runtime.Serialization; 14 | 15 | 16 | namespace OriginalCircuit.DigiKey.Api.Model 17 | { 18 | /// 19 | /// SortDirection enum 20 | /// 21 | /// SortDirection enum 22 | 23 | [JsonConverter(typeof(StringEnumConverter))] 24 | 25 | public enum SortDirection 26 | { 27 | 28 | /// 29 | /// Enum Ascending for value: Ascending 30 | /// 31 | [EnumMember(Value = "Ascending")] 32 | Ascending = 1, 33 | 34 | /// 35 | /// Enum Descending for value: Descending 36 | /// 37 | [EnumMember(Value = "Descending")] 38 | Descending = 2 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /DigiKey.Api/Model/SortOption.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * PartSearch Api 3 | * 4 | * Search for products and retrieve details and pricing. 5 | * 6 | * OpenAPI spec version: v3 7 | * 8 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | */ 10 | 11 | using Newtonsoft.Json; 12 | using Newtonsoft.Json.Converters; 13 | using System.Runtime.Serialization; 14 | 15 | 16 | namespace OriginalCircuit.DigiKey.Api.Model 17 | { 18 | /// 19 | /// SortOption enum 20 | /// 21 | /// SortOption enum 22 | 23 | [JsonConverter(typeof(StringEnumConverter))] 24 | 25 | public enum SortOption 26 | { 27 | 28 | /// 29 | /// Enum SortByDigiKeyPartNumber for value: SortByDigiKeyPartNumber 30 | /// 31 | [EnumMember(Value = "SortByDigiKeyPartNumber")] 32 | SortByDigiKeyPartNumber = 1, 33 | 34 | /// 35 | /// Enum SortByManufacturerPartNumber for value: SortByManufacturerPartNumber 36 | /// 37 | [EnumMember(Value = "SortByManufacturerPartNumber")] 38 | SortByManufacturerPartNumber = 2, 39 | 40 | /// 41 | /// Enum SortByDescription for value: SortByDescription 42 | /// 43 | [EnumMember(Value = "SortByDescription")] 44 | SortByDescription = 3, 45 | 46 | /// 47 | /// Enum SortByManufacturer for value: SortByManufacturer 48 | /// 49 | [EnumMember(Value = "SortByManufacturer")] 50 | SortByManufacturer = 4, 51 | 52 | /// 53 | /// Enum SortByMinimumOrderQuantity for value: SortByMinimumOrderQuantity 54 | /// 55 | [EnumMember(Value = "SortByMinimumOrderQuantity")] 56 | SortByMinimumOrderQuantity = 5, 57 | 58 | /// 59 | /// Enum SortByQuantityAvailable for value: SortByQuantityAvailable 60 | /// 61 | [EnumMember(Value = "SortByQuantityAvailable")] 62 | SortByQuantityAvailable = 6, 63 | 64 | /// 65 | /// Enum SortByUnitPrice for value: SortByUnitPrice 66 | /// 67 | [EnumMember(Value = "SortByUnitPrice")] 68 | SortByUnitPrice = 7, 69 | 70 | /// 71 | /// Enum SortByParameter for value: SortByParameter 72 | /// 73 | [EnumMember(Value = "SortByParameter")] 74 | SortByParameter = 8 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /DigiKey.Api/Model/SortParameters.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.IO; 6 | using System.Runtime.Serialization; 7 | using System.Text; 8 | 9 | 10 | namespace OriginalCircuit.DigiKey.Api.Model 11 | { 12 | /// 13 | /// Sort on the specified field in ascending or descending order. 14 | /// 15 | [DataContract] 16 | public partial class SortParameters : IEquatable, IValidatableObject 17 | { 18 | /// 19 | /// Gets or Sets SortOption 20 | /// 21 | [DataMember(Name = "SortOption", EmitDefaultValue = false)] 22 | public SortOption? SortOption { get; set; } 23 | /// 24 | /// Gets or Sets Direction 25 | /// 26 | [DataMember(Name = "Direction", EmitDefaultValue = false)] 27 | public SortDirection? Direction { get; set; } 28 | /// 29 | /// Initializes a new instance of the class. 30 | /// 31 | [JsonConstructorAttribute] 32 | protected SortParameters() { } 33 | /// 34 | /// Initializes a new instance of the class. 35 | /// 36 | /// sortOption(required). 37 | /// direction(required). 38 | /// The ParameterId of the parameter to sort on. The ParameterId can be found in the Search response. This is only used with SortByParameter.. 39 | public SortParameters(SortOption? sortOption = default(SortOption), SortDirection? direction = default(SortDirection), int? sortParameterId = default(int?)) 40 | { 41 | // to ensure "sortOption" is required(not null) 42 | if (sortOption == null) 43 | { 44 | throw new InvalidDataException("sortOption is a required property for SortParameters and cannot be null"); 45 | } 46 | else 47 | { 48 | this.SortOption = sortOption; 49 | } 50 | // to ensure "direction" is required(not null) 51 | if (direction == null) 52 | { 53 | throw new InvalidDataException("direction is a required property for SortParameters and cannot be null"); 54 | } 55 | else 56 | { 57 | this.Direction = direction; 58 | } 59 | this.SortParameterId = sortParameterId; 60 | } 61 | 62 | 63 | 64 | /// 65 | /// The ParameterId of the parameter to sort on. The ParameterId can be found in the Search response. This is only used with SortByParameter. 66 | /// 67 | /// The ParameterId of the parameter to sort on. The ParameterId can be found in the Search response. This is only used with SortByParameter. 68 | [DataMember(Name = "SortParameterId", EmitDefaultValue = false)] 69 | public int? SortParameterId { get; set; } 70 | 71 | /// 72 | /// Returns the string presentation of the object 73 | /// 74 | /// string presentation of the object 75 | public override string ToString() 76 | { 77 | var sb = new StringBuilder(); 78 | sb.Append("class SortParameters {\n"); 79 | sb.Append(" SortOption: ").Append(SortOption).Append("\n"); 80 | sb.Append(" Direction: ").Append(Direction).Append("\n"); 81 | sb.Append(" SortParameterId: ").Append(SortParameterId).Append("\n"); 82 | sb.Append("}\n"); 83 | return sb.ToString(); 84 | } 85 | 86 | /// 87 | /// Returns the JSON string presentation of the object 88 | /// 89 | /// JSON string presentation of the object 90 | public virtual string ToJson() 91 | { 92 | return JsonConvert.SerializeObject(this, Formatting.Indented); 93 | } 94 | 95 | /// 96 | /// Returns true if objects are equal 97 | /// 98 | /// Object to be compared 99 | /// Boolean 100 | public override bool Equals(object input) 101 | { 102 | return this.Equals(input as SortParameters); 103 | } 104 | 105 | /// 106 | /// Returns true if SortParameters instances are equal 107 | /// 108 | /// Instance of SortParameters to be compared 109 | /// Boolean 110 | public bool Equals(SortParameters input) 111 | { 112 | if (input == null) 113 | return false; 114 | 115 | return 116 | ( 117 | this.SortOption == input.SortOption || 118 | (this.SortOption != null && 119 | this.SortOption.Equals(input.SortOption)) 120 | ) && 121 | ( 122 | this.Direction == input.Direction || 123 | (this.Direction != null && 124 | this.Direction.Equals(input.Direction)) 125 | ) && 126 | ( 127 | this.SortParameterId == input.SortParameterId || 128 | (this.SortParameterId != null && 129 | this.SortParameterId.Equals(input.SortParameterId)) 130 | ); 131 | } 132 | 133 | /// 134 | /// Gets the hash code 135 | /// 136 | /// Hash code 137 | public override int GetHashCode() 138 | { 139 | unchecked // Overflow is fine, just wrap 140 | { 141 | int hashCode = 41; 142 | if (this.SortOption != null) 143 | hashCode = hashCode * 59 + this.SortOption.GetHashCode(); 144 | if (this.Direction != null) 145 | hashCode = hashCode * 59 + this.Direction.GetHashCode(); 146 | if (this.SortParameterId != null) 147 | hashCode = hashCode * 59 + this.SortParameterId.GetHashCode(); 148 | return hashCode; 149 | } 150 | } 151 | 152 | /// 153 | /// To validate all properties of the instance 154 | /// 155 | /// Validation context 156 | /// Validation Result 157 | IEnumerable IValidatableObject.Validate(ValidationContext validationContext) 158 | { 159 | yield break; 160 | } 161 | } 162 | 163 | } 164 | -------------------------------------------------------------------------------- /DigiKey.Api/Model/ValuePair.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * PartSearch Api 3 | * 4 | * Search for products and retrieve details and pricing. 5 | * 6 | * OpenAPI spec version: v3 7 | * 8 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | */ 10 | 11 | using Newtonsoft.Json; 12 | using System; 13 | using System.Collections.Generic; 14 | using System.ComponentModel.DataAnnotations; 15 | using System.Runtime.Serialization; 16 | using System.Text; 17 | 18 | 19 | namespace OriginalCircuit.DigiKey.Api.Model 20 | { 21 | /// 22 | /// A value belonging to a parameter. 23 | /// 24 | [DataContract] 25 | public partial class ValuePair : IEquatable, IValidatableObject 26 | { 27 | /// 28 | /// Initializes a new instance of the class. 29 | /// 30 | /// The Id of the value.. 31 | /// The name of the value.. 32 | public ValuePair(string valueId = default(string), string value = default(string)) 33 | { 34 | this.ValueId = valueId; 35 | this.Value = value; 36 | } 37 | 38 | /// 39 | /// The Id of the value. 40 | /// 41 | /// The Id of the value. 42 | [DataMember(Name = "ValueId", EmitDefaultValue = false)] 43 | public string ValueId { get; set; } 44 | 45 | /// 46 | /// The name of the value. 47 | /// 48 | /// The name of the value. 49 | [DataMember(Name = "Value", EmitDefaultValue = false)] 50 | public string Value { get; set; } 51 | 52 | /// 53 | /// Returns the string presentation of the object 54 | /// 55 | /// string presentation of the object 56 | public override string ToString() 57 | { 58 | var sb = new StringBuilder(); 59 | sb.Append("class ValuePair {\n"); 60 | sb.Append(" ValueId: ").Append(ValueId).Append("\n"); 61 | sb.Append(" Value: ").Append(Value).Append("\n"); 62 | sb.Append("}\n"); 63 | return sb.ToString(); 64 | } 65 | 66 | /// 67 | /// Returns the JSON string presentation of the object 68 | /// 69 | /// JSON string presentation of the object 70 | public virtual string ToJson() 71 | { 72 | return JsonConvert.SerializeObject(this, Formatting.Indented); 73 | } 74 | 75 | /// 76 | /// Returns true if objects are equal 77 | /// 78 | /// Object to be compared 79 | /// Boolean 80 | public override bool Equals(object input) 81 | { 82 | return this.Equals(input as ValuePair); 83 | } 84 | 85 | /// 86 | /// Returns true if ValuePair instances are equal 87 | /// 88 | /// Instance of ValuePair to be compared 89 | /// Boolean 90 | public bool Equals(ValuePair input) 91 | { 92 | if (input == null) 93 | return false; 94 | 95 | return 96 | ( 97 | this.ValueId == input.ValueId || 98 | (this.ValueId != null && 99 | this.ValueId.Equals(input.ValueId)) 100 | ) && 101 | ( 102 | this.Value == input.Value || 103 | (this.Value != null && 104 | this.Value.Equals(input.Value)) 105 | ); 106 | } 107 | 108 | /// 109 | /// Gets the hash code 110 | /// 111 | /// Hash code 112 | public override int GetHashCode() 113 | { 114 | unchecked // Overflow is fine, just wrap 115 | { 116 | int hashCode = 41; 117 | if (this.ValueId != null) 118 | hashCode = hashCode * 59 + this.ValueId.GetHashCode(); 119 | if (this.Value != null) 120 | hashCode = hashCode * 59 + this.Value.GetHashCode(); 121 | return hashCode; 122 | } 123 | } 124 | 125 | /// 126 | /// To validate all properties of the instance 127 | /// 128 | /// Validation context 129 | /// Validation Result 130 | IEnumerable IValidatableObject.Validate(ValidationContext validationContext) 131 | { 132 | yield break; 133 | } 134 | } 135 | 136 | } 137 | -------------------------------------------------------------------------------- /DigiKey.Api/OAuth2/Models/OAuth2AccessToken.cs: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------- 2 | // 3 | // THE SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTIES OF ANY KIND, EXPRESS, IMPLIED, STATUTORY, 4 | // OR OTHERWISE. EXPECT TO THE EXTENT PROHIBITED BY APPLICABLE LAW, DIGI-KEY DISCLAIMS ALL WARRANTIES, 5 | // INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, 6 | // SATISFACTORY QUALITY, TITLE, NON-INFRINGEMENT, QUIET ENJOYMENT, 7 | // AND WARRANTIES ARISING OUT OF ANY COURSE OF DEALING OR USAGE OF TRADE. 8 | // 9 | // DIGI-KEY DOES NOT WARRANT THAT THE SOFTWARE WILL FUNCTION AS DESCRIBED, 10 | // WILL BE UNINTERRUPTED OR ERROR-FREE, OR FREE OF HARMFUL COMPONENTS. 11 | // 12 | //----------------------------------------------------------------------- 13 | 14 | using Newtonsoft.Json; 15 | using System.Diagnostics.CodeAnalysis; 16 | using System.Text; 17 | 18 | namespace OriginalCircuit.DigiKey.Api.OAuth2.Models 19 | { 20 | public class OAuth2AccessToken 21 | { 22 | /// Gets or sets the access token. 23 | [JsonProperty(PropertyName = "access_token")] 24 | public string AccessToken { get; set; } 25 | 26 | /// Gets or sets the error. 27 | [JsonProperty(PropertyName = "error")] 28 | public string Error { get; set; } 29 | 30 | public bool IsError => !string.IsNullOrEmpty(Error); 31 | 32 | /// Gets or sets the error description. 33 | [JsonProperty(PropertyName = "error_description")] 34 | public string ErrorDescription { get; set; } 35 | 36 | /// Gets or sets the id token. 37 | [JsonProperty(PropertyName = "id_token")] 38 | public string IdToken { get; set; } 39 | 40 | /// Gets or sets the refresh token. 41 | [JsonProperty(PropertyName = "refresh_token")] 42 | public string RefreshToken { get; set; } 43 | 44 | /// Gets or sets the token type. 45 | [JsonProperty(PropertyName = "token_type")] 46 | public string TokenType { get; set; } 47 | 48 | /// Gets or sets the expiration in seconds from now. 49 | [JsonProperty(PropertyName = "expires_in")] 50 | public int ExpiresIn { get; set; } 51 | 52 | [ExcludeFromCodeCoverage] 53 | public override string ToString() 54 | { 55 | var sb = new StringBuilder(); 56 | sb.AppendLine(@" ----------- [ OAuth2AccessToken ] ----------"); 57 | sb.AppendLine(@" AccessToken : " + AccessToken); 58 | sb.AppendLine(@" Error : " + Error); 59 | sb.AppendLine(@" ErrorDescription : " + ErrorDescription); 60 | sb.AppendLine(@" IdToken : " + IdToken); 61 | sb.AppendLine(@" RefreshToken : " + RefreshToken); 62 | sb.AppendLine(@" TokenType : " + TokenType); 63 | sb.AppendLine(@" ExpiresIn : " + ExpiresIn); 64 | sb.AppendLine(@" ---------------------------------------------"); 65 | 66 | return sb.ToString(); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /DigiKey.Api/OAuth2/Models/OAuth2Error.cs: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------- 2 | // 3 | // THE SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTIES OF ANY KIND, EXPRESS, IMPLIED, STATUTORY, 4 | // OR OTHERWISE. EXPECT TO THE EXTENT PROHIBITED BY APPLICABLE LAW, DIGI-KEY DISCLAIMS ALL WARRANTIES, 5 | // INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, 6 | // SATISFACTORY QUALITY, TITLE, NON-INFRINGEMENT, QUIET ENJOYMENT, 7 | // AND WARRANTIES ARISING OUT OF ANY COURSE OF DEALING OR USAGE OF TRADE. 8 | // 9 | // DIGI-KEY DOES NOT WARRANT THAT THE SOFTWARE WILL FUNCTION AS DESCRIBED, 10 | // WILL BE UNINTERRUPTED OR ERROR-FREE, OR FREE OF HARMFUL COMPONENTS. 11 | // 12 | //----------------------------------------------------------------------- 13 | 14 | using Newtonsoft.Json; 15 | 16 | namespace OriginalCircuit.DigiKey.Api.OAuth2.Models 17 | { 18 | public class OAuth2Error 19 | { 20 | [JsonProperty("httpCode")] 21 | public string HttpStatusCode { get; set; } 22 | 23 | [JsonProperty("httpMessage")] 24 | public string HttpMessage { get; set; } 25 | 26 | [JsonProperty("moreInformation")] 27 | public string MoreInformation { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /DigiKey.Api/OAuth2/OAuth2Helpers.cs: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------- 2 | // 3 | // THE SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTIES OF ANY KIND, EXPRESS, IMPLIED, STATUTORY, 4 | // OR OTHERWISE. EXPECT TO THE EXTENT PROHIBITED BY APPLICABLE LAW, DIGI-KEY DISCLAIMS ALL WARRANTIES, 5 | // INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, 6 | // SATISFACTORY QUALITY, TITLE, NON-INFRINGEMENT, QUIET ENJOYMENT, 7 | // AND WARRANTIES ARISING OUT OF ANY COURSE OF DEALING OR USAGE OF TRADE. 8 | // 9 | // DIGI-KEY DOES NOT WARRANT THAT THE SOFTWARE WILL FUNCTION AS DESCRIBED, 10 | // WILL BE UNINTERRUPTED OR ERROR-FREE, OR FREE OF HARMFUL COMPONENTS. 11 | // 12 | //----------------------------------------------------------------------- 13 | 14 | using OriginalCircuit.DigiKey.Api.Client; 15 | using OriginalCircuit.DigiKey.Api.Configuration; 16 | using OriginalCircuit.DigiKey.Api.OAuth2.Models; 17 | using Newtonsoft.Json; 18 | using RestSharp; 19 | using System; 20 | using System.Net; 21 | using System.Threading.Tasks; 22 | 23 | namespace OriginalCircuit.DigiKey.Api.OAuth2 24 | { 25 | /// 26 | /// Helper functions for OAuth2Service class and other classes calling OAuth2Service functions 27 | /// 28 | public static class OAuth2Helpers 29 | { 30 | /// 31 | /// Determines whether response has a unauthorized error message. 32 | /// 33 | /// json response 34 | /// 35 | /// true if token is stale in the error response; otherwise, false. 36 | /// 37 | public static bool IsTokenStale(string content) 38 | { 39 | var errors = JsonConvert.DeserializeObject(content); 40 | return errors.HttpMessage.ToLower().Contains("unauthorized"); 41 | } 42 | 43 | /// 44 | /// Refreshes the token asynchronous. 45 | /// 46 | /// Returns OAuth2AccessToken 47 | public static async Task RefreshTokenAsync() 48 | { 49 | ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; 50 | 51 | var client = new RestClient(ApiClientConfig.Instance.BaseAddress); 52 | var request = new RestRequest(ApiClientConfig.TokenEndpoint) 53 | .AddParameter("grant_type", "refresh_token") 54 | .AddParameter("client_id", ApiClientConfig.Instance.ClientId) 55 | .AddParameter("client_secret", ApiClientConfig.Instance.ClientSecret) 56 | .AddParameter("refresh_token", ApiClientConfig.Instance.RefreshToken); 57 | 58 | // todo: test PostAsync 59 | var response = await client.PostAsync(request); 60 | var responseString = response.Content; 61 | 62 | var oAuth2AccessToken = OAuth2Helpers.ParseOAuth2AccessTokenResponse(responseString); 63 | 64 | ApiClientConfig.Instance.AccessToken = oAuth2AccessToken.AccessToken; 65 | ApiClientConfig.Instance.RefreshToken = oAuth2AccessToken.RefreshToken; 66 | ApiClientConfig.Instance.ExpirationDateTime = DateTime.Now.AddSeconds(oAuth2AccessToken.ExpiresIn); 67 | 68 | ApiClientConfig.Instance.Save(); 69 | 70 | return oAuth2AccessToken; 71 | } 72 | 73 | /// 74 | /// Parses the OAuth2 access token response. 75 | /// 76 | /// The response. 77 | /// instance of OAuth2AccessToken 78 | /// ull) 79 | public static OAuth2AccessToken ParseOAuth2AccessTokenResponse(string response) 80 | { 81 | try 82 | { 83 | var oAuth2AccessTokenResponse = JsonConvert.DeserializeObject(response); 84 | return oAuth2AccessTokenResponse; 85 | } 86 | catch (System.Exception e) 87 | { 88 | Console.WriteLine(e.Message); 89 | throw new ApiException(0, $"Unable to parse OAuth2 access token response {e.Message}", null); 90 | } 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /DigiKey.Api/OAuth2/OAuth2Service.cs: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------- 2 | // 3 | // THE SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTIES OF ANY KIND, EXPRESS, IMPLIED, STATUTORY, 4 | // OR OTHERWISE. EXPECT TO THE EXTENT PROHIBITED BY APPLICABLE LAW, DIGI-KEY DISCLAIMS ALL WARRANTIES, 5 | // INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, 6 | // SATISFACTORY QUALITY, TITLE, NON-INFRINGEMENT, QUIET ENJOYMENT, 7 | // AND WARRANTIES ARISING OUT OF ANY COURSE OF DEALING OR USAGE OF TRADE. 8 | // 9 | // DIGI-KEY DOES NOT WARRANT THAT THE SOFTWARE WILL FUNCTION AS DESCRIBED, 10 | // WILL BE UNINTERRUPTED OR ERROR-FREE, OR FREE OF HARMFUL COMPONENTS. 11 | // 12 | //----------------------------------------------------------------------- 13 | 14 | using OriginalCircuit.DigiKey.Api.Configuration; 15 | using OriginalCircuit.DigiKey.Api.OAuth2.Models; 16 | using Newtonsoft.Json; 17 | using RestSharp; 18 | using System; 19 | using System.Net; 20 | using System.Threading.Tasks; 21 | using System.Web; 22 | 23 | namespace OriginalCircuit.DigiKey.Api.OAuth2 24 | { 25 | /// 26 | /// OAuth2Service accepts ApiApiClientConfigHelper.Instance to use to initialize and finish an OAuth2 Authorization and 27 | /// get and set the Access Token and Refresh Token for the given ClientId and Client Secret in the ApiApiClientConfigHelper.Instance 28 | /// 29 | public class OAuth2Service 30 | { 31 | 32 | public OAuth2Service() 33 | { 34 | } 35 | 36 | /// 37 | /// Generates the authentication URL based on ApiApiClientConfigHelper.Instance. 38 | /// 39 | /// This is current not used and should be "". 40 | /// This is not currently used. 41 | /// string which is the oauth2 authorization url. 42 | public string GenerateAuthUrl(string scopes = "", string state = null) 43 | { 44 | string baseAddress = ApiClientConfig.Instance.BaseAddress.EndsWith("/") ? ApiClientConfig.Instance.BaseAddress.TrimEnd('/') : ApiClientConfig.Instance.BaseAddress; 45 | 46 | var url = $"{baseAddress}{ApiClientConfig.AuthorizationEndpoint}?client_id={ApiClientConfig.Instance.ClientId}&scope={scopes}&redirect_uri={HttpUtility.UrlEncode(ApiClientConfig.Instance.RedirectUri)}&response_type=code"; 47 | 48 | if (!string.IsNullOrWhiteSpace(state)) 49 | { 50 | url = $"{url}&state={state}"; 51 | } 52 | 53 | return url; 54 | } 55 | 56 | /// 57 | /// Finishes authorization by passing the authorization code to the Token endpoint 58 | /// 59 | /// Code value returned by the RedirectUri callback 60 | /// Returns OAuth2AccessToken 61 | public async Task FinishAuthorization(string code) 62 | { 63 | ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; 64 | ServicePointManager.ServerCertificateValidationCallback = delegate { return true; }; 65 | 66 | 67 | var client = new RestClient(ApiClientConfig.Instance.BaseAddress); 68 | var request = new RestRequest(ApiClientConfig.TokenEndpoint) 69 | .AddParameter("code", code) 70 | .AddParameter("redirect_uri", ApiClientConfig.Instance.RedirectUri) 71 | .AddParameter("grant_type", "authorization_code") 72 | .AddParameter("client_id", ApiClientConfig.Instance.ClientId) 73 | .AddParameter("client_secret", ApiClientConfig.Instance.ClientSecret); 74 | 75 | // todo: test PostAsync 76 | var response = await client.PostAsync(request); 77 | var text = response.Content; 78 | 79 | // Check if there was an error in the response 80 | if (!response.IsSuccessful) 81 | { 82 | var status = response.StatusCode; 83 | if (status == HttpStatusCode.BadRequest) 84 | { 85 | // Deserialize and return model 86 | var errorResponse = JsonConvert.DeserializeObject(text); 87 | return errorResponse; 88 | } 89 | 90 | // Throw error 91 | if (response.ErrorException != null) throw response.ErrorException; 92 | throw new Exception(response.ErrorMessage); 93 | } 94 | 95 | // Deserializes the token response if successfull 96 | var oAuth2Token = OAuth2Helpers.ParseOAuth2AccessTokenResponse(text); 97 | 98 | return oAuth2Token; 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /DigiKey.Api/OriginalCircuit.DigiKey.Api.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | OriginalCircuit 6 | Original Circuit Limited 7 | API Client for Digi-Key V3. 8 | True 9 | Digi-Key API Client 10 | Copyright 2021-2022 Original Circuit Limited. Released under MIT License. 11 | https://github.com/issus/DigiKeyApi 12 | README.md 13 | https://github.com/issus/DigiKeyApi/tree/main/DigiKey.Api 14 | digikey; eda; digi-key; api; electronics; supplychain 15 | Initial Release 16 | MIT 17 | True 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | True 33 | \ 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /DigiKey.Api/PcnApi.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Linq; 5 | using RestSharp; 6 | using OriginalCircuit.DigiKey.Api.Client; 7 | using OriginalCircuit.DigiKey.Api.Model; 8 | using System.Threading.Tasks; 9 | 10 | namespace OriginalCircuit.DigiKey.Api 11 | { 12 | /// 13 | /// Represents a collection of functions to interact with the API endpoints 14 | /// 15 | public partial class PcnApi : BaseApi, IPcnApi 16 | { 17 | /// 18 | /// Initializes a new instance of the class. 19 | /// 20 | /// 21 | public PcnApi() 22 | { 23 | } 24 | 25 | /// 26 | /// This returns all change notifications for the given DigiKey product. 27 | /// 28 | /// Thrown when fails to make API call 29 | /// The product to retrieve change notifications for. 30 | /// Task of PcnResponse 31 | public async Task ProductChangeNotifications(string digiKeyPartNumber) 32 | { 33 | ApiResponse localVarResponse = await ProductChangeNotificationsWithHttpInfo(digiKeyPartNumber); 34 | return localVarResponse.Data; 35 | } 36 | 37 | /// 38 | /// This returns all change notifications for the given DigiKey product. 39 | /// 40 | /// Thrown when fails to make API call 41 | /// The product to retrieve change notifications for. 42 | /// Task of ApiResponse (PcnResponse) 43 | public async Task> ProductChangeNotificationsWithHttpInfo(string digiKeyPartNumber) 44 | { 45 | // verify the required parameter 'digiKeyPartNumber' is set 46 | if (digiKeyPartNumber == null) 47 | throw new ApiException(400, "Missing required parameter 'digiKeyPartNumber' when calling PcnApi->ProductChangeNotifications"); 48 | // verify the required parameter 'authorization' is set 49 | 50 | var path = $"/ChangeNotifications/v3/Products/{digiKeyPartNumber}"; 51 | RestResponse response = await MakeGetRequest(path); 52 | 53 | int statusCode = (int)response.StatusCode; 54 | 55 | if (ApiClient.ExceptionFactory != null) 56 | { 57 | Exception exception = ApiClient.ExceptionFactory("CategoriesById", response); 58 | if (exception != null && !(statusCode == 429 && !ApiClient.Instance.ThrowRateLimitExceptions)) throw exception; 59 | } 60 | 61 | return new ApiResponse(statusCode, response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), 62 | ApiClient.Instance.Deserialize(response)); 63 | } 64 | } 65 | 66 | /// 67 | /// Represents a collection of functions to interact with the API endpoints 68 | /// 69 | public interface IPcnApi 70 | { 71 | /// 72 | /// This returns all change notifications for the given DigiKey product. 73 | /// 74 | /// 75 | /// 76 | /// 77 | /// Thrown when fails to make API call 78 | /// The product to retrieve change notifications for. 79 | /// Task of PcnResponse 80 | Task ProductChangeNotifications(string digiKeyPartNumber); 81 | 82 | /// 83 | /// This returns all change notifications for the given DigiKey product. 84 | /// 85 | /// 86 | /// 87 | /// 88 | /// Thrown when fails to make API call 89 | /// The product to retrieve change notifications for. 90 | /// Task of ApiResponse (PcnResponse) 91 | Task> ProductChangeNotificationsWithHttpInfo(string digiKeyPartNumber); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /DigiKey.Api/ProductTracingApi.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * ProductTracing Api 3 | * 4 | * Search for products and retrieve details and pricing. 5 | * 6 | * OpenAPI spec version: v1 7 | * 8 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | */ 10 | 11 | using System; 12 | using System.Collections.Generic; 13 | using System.Collections.ObjectModel; 14 | using System.Linq; 15 | using RestSharp; 16 | using OriginalCircuit.DigiKey.Api.Client; 17 | using OriginalCircuit.DigiKey.Api.Model; 18 | using System.Threading.Tasks; 19 | 20 | namespace OriginalCircuit.DigiKey.Api 21 | { 22 | /// 23 | /// Represents a collection of functions to interact with the API endpoints 24 | /// 25 | public interface IProductTracingApi 26 | { 27 | /// 28 | /// Retrieve detailed information about the product being traced 29 | /// 30 | /// 31 | /// 32 | /// 33 | /// Thrown when fails to make API call 34 | /// The tracing Id of the product being traced 35 | /// Task of ProductTracingResponse 36 | Task Details(string tracingId); 37 | 38 | /// 39 | /// Retrieve detailed information about the product being traced 40 | /// 41 | /// 42 | /// 43 | /// 44 | /// Thrown when fails to make API call 45 | /// The tracing Id of the product being traced 46 | /// Task of ApiResponse (ProductTracingResponse) 47 | Task> DetailsWithHttpInfo(string tracingId); 48 | } 49 | 50 | /// 51 | /// Represents a collection of functions to interact with the API endpoints 52 | /// 53 | public partial class ProductTracingApi : BaseApi, IProductTracingApi 54 | { 55 | /// 56 | /// Initializes a new instance of the class. 57 | /// 58 | /// 59 | public ProductTracingApi() 60 | { 61 | } 62 | 63 | /// 64 | /// Retrieve detailed information about the product being traced 65 | /// 66 | /// Thrown when fails to make API call 67 | /// The tracing Id of the product being traced 68 | /// Task of ProductTracingResponse 69 | public async Task Details(string tracingId) 70 | { 71 | ApiResponse localVarResponse = await DetailsWithHttpInfo(tracingId); 72 | return localVarResponse.Data; 73 | 74 | } 75 | 76 | /// 77 | /// Retrieve detailed information about the product being traced 78 | /// 79 | /// Thrown when fails to make API call 80 | /// The tracing Id of the product being traced 81 | /// Task of ApiResponse (ProductTracingResponse) 82 | public async Task> DetailsWithHttpInfo(string tracingId) 83 | { 84 | // verify the required parameter 'tracingId' is set 85 | if (tracingId == null) 86 | throw new ApiException(400, "Missing required parameter 'tracingId' when calling ProductTracingApi->Details"); 87 | 88 | var path = $"/Details/{tracingId}"; 89 | 90 | RestResponse response = await MakeGetRequest(path); 91 | 92 | int statusCode = (int)response.StatusCode; 93 | 94 | if (ApiClient.ExceptionFactory != null) 95 | { 96 | Exception exception = ApiClient.ExceptionFactory("Details", response); 97 | if (exception != null && !(statusCode == 429 && !ApiClient.Instance.ThrowRateLimitExceptions)) throw exception; 98 | } 99 | 100 | return new ApiResponse(statusCode, response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), 101 | ApiClient.Instance.Deserialize(response)); 102 | } 103 | 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /DigiKey.Api/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /DigiKeyApi.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.4.33103.184 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OriginalCircuit.DigiKey.Api", "DigiKey.Api\OriginalCircuit.DigiKey.Api.csproj", "{66A18BE7-9C90-4BE7-B4C9-998992FD052C}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OriginalCircuit.DigiKey.Api.ConsoleClient", "DigiKey.Api.ConsoleClient\OriginalCircuit.DigiKey.Api.ConsoleClient.csproj", "{1CA5B6F3-EDAE-4D12-90F9-CEEA2B221747}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2C1ECF76-0818-4F8A-B877-B89AFAA0D49B}" 11 | ProjectSection(SolutionItems) = preProject 12 | apiclient.config = apiclient.config 13 | EndProjectSection 14 | EndProject 15 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OriginalCircuit.DigiKey.Api.OAuth2ConsoleClient", "DigiKey.Api.OAuth2ConsoleClient\OriginalCircuit.DigiKey.Api.OAuth2ConsoleClient.csproj", "{8AEA09FD-E613-45E0-89CA-9D3262BE46E0}" 16 | EndProject 17 | Global 18 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 19 | Debug|Any CPU = Debug|Any CPU 20 | Release|Any CPU = Release|Any CPU 21 | EndGlobalSection 22 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 23 | {66A18BE7-9C90-4BE7-B4C9-998992FD052C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 24 | {66A18BE7-9C90-4BE7-B4C9-998992FD052C}.Debug|Any CPU.Build.0 = Debug|Any CPU 25 | {66A18BE7-9C90-4BE7-B4C9-998992FD052C}.Release|Any CPU.ActiveCfg = Release|Any CPU 26 | {66A18BE7-9C90-4BE7-B4C9-998992FD052C}.Release|Any CPU.Build.0 = Release|Any CPU 27 | {1CA5B6F3-EDAE-4D12-90F9-CEEA2B221747}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 28 | {1CA5B6F3-EDAE-4D12-90F9-CEEA2B221747}.Debug|Any CPU.Build.0 = Debug|Any CPU 29 | {1CA5B6F3-EDAE-4D12-90F9-CEEA2B221747}.Release|Any CPU.ActiveCfg = Release|Any CPU 30 | {1CA5B6F3-EDAE-4D12-90F9-CEEA2B221747}.Release|Any CPU.Build.0 = Release|Any CPU 31 | {8AEA09FD-E613-45E0-89CA-9D3262BE46E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 32 | {8AEA09FD-E613-45E0-89CA-9D3262BE46E0}.Debug|Any CPU.Build.0 = Debug|Any CPU 33 | {8AEA09FD-E613-45E0-89CA-9D3262BE46E0}.Release|Any CPU.ActiveCfg = Release|Any CPU 34 | {8AEA09FD-E613-45E0-89CA-9D3262BE46E0}.Release|Any CPU.Build.0 = Release|Any CPU 35 | EndGlobalSection 36 | GlobalSection(SolutionProperties) = preSolution 37 | HideSolutionNode = FALSE 38 | EndGlobalSection 39 | GlobalSection(ExtensibilityGlobals) = postSolution 40 | SolutionGuid = {09E0B459-7207-4B69-8705-AC771B0C6547} 41 | EndGlobalSection 42 | EndGlobal 43 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Mark 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /apiclient.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/ApiErrorResponse.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.ApiErrorResponse 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **ErrorResponseVersion** | **string** | The version of the error handler. | [optional] 7 | **StatusCode** | **int?** | The HttpStatusCode of the error. | [optional] 8 | **ErrorMessage** | **string** | The message provided by the error handler. | [optional] 9 | **ErrorDetails** | **string** | The details of the error. | [optional] 10 | **RequestId** | **string** | The Id of the request that triggered the error. If contacting API Support, please include the RequestId. | [optional] 11 | **ValidationErrors** | [**List<ApiValidationError>**](ApiValidationError.md) | The list of validation errors (if applicable). | [optional] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | -------------------------------------------------------------------------------- /docs/ApiValidationError.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.ApiValidationError 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **Field** | **string** | The field that generated the error. | [optional] 7 | **Message** | **string** | The error message that was generated. This often explains how to fix your API input to be valid. | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | -------------------------------------------------------------------------------- /docs/AssociatedProduct.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.AssociatedProduct 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **ProductUrl** | **string** | Full URL of the Digi-Key catalog page to purchase the product. This is based on your provided Locale values. | [optional] 7 | **ManufacturerPartNumber** | **string** | The manufacturer part number. Note that some manufacturer part numbers may be used by multiple manufacturers for different parts. | [optional] 8 | **MinimumOrderQuantity** | **int?** | The minimum quantity to order from Digi-Key. | [optional] 9 | **NonStock** | **bool?** | Indicates this product is a non stock product. | [optional] 10 | **Packaging** | [**PidVid**](PidVid.md) | | [optional] 11 | **QuantityAvailable** | **int?** | Quantity of the product available for immediate sale. | [optional] 12 | **DigiKeyPartNumber** | **string** | The Digi-Key part number. | [optional] 13 | **ProductDescription** | **string** | Catalog description of the product. | [optional] 14 | **UnitPrice** | **double?** | The price for a single unit of this product. | [optional] 15 | **Manufacturer** | [**PidVid**](PidVid.md) | | [optional] 16 | **ManufacturerPublicQuantity** | **int?** | Quantity of this product available to order from manufacturer. | [optional] 17 | **QuantityOnOrder** | **int?** | Quantity of this product ordered but not immediately available. | [optional] 18 | **DKPlusRestriction** | **bool?** | If true- this product is not available for purchase through the Ordering API - it must be purchased through the Digi-Key web site | [optional] 19 | **Marketplace** | **bool?** | Product is a Marketplace product that ships direct from the supplier. A separate shipping fee may apply | [optional] 20 | **SupplierDirectShip** | **bool?** | If true- this product is shipped directly from the Supplier | [optional] 21 | **PimProductName** | **string** | Pim name for the product | [optional] 22 | **Supplier** | **string** | The Supplier is the provider of the products to Digi-Key and some cases the customer directly. | [optional] 23 | **SupplierId** | **int?** | Id for Supplier | [optional] 24 | 25 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 26 | 27 | -------------------------------------------------------------------------------- /docs/BasicProduct.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.BasicProduct 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **ManufacturerPartNumber** | **string** | The manufacturer part number. Note that some manufacturer part numbers may be used by multiple manufacturers for different parts. | [optional] 7 | **MinimumOrderQuantity** | **int?** | The minimum quantity to order from Digi-Key. | [optional] 8 | **NonStock** | **bool?** | Indicates this product is a non stock product. | [optional] 9 | **Packaging** | [**PidVid**](PidVid.md) | | [optional] 10 | **QuantityAvailable** | **int?** | Quantity of the product available for immediate sale. | [optional] 11 | **DigiKeyPartNumber** | **string** | The Digi-Key part number. | [optional] 12 | **ProductDescription** | **string** | Catalog description of the product. | [optional] 13 | **UnitPrice** | **double?** | The price for a single unit of this product. | [optional] 14 | **Manufacturer** | [**PidVid**](PidVid.md) | | [optional] 15 | **ManufacturerPublicQuantity** | **int?** | Quantity of this product available to order from manufacturer. | [optional] 16 | **QuantityOnOrder** | **int?** | Quantity of this product ordered but not immediately available. | [optional] 17 | **DKPlusRestriction** | **bool?** | If true- this product is not available for purchase through the Ordering API - it must be purchased through the Digi-Key web site | [optional] 18 | **Marketplace** | **bool?** | Product is a Marketplace product that ships direct from the supplier. A separate shipping fee may apply | [optional] 19 | **SupplierDirectShip** | **bool?** | If true- this product is shipped directly from the Supplier | [optional] 20 | **PimProductName** | **string** | Pim name for the product | [optional] 21 | **Supplier** | **string** | The Supplier is the provider of the products to Digi-Key and some cases the customer directly. | [optional] 22 | **SupplierId** | **int?** | Id for Supplier | [optional] 23 | 24 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 25 | 26 | -------------------------------------------------------------------------------- /docs/CategoriesResponse.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.CategoriesResponse 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **ProductCount** | **int?** | Count of Products | [optional] 7 | **Categories** | [**List<Category>**](Category.md) | List of Categories | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | -------------------------------------------------------------------------------- /docs/Category.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.Category 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **CategoryId** | **int?** | Gets or Sets CategoryId | [optional] 7 | **ParentId** | **int?** | The Id of the Partent Category if the given category is a child of another category | [optional] 8 | **Name** | **string** | Gets or Sets Name | [optional] 9 | **ProductCount** | **long?** | Gets or Sets ProductCount | [optional] 10 | **Children** | [**List<Category>**](Category.md) | List of Child Categories | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | -------------------------------------------------------------------------------- /docs/ChangeNotification.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.ChangeNotification 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **DigiKeyPartNumber** | **string** | The Digi-Key part number | [optional] 7 | **PcnChangeDate** | **string** | The release date of the product change notification. Date is in ISO 8601. | [optional] 8 | **PcnTypeId** | **string** | The product change notification category id - this is included for easy sorting | [optional] 9 | **PcnType** | **string** | The product change notification type - in the language of the user (if available) - otherwise English | [optional] 10 | **PcnDescription** | **string** | A brief description of the change. | [optional] 11 | **PcnLink** | **string** | The link to the online pdf describing the change. | [optional] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | -------------------------------------------------------------------------------- /docs/DigiReelPricingDto.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.DigiReelPricingDto 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **ReelingFee** | **double?** | Fee per reel ordered. | [optional] 7 | **UnitPrice** | **double?** | Price of a single unit of the product. | [optional] 8 | **ExtendedPrice** | **double?** | The total price of the requested reels and the reeling fee. | [optional] 9 | **RequestedQuantity** | **int?** | The passed in quantity of the product you are looking to create a Digi-Reel with. | [optional] 10 | **SearchLocaleUsed** | [**IsoSearchLocale**](IsoSearchLocale.md) | | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | -------------------------------------------------------------------------------- /docs/Filters.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.Filters 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **TaxonomyIds** | **List<int?>** | A collection of Taxonomy Ids to filter on. Ids can be found in the initial search response. A a full list ids can be found from the Search Categories endpoint | [optional] 7 | **ManufacturerIds** | **List<int?>** | A collection of Manufacturer Ids to filter on. Ids can be found in the initial search response. A a full list ids can be found from the Search Manufactures endpoint | [optional] 8 | **ParametricFilters** | [**List<ParametricFilter>**](ParametricFilter.md) | A collection of ParametricFilters. A ParametricFilter consists of a ParameterId and a ValueId. Those Ids can also be found in the Search response. | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | -------------------------------------------------------------------------------- /docs/IsoSearchLocale.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.IsoSearchLocale 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **Site** | **string** | The site used for the API call. | [optional] 7 | **Language** | **string** | The language used for the API call. If the provided language is not valid for the site, it will be set to the site default. | [optional] 8 | **Currency** | **string** | The currency used for the API call. If the provided currency is not valid for the site, it will be set to the site default. | [optional] 9 | **ShipToCountry** | **string** | The destination for shipping the product. This is used for tariffs and regional pricing. | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | -------------------------------------------------------------------------------- /docs/KeywordSearchRequest.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.KeywordSearchRequest 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **Keywords** | **string** | Keywords to search on. Can be a description, partial part number, manufacturer part number, or a Digi-Key part number. Keywords are required unless the Filters.TaxonomyIds is populated. An Empty string can be used when searching with Filters.TaxonomyIds | [optional] 7 | **RecordCount** | **int?** | Number of products to return between 1 and 50. | [optional] 8 | **RecordStartPosition** | **int?** | The starting index of the records returned. This is used to paginate beyond 50 results. | [optional] 9 | **Filters** | [**Filters**](Filters.md) | | [optional] 10 | **Sort** | [**SortParameters**](SortParameters.md) | | [optional] 11 | **RequestedQuantity** | **int?** | The quantity of the product you are looking to purchase. This is used with the SortByUnitPrice SortOption as price varies at differing quantities. | [optional] 12 | **SearchOptions** | [**List<SearchOption>**](SearchOption.md) | Filters the search results by the included SearchOption. | [optional] 13 | **ExcludeMarketPlaceProducts** | **bool?** | Used to exclude MarkPlace products from search results. Default is false | [optional] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | -------------------------------------------------------------------------------- /docs/KeywordSearchResponse.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.KeywordSearchResponse 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **LimitedTaxonomy** | [**LimitedTaxonomy**](LimitedTaxonomy.md) | | [optional] 7 | **FilterOptions** | [**List<LimitedParameter>**](LimitedParameter.md) | Available filters for narrowing down results. | [optional] 8 | **Products** | [**List<Product>**](Product.md) | List of products returned by KeywordSearch | [optional] 9 | **ProductsCount** | **int?** | Total number of matching products found. | [optional] 10 | **ExactManufacturerProductsCount** | **int?** | Number of exact ManufacturerPartNumber matches. | [optional] 11 | **ExactManufacturerProducts** | [**List<Product>**](Product.md) | List of products that are exact ManufacturerPartNumber matches. | [optional] 12 | **ExactDigiKeyProduct** | [**Product**](Product.md) | | [optional] 13 | **SearchLocaleUsed** | [**IsoSearchLocale**](IsoSearchLocale.md) | | [optional] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | -------------------------------------------------------------------------------- /docs/KitPart.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.KitPart 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **AssociatedProduct** | [**AssociatedProduct**](AssociatedProduct.md) | | [optional] 7 | **KitPartQuantity** | **int?** | Number of the product in the Kit. | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | -------------------------------------------------------------------------------- /docs/LimitedParameter.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.LimitedParameter 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **Values** | [**List<ValuePair>**](ValuePair.md) | List of values for the parameter that are contained in the products. | [optional] 7 | **ParameterId** | **int?** | The Id of the parameter. | [optional] 8 | **Parameter** | **string** | The name of the parameter. | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | -------------------------------------------------------------------------------- /docs/LimitedTaxonomy.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.LimitedTaxonomy 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **Children** | [**List<LimitedTaxonomy>**](LimitedTaxonomy.md) | List of taxonomies contained within this taxonomy. | [optional] 7 | **ProductCount** | **int?** | The number of products contained within this taxonomy. | [optional] 8 | **NewProductCount** | **int?** | The number of new products contained within this taxonomy. | [optional] 9 | **ParameterId** | **int?** | The Id of the parameter. | [optional] 10 | **ValueId** | **string** | The Id of the value. | [optional] 11 | **Parameter** | **string** | The name of the parameter. | [optional] 12 | **Value** | **string** | The name of the value. | [optional] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | -------------------------------------------------------------------------------- /docs/ManufacturerInfo.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.ManufacturerInfo 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **Id** | **int?** | Internal Id for the manufacturer | [optional] 7 | **Name** | **string** | Name of the manufacturer | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | -------------------------------------------------------------------------------- /docs/ManufacturerProductDetailsRequest.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.ManufacturerProductDetailsRequest 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **ManufacturerProduct** | **string** | Manufacturer product name to search on. | 7 | **RecordCount** | **int?** | Number of products to return between 1 and 50. | [optional] 8 | **RecordStartPosition** | **int?** | The starting index of the records returned. This is used to paginate beyond 50 results. | [optional] 9 | **Filters** | [**Filters**](Filters.md) | | [optional] 10 | **Sort** | [**SortParameters**](SortParameters.md) | | [optional] 11 | **RequestedQuantity** | **int?** | The quantity of the product you are looking to purchase. This is used with the SortByUnitPrice SortOption as price varies at differing quantities. | [optional] 12 | **SearchOptions** | [**List<SearchOption>**](SearchOption.md) | Filters the search results by the included SearchOption. | [optional] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | -------------------------------------------------------------------------------- /docs/ManufacturersResponse.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.ManufacturersResponse 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **Manufacturers** | [**List<ManufacturerInfo>**](ManufacturerInfo.md) | List of Manufacturer Information | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | -------------------------------------------------------------------------------- /docs/MediaLinks.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.MediaLinks 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **MediaType** | **string** | The type of media. | [optional] 7 | **Title** | **string** | The title of the media. | [optional] 8 | **SmallPhoto** | **string** | URL to a small photo. | [optional] 9 | **Thumbnail** | **string** | URL to the thumbnail image of the media. | [optional] 10 | **Url** | **string** | URL of the media. | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | -------------------------------------------------------------------------------- /docs/PackageTypeByQuantityProduct.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.PackageTypeByQuantityProduct 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **RecommendedQuantity** | **int?** | The quantity of this package type that is recommended given the provided quantity. | [optional] 7 | **MyPricing** | [**List<PriceBreak>**](PriceBreak.md) | Your pricing for the account with which you authenticated. Also dependent on locale information. | [optional] 8 | **Obsolete** | **bool?** | Indicates whether this Part is obsolete. | [optional] 9 | **MediaLinks** | [**List<MediaLinks>**](MediaLinks.md) | Collection of MediaLinks objects. These can contain links to datasheets, photos or manuals. | [optional] 10 | **StandardPackage** | **int?** | The number of products in the manufacturer's standard package. | [optional] 11 | **LimitedTaxonomy** | [**LimitedTaxonomy**](LimitedTaxonomy.md) | | [optional] 12 | **Kits** | [**List<AssociatedProduct>**](AssociatedProduct.md) | Kits that this product is contained in. | [optional] 13 | **KitContents** | [**List<KitPart>**](KitPart.md) | Products contained within this product. Only applicable if this product is a kit. | [optional] 14 | **MatingProducts** | [**List<AssociatedProduct>**](AssociatedProduct.md) | An association of same manufacturer products that mate with each other. | [optional] 15 | **SearchLocaleUsed** | [**IsoSearchLocale**](IsoSearchLocale.md) | | [optional] 16 | **AssociatedProducts** | [**List<AssociatedProduct>**](AssociatedProduct.md) | Products that are directly correlated to complete the intended function of the product. These products may be either same manufacturer or differ. | [optional] 17 | **ForUseWithProducts** | [**List<AssociatedProduct>**](AssociatedProduct.md) | Products that are directly correlated to complete the intended function of the product. These products may be either same manufacturer or differ. | [optional] 18 | **RohsSubs** | [**List<AssociatedProduct>**](AssociatedProduct.md) | Rohs substitutions | [optional] 19 | **SuggestedSubs** | [**List<AssociatedProduct>**](AssociatedProduct.md) | Suggested substitutions for when the product is obsolete. | [optional] 20 | **AdditionalValueFee** | **double?** | Any additional value fee. Most commonly the Digi-Reel fee. May be used for programmable parts as well. | [optional] 21 | **ReachEffectiveDate** | **string** | REACH effective date is string in format \"MMM-yyyy\" or blank \"\". REACH is a regulation of the European Union. See documentation from the European Chemicals Agency. | [optional] 22 | **StandardPricing** | [**List<PriceBreak>**](PriceBreak.md) | Standard pricing for the validated locale. | [optional] 23 | **RoHSStatus** | **string** | RoHS status. Can be: RoHS Compliant, RoHS non-compliant, RoHS Compliant By Exemption, Not Applicable, Vendor undefined, Request Inventory Verification, ROHS3 Compliant. | [optional] 24 | **LeadStatus** | **string** | Lead status. Can be: Lead Free, Contains lead, Lead Free By Exemption, Not Applicable, Vendor undefined, unknown, or Request Inventory Verification. | [optional] 25 | **Parameters** | [**List<PidVid>**](PidVid.md) | Parameters for the part. Can be used for filtering keyword searches. | [optional] 26 | **ProductUrl** | **string** | Full URL of the Digi-Key catalog page to purchase the product. This is based on your provided Locale values. | [optional] 27 | **PrimaryDatasheet** | **string** | The URL to the product's datasheet. | [optional] 28 | **PrimaryPhoto** | **string** | The URL to the product's image. | [optional] 29 | **PrimaryVideo** | **string** | The URL to the product's video. | [optional] 30 | **Series** | [**PidVid**](PidVid.md) | | [optional] 31 | **ManufacturerLeadWeeks** | **string** | The number of weeks expected to receive stock from manufacturer. | [optional] 32 | **ManufacturerPageUrl** | **string** | The URL to Digi-Key's page on the manufacturer. | [optional] 33 | **ProductStatus** | **string** | Status of the product. Options include: Active, Obsolete, Discontinued at Digi-Key, Last Time Buy, Not For New Designs, Preliminary. For obsolete parts the part will become a non-stocking item when stock is depleted; minimums will apply. Order the quantity available or the quantity available plus a multiple of the minimum order quantity. | [optional] 34 | **DateLastBuyChance** | **DateTime?** | Last date that the product will be available for purchase. Date is in ISO 8601. | [optional] 35 | **AlternatePackaging** | [**List<BasicProduct>**](BasicProduct.md) | Other packaging types available for this product. | [optional] 36 | **DetailedDescription** | **string** | Extended catalog description of the product. | [optional] 37 | **ReachStatus** | **string** | REACH is a regulation of the European Union. See documentation from the European Chemicals Agency. | [optional] 38 | **ExportControlClassNumber** | **string** | Export control class number. See documentation from the U.S. Department of Commerce. | [optional] 39 | **HTSUSCode** | **string** | Harmonized Tariff Schedule of the United States. See documentation from the U.S. International Trade Commission. | [optional] 40 | **TariffDescription** | **string** | Description of the tariff status. Only applies if purchasing in USD and shipping to the US. Valid options are No Tariff and Tariff Applied. | [optional] 41 | **ManufacturerPartNumber** | **string** | The manufacturer part number. Note that some manufacturer part numbers may be used by multiple manufacturers for different parts. | [optional] 42 | **MinimumOrderQuantity** | **int?** | The minimum quantity to order from Digi-Key. | [optional] 43 | **NonStock** | **bool?** | Indicates this product is a non stock product. | [optional] 44 | **Packaging** | [**PidVid**](PidVid.md) | | [optional] 45 | **QuantityAvailable** | **int?** | Quantity of the product available for immediate sale. | [optional] 46 | **DigiKeyPartNumber** | **string** | The Digi-Key part number. | [optional] 47 | **ProductDescription** | **string** | Catalog description of the product. | [optional] 48 | **UnitPrice** | **double?** | The price for a single unit of this product. | [optional] 49 | **Manufacturer** | [**PidVid**](PidVid.md) | | [optional] 50 | **ManufacturerPublicQuantity** | **int?** | Quantity of this product available to order from manufacturer. | [optional] 51 | **QuantityOnOrder** | **int?** | Quantity of this product ordered but not immediately available. | [optional] 52 | **DKPlusRestriction** | **bool?** | If true- this product is not available for purchase through the Ordering API - it must be purchased through the Digi-Key web site | [optional] 53 | **SupplierDirectShip** | **bool?** | If true- this product is shipped directly from the Supplier | [optional] 54 | 55 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 56 | 57 | -------------------------------------------------------------------------------- /docs/PackageTypeByQuantityResponse.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.PackageTypeByQuantityResponse 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **Products** | [**List<PackageTypeByQuantityProduct>**](PackageTypeByQuantityProduct.md) | List of products that matched the PackageTypeByQuantitySearchService request. | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | -------------------------------------------------------------------------------- /docs/ParametricFilter.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.ParametricFilter 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **ParameterId** | **int?** | The parameter identifier. | [optional] 7 | **ValueId** | **string** | The value identifier. | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | -------------------------------------------------------------------------------- /docs/PcnApi.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Api.PcnApi 2 | 3 | All URIs are relative to *https://api.digikey.com/ChangeNotifications/v3* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**ProductChangeNotifications**](PcnApi.md#productchangenotifications) | **GET** /Products/{DigiKeyPartNumber} | This returns all change notifications for the given DigiKey product. 8 | 9 | 10 | 11 | # **ProductChangeNotifications** 12 | > PcnResponse ProductChangeNotifications (string digiKeyPartNumber, string authorization, string xDIGIKEYClientId, string includes = null, string xDIGIKEYLocaleSite = null, string xDIGIKEYLocaleLanguage = null, string xDIGIKEYLocaleCurrency = null, string xDIGIKEYLocaleShipToCountry = null) 13 | 14 | This returns all change notifications for the given DigiKey product. 15 | 16 | ### Example 17 | ```csharp 18 | using System; 19 | using System.Diagnostics; 20 | using DigiKey.Api.Api; 21 | using DigiKey.Api.Client; 22 | using DigiKey.Api.Model; 23 | 24 | namespace Example 25 | { 26 | public class ProductChangeNotificationsExample 27 | { 28 | public void main() 29 | { 30 | // Configure API key authorization: apiKeySecurity 31 | Configuration.Default.AddApiKey("X-DIGIKEY-Client-Id", "YOUR_API_KEY"); 32 | // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 33 | // Configuration.Default.AddApiKeyPrefix("X-DIGIKEY-Client-Id", "Bearer"); 34 | // Configure OAuth2 access token for authorization: oauth2AccessCodeSecurity 35 | Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; 36 | 37 | var apiInstance = new PcnApi(); 38 | var digiKeyPartNumber = digiKeyPartNumber_example; // string | The product to retrieve change notifications for. 39 | var authorization = authorization_example; // string | OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. 40 | var xDIGIKEYClientId = xDIGIKEYClientId_example; // string | The Client Id for your App. 41 | var includes = includes_example; // string | Comma separated list of fields to return. Used to customize response to reduce bandwidth by selecting fields that you wish to receive. For example: \"ProductChangeNotifications\\[2\\](PcnType,PcnDescription)\" (optional) 42 | var xDIGIKEYLocaleSite = xDIGIKEYLocaleSite_example; // string | Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. (optional) 43 | var xDIGIKEYLocaleLanguage = xDIGIKEYLocaleLanguage_example; // string | Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. (optional) 44 | var xDIGIKEYLocaleCurrency = xDIGIKEYLocaleCurrency_example; // string | Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. (optional) 45 | var xDIGIKEYLocaleShipToCountry = xDIGIKEYLocaleShipToCountry_example; // string | ISO code for country to ship to. (optional) 46 | 47 | try 48 | { 49 | // This returns all change notifications for the given DigiKey product. 50 | PcnResponse result = apiInstance.ProductChangeNotifications(digiKeyPartNumber, authorization, xDIGIKEYClientId, includes, xDIGIKEYLocaleSite, xDIGIKEYLocaleLanguage, xDIGIKEYLocaleCurrency, xDIGIKEYLocaleShipToCountry); 51 | Debug.WriteLine(result); 52 | } 53 | catch (Exception e) 54 | { 55 | Debug.Print("Exception when calling PcnApi.ProductChangeNotifications: " + e.Message ); 56 | } 57 | } 58 | } 59 | } 60 | ``` 61 | 62 | ### Parameters 63 | 64 | Name | Type | Description | Notes 65 | ------------- | ------------- | ------------- | ------------- 66 | **digiKeyPartNumber** | **string**| The product to retrieve change notifications for. | 67 | **authorization** | **string**| OAuth Bearer Token. Please see<a href= \"https://developer.digikey.com/documentation/oauth\" target= \"_blank\" > OAuth 2.0 Documentation </a > page for more info. | 68 | **xDIGIKEYClientId** | **string**| The Client Id for your App. | 69 | **includes** | **string**| Comma separated list of fields to return. Used to customize response to reduce bandwidth by selecting fields that you wish to receive. For example: \"ProductChangeNotifications\\[2\\](PcnType,PcnDescription)\" | [optional] 70 | **xDIGIKEYLocaleSite** | **string**| Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. | [optional] 71 | **xDIGIKEYLocaleLanguage** | **string**| Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. | [optional] 72 | **xDIGIKEYLocaleCurrency** | **string**| Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. | [optional] 73 | **xDIGIKEYLocaleShipToCountry** | **string**| ISO code for country to ship to. | [optional] 74 | 75 | ### Return type 76 | 77 | [**PcnResponse**](PcnResponse.md) 78 | 79 | ### Authorization 80 | 81 | [apiKeySecurity](../README.md#apiKeySecurity), [oauth2AccessCodeSecurity](../README.md#oauth2AccessCodeSecurity) 82 | 83 | ### HTTP request headers 84 | 85 | - **Content-Type**: Not defined 86 | - **Accept**: application/json 87 | 88 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 89 | 90 | -------------------------------------------------------------------------------- /docs/PcnResponse.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.PcnResponse 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **DigiKeyPartNumber** | **string** | The product for which we are returning the change notifications. | 7 | **ProductChangeNotifications** | [**List<ChangeNotification>**](ChangeNotification.md) | The list of change notifications for the requested product. | 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | -------------------------------------------------------------------------------- /docs/PidVid.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.PidVid 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **ParameterId** | **int?** | The Id of the parameter. | [optional] 7 | **ValueId** | **string** | The Id of the value. | [optional] 8 | **Parameter** | **string** | The name of the parameter. | [optional] 9 | **Value** | **string** | The name of the value. | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | -------------------------------------------------------------------------------- /docs/PriceBreak.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.PriceBreak 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **BreakQuantity** | **int?** | Price tiers based on the available quantities of the product. | [optional] 7 | **UnitPrice** | **double?** | Price of a single unit of the product at this break. | [optional] 8 | **TotalPrice** | **double?** | Price of BreakQuantity units of the product. | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | -------------------------------------------------------------------------------- /docs/Product.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.Product 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **StandardPricing** | [**List<PriceBreak>**](PriceBreak.md) | Standard pricing for the validated locale. | [optional] 7 | **RoHSStatus** | **string** | RoHS status. Can be: RoHS Compliant, RoHS non-compliant, RoHS Compliant By Exemption, Not Applicable, Vendor undefined, Request Inventory Verification, ROHS3 Compliant. | [optional] 8 | **LeadStatus** | **string** | Lead status. Can be: Lead Free, Contains lead, Lead Free By Exemption, Not Applicable, Vendor undefined, unknown, or Request Inventory Verification. | [optional] 9 | **Parameters** | [**List<PidVid>**](PidVid.md) | Parameters for the part. Can be used for filtering keyword searches. | [optional] 10 | **ProductUrl** | **string** | Full URL of the Digi-Key catalog page to purchase the product. This is based on your provided Locale values. | [optional] 11 | **PrimaryDatasheet** | **string** | The URL to the product's datasheet. | [optional] 12 | **PrimaryPhoto** | **string** | The URL to the product's image. | [optional] 13 | **PrimaryVideo** | **string** | The URL to the product's video. | [optional] 14 | **Series** | [**PidVid**](PidVid.md) | | [optional] 15 | **ManufacturerLeadWeeks** | **string** | The number of weeks expected to receive stock from manufacturer. | [optional] 16 | **ManufacturerPageUrl** | **string** | The URL to Digi-Key's page on the manufacturer. | [optional] 17 | **ProductStatus** | **string** | Status of the product. Options include: Active, Obsolete, Discontinued at Digi-Key, Last Time Buy, Not For New Designs, Preliminary. For obsolete parts the part will become a non-stocking item when stock is depleted; minimums will apply. Order the quantity available or the quantity available plus a multiple of the minimum order quantity. | [optional] 18 | **DateLastBuyChance** | **DateTime?** | Last date that the product will be available for purchase. Date is in ISO 8601. | [optional] 19 | **AlternatePackaging** | [**List<BasicProduct>**](BasicProduct.md) | Other packaging types available for this product. | [optional] 20 | **DetailedDescription** | **string** | Extended catalog description of the product. | [optional] 21 | **ReachStatus** | **string** | REACH is a regulation of the European Union. See documentation from the European Chemicals Agency. | [optional] 22 | **ExportControlClassNumber** | **string** | Export control class number. See documentation from the U.S. Department of Commerce. | [optional] 23 | **HTSUSCode** | **string** | Harmonized Tariff Schedule of the United States. See documentation from the U.S. International Trade Commission. | [optional] 24 | **TariffDescription** | **string** | Description of the tariff status. Only applies if purchasing in USD and shipping to the US. Valid options are No Tariff and Tariff Applied. | [optional] 25 | **MoistureSensitivityLevel** | **string** | Code for Moisture Sensitivity Level of the product | [optional] 26 | **Family** | [**PidVid**](PidVid.md) | | [optional] 27 | **Category** | [**PidVid**](PidVid.md) | | [optional] 28 | **ManufacturerPartNumber** | **string** | The manufacturer part number. Note that some manufacturer part numbers may be used by multiple manufacturers for different parts. | [optional] 29 | **MinimumOrderQuantity** | **int?** | The minimum quantity to order from Digi-Key. | [optional] 30 | **NonStock** | **bool?** | Indicates this product is a non stock product. | [optional] 31 | **Packaging** | [**PidVid**](PidVid.md) | | [optional] 32 | **QuantityAvailable** | **int?** | Quantity of the product available for immediate sale. | [optional] 33 | **DigiKeyPartNumber** | **string** | The Digi-Key part number. | [optional] 34 | **ProductDescription** | **string** | Catalog description of the product. | [optional] 35 | **UnitPrice** | **double?** | The price for a single unit of this product. | [optional] 36 | **Manufacturer** | [**PidVid**](PidVid.md) | | [optional] 37 | **ManufacturerPublicQuantity** | **int?** | Quantity of this product available to order from manufacturer. | [optional] 38 | **QuantityOnOrder** | **int?** | Quantity of this product ordered but not immediately available. | [optional] 39 | **DKPlusRestriction** | **bool?** | If true- this product is not available for purchase through the Ordering API - it must be purchased through the Digi-Key web site | [optional] 40 | **Marketplace** | **bool?** | Product is a Marketplace product that ships direct from the supplier. A separate shipping fee may apply | [optional] 41 | **SupplierDirectShip** | **bool?** | If true- this product is shipped directly from the Supplier | [optional] 42 | **PimProductName** | **string** | Pim name for the product | [optional] 43 | **Supplier** | **string** | The Supplier is the provider of the products to Digi-Key and some cases the customer directly. | [optional] 44 | **SupplierId** | **int?** | Id for Supplier | [optional] 45 | 46 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 47 | 48 | -------------------------------------------------------------------------------- /docs/ProductDetailsResponse.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.ProductDetailsResponse 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **ProductDetails** | [**List<ProductDetails>**](ProductDetails.md) | List of ProductDetails | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | -------------------------------------------------------------------------------- /docs/ProductTracingApi.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Api.ProductTracingApi 2 | 3 | All URIs are relative to *https://api.digikey.com/ProductTracing/v1* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**Details**](ProductTracingApi.md#details) | **GET** /Details/{tracingId} | Retrieve detailed information about the product being traced 8 | 9 | 10 | 11 | # **Details** 12 | > ProductTracingResponse Details (string tracingId, string authorization, string xDIGIKEYClientId, string xDIGIKEYCustomerId = null) 13 | 14 | Retrieve detailed information about the product being traced 15 | 16 | ### Example 17 | ```csharp 18 | using System; 19 | using System.Diagnostics; 20 | using DigiKey.Api.Api; 21 | using DigiKey.Api.Client; 22 | using DigiKey.Api.Model; 23 | 24 | namespace Example 25 | { 26 | public class DetailsExample 27 | { 28 | public void main() 29 | { 30 | // Configure API key authorization: apiKeySecurity 31 | Configuration.Default.AddApiKey("X-DIGIKEY-Client-Id", "YOUR_API_KEY"); 32 | // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 33 | // Configuration.Default.AddApiKeyPrefix("X-DIGIKEY-Client-Id", "Bearer"); 34 | // Configure OAuth2 access token for authorization: oauth2AccessCodeSecurity 35 | Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; 36 | 37 | var apiInstance = new ProductTracingApi(); 38 | var tracingId = tracingId_example; // string | The tracing Id of the product being traced 39 | var authorization = authorization_example; // string | OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. 40 | var xDIGIKEYClientId = xDIGIKEYClientId_example; // string | The Client Id for your App. 41 | var xDIGIKEYCustomerId = xDIGIKEYCustomerId_example; // string | Your Digi-Key Customer id. If your account has multiple Customer Ids for different regions, this allows you to select one of them. (optional) 42 | 43 | try 44 | { 45 | // Retrieve detailed information about the product being traced 46 | ProductTracingResponse result = apiInstance.Details(tracingId, authorization, xDIGIKEYClientId, xDIGIKEYCustomerId); 47 | Debug.WriteLine(result); 48 | } 49 | catch (Exception e) 50 | { 51 | Debug.Print("Exception when calling ProductTracingApi.Details: " + e.Message ); 52 | } 53 | } 54 | } 55 | } 56 | ``` 57 | 58 | ### Parameters 59 | 60 | Name | Type | Description | Notes 61 | ------------- | ------------- | ------------- | ------------- 62 | **tracingId** | **string**| The tracing Id of the product being traced | 63 | **authorization** | **string**| OAuth Bearer Token. Please see<a href= \"https://developer.digikey.com/documentation/oauth\" target= \"_blank\" > OAuth 2.0 Documentation </a > page for more info. | 64 | **xDIGIKEYClientId** | **string**| The Client Id for your App. | 65 | **xDIGIKEYCustomerId** | **string**| Your Digi-Key Customer id. If your account has multiple Customer Ids for different regions, this allows you to select one of them. | [optional] 66 | 67 | ### Return type 68 | 69 | [**ProductTracingResponse**](ProductTracingResponse.md) 70 | 71 | ### Authorization 72 | 73 | [apiKeySecurity](../README.md#apiKeySecurity), [oauth2AccessCodeSecurity](../README.md#oauth2AccessCodeSecurity) 74 | 75 | ### HTTP request headers 76 | 77 | - **Content-Type**: Not defined 78 | - **Accept**: application/json 79 | 80 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 81 | 82 | -------------------------------------------------------------------------------- /docs/ProductTracingResponse.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.ProductTracingResponse 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **Description** | **string** | | [optional] 7 | **CustomerPurchaseOrder** | **string** | | [optional] 8 | **CustomerReference** | **string** | | [optional] 9 | **CountryOfOrigin** | **string** | | [optional] 10 | **DateCode** | **string** | | [optional] 11 | **DetailId** | **int?** | | [optional] 12 | **InvoiceId** | **long?** | | [optional] 13 | **LotCode** | **string** | | [optional] 14 | **ManufacturerProductNumber** | **string** | | [optional] 15 | **DigiKeyProductNumber** | **string** | | [optional] 16 | **Quantity** | **int?** | | [optional] 17 | **SalesOrderId** | **long?** | | [optional] 18 | **TracingId** | **string** | | [optional] 19 | 20 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 21 | 22 | -------------------------------------------------------------------------------- /docs/ProductWithSuggestions.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.ProductWithSuggestions 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **Product** | [**ProductDetails**](ProductDetails.md) | | [optional] 7 | **SuggestedProducts** | [**List<Product>**](Product.md) | | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | -------------------------------------------------------------------------------- /docs/RecommendedProduct.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.RecommendedProduct 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **DigiKeyPartNumber** | **string** | The Digi-Key part number. | [optional] 7 | **ManufacturerPartNumber** | **string** | The manufacturer part number. | [optional] 8 | **ManufacturerName** | **string** | The name of the manufacturer. | [optional] 9 | **PrimaryPhoto** | **string** | The URL to the product’s image. | [optional] 10 | **ProductDescription** | **string** | Catalog description of the product. | [optional] 11 | **QuantityAvailable** | **int?** | Quantity of the product available for immediate sale. | [optional] 12 | **UnitPrice** | **double?** | The catalog price for a single unit of this product. | [optional] 13 | **ProductUrl** | **string** | URL of the Digi-Key catalog page to purchase the product. This is based on your provided header Locale values. | [optional] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | -------------------------------------------------------------------------------- /docs/RecommendedProductsCollection.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.RecommendedProductsCollection 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **PartNumber** | **string** | The part number that the recommendations are for. | [optional] 7 | **RecommendedProducts** | [**List<RecommendedProduct>**](RecommendedProduct.md) | The list of recommended products. | [optional] 8 | **SearchLocaleUsed** | [**IsoSearchLocale**](IsoSearchLocale.md) | | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | -------------------------------------------------------------------------------- /docs/RecommendedProductsResponse.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.RecommendedProductsResponse 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **RecommendedProductsCollection** | [**List<RecommendedProductsCollection>**](RecommendedProductsCollection.md) | The list of RecommendedProductsCollections - each containing a Product and its recommendations. | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | -------------------------------------------------------------------------------- /docs/SearchOption.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.SearchOption 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | 7 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 8 | 9 | -------------------------------------------------------------------------------- /docs/SortDirection.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.SortDirection 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | 7 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 8 | 9 | -------------------------------------------------------------------------------- /docs/SortOption.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.SortOption 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | 7 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 8 | 9 | -------------------------------------------------------------------------------- /docs/SortParameters.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.SortParameters 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **SortOption** | **SortOption** | | 7 | **Direction** | **SortDirection** | | 8 | **SortParameterId** | **int?** | The ParameterId of the parameter to sort on. The ParameterId can be found in the Search response. This is only used with SortByParameter. | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | -------------------------------------------------------------------------------- /docs/TaxonomyApi.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Api.TaxonomyApi 2 | 3 | All URIs are relative to *https://api.digikey.com/taxonomysearch/v3* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**TaxonomySearch**](TaxonomyApi.md#taxonomysearch) | **GET** /{category} | Retrieves a URL to a filtered partsearch page. Any filter names and values may be used as query parameters as long as it exists for the category. For example: \"color=black\". However, these cannot be entered on the Swagger page. 8 | 9 | 10 | 11 | # **TaxonomySearch** 12 | > string TaxonomySearch (string category, string authorization, string xDIGIKEYClientId) 13 | 14 | Retrieves a URL to a filtered partsearch page. Any filter names and values may be used as query parameters as long as it exists for the category. For example: \"color=black\". However, these cannot be entered on the Swagger page. 15 | 16 | ### Example 17 | ```csharp 18 | using System; 19 | using System.Diagnostics; 20 | using DigiKey.Api.Api; 21 | using DigiKey.Api.Client; 22 | using DigiKey.Api.Model; 23 | 24 | namespace Example 25 | { 26 | public class TaxonomySearchExample 27 | { 28 | public void main() 29 | { 30 | // Configure API key authorization: apiKeySecurity 31 | Configuration.Default.AddApiKey("X-DIGIKEY-Client-Id", "YOUR_API_KEY"); 32 | // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 33 | // Configuration.Default.AddApiKeyPrefix("X-DIGIKEY-Client-Id", "Bearer"); 34 | // Configure OAuth2 access token for authorization: oauth2AccessCodeSecurity 35 | Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; 36 | 37 | var apiInstance = new TaxonomyApi(); 38 | var category = category_example; // string | Category name to filter within. If the category has a parent it can be included as \"parent:child\". If no parent is provided, only child categories are searched. Note that some child categories exist in multiple parents. 39 | var authorization = authorization_example; // string | OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. 40 | var xDIGIKEYClientId = xDIGIKEYClientId_example; // string | The Client Id for your App. 41 | 42 | try 43 | { 44 | // Retrieves a URL to a filtered partsearch page. Any filter names and values may be used as query parameters as long as it exists for the category. For example: \"color=black\". However, these cannot be entered on the Swagger page. 45 | string result = apiInstance.TaxonomySearch(category, authorization, xDIGIKEYClientId); 46 | Debug.WriteLine(result); 47 | } 48 | catch (Exception e) 49 | { 50 | Debug.Print("Exception when calling TaxonomyApi.TaxonomySearch: " + e.Message ); 51 | } 52 | } 53 | } 54 | } 55 | ``` 56 | 57 | ### Parameters 58 | 59 | Name | Type | Description | Notes 60 | ------------- | ------------- | ------------- | ------------- 61 | **category** | **string**| Category name to filter within. If the category has a parent it can be included as \"parent:child\". If no parent is provided, only child categories are searched. Note that some child categories exist in multiple parents. | 62 | **authorization** | **string**| OAuth Bearer Token. Please see<a href= \"https://developer.digikey.com/documentation/oauth\" target= \"_blank\" > OAuth 2.0 Documentation </a > page for more info. | 63 | **xDIGIKEYClientId** | **string**| The Client Id for your App. | 64 | 65 | ### Return type 66 | 67 | **string** 68 | 69 | ### Authorization 70 | 71 | [apiKeySecurity](../README.md#apiKeySecurity), [oauth2AccessCodeSecurity](../README.md#oauth2AccessCodeSecurity) 72 | 73 | ### HTTP request headers 74 | 75 | - **Content-Type**: Not defined 76 | - **Accept**: text/plain, application/json, text/json 77 | 78 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 79 | 80 | -------------------------------------------------------------------------------- /docs/ValuePair.md: -------------------------------------------------------------------------------- 1 | # DigiKey.Api.Model.ValuePair 2 | ## Properties 3 | 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **ValueId** | **string** | The Id of the value. | [optional] 7 | **Value** | **string** | The name of the value. | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | --------------------------------------------------------------------------------