791ebf4f78
This PR contains the work done to implement the `UserAgentMiddleware` middleware that includes user agent information into a header of the requests sent by the `Client` type, as defined in the [Discogs documentation](https://www.discogs.com/developers/#page:home,header:home-general-information). For this purpose, the `CamelCaseValidationRule`, `SemanticVersionValidationRule` and `URLValidationRule` types were implemented and integrated into the existing `ValidateInputUseCase` type. Reviewed-on: #6 Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
1 line
14 KiB
JSON
1 line
14 KiB
JSON
{"identifier":{"url":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client\/getReleaseStats(path:headers:)","interfaceLanguage":"swift"},"hierarchy":{"paths":[["doc:\/\/DiscogsService\/documentation\/DiscogsService","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client"]]},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/discogsservice\/client\/getreleasestats(path:headers:)"]}],"sections":[],"abstract":[{"text":"Get information about statistics of release.","type":"text"}],"metadata":{"extendedModule":"DiscogsService","fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getReleaseStats","kind":"identifier"},{"text":"(","kind":"text"},{"text":"path","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"Operations","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"getReleaseStats","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO"},{"text":".","kind":"text"},{"text":"Input","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO5InputV"},{"text":".","kind":"text"},{"text":"Path","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO5InputV4PathV"},{"text":", ","kind":"text"},{"text":"headers","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"Operations","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"getReleaseStats","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO"},{"text":".","kind":"text"},{"text":"Input","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO5InputV"},{"text":".","kind":"text"},{"text":"Headers","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO5InputV7HeadersV"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> ","kind":"text"},{"text":"Operations","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"getReleaseStats","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO"},{"text":".","kind":"text"},{"text":"Output","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO6OutputO"}],"modules":[{"name":"DiscogsService"}],"roleHeading":"Instance Method","role":"symbol","externalID":"s:14DiscogsService11APIProtocolPAAE15getReleaseStats4path7headersAA10OperationsOADO6OutputOAI5InputV4PathV_AM7HeadersVtYaKF::SYNTHESIZED::s:14DiscogsService6ClientV","symbolKind":"method","title":"getReleaseStats(path:headers:)"},"kind":"symbol","primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getReleaseStats","kind":"identifier"},{"text":"(","kind":"text"},{"text":"path","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"Operations","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"getReleaseStats","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseStats","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO"},{"text":".","kind":"text"},{"text":"Input","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseStats\/Input","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO5InputV"},{"text":".","kind":"text"},{"text":"Path","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseStats\/Input\/Path-swift.struct","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO5InputV4PathV"},{"text":", ","kind":"text"},{"text":"headers","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"Operations","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"getReleaseStats","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseStats","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO"},{"text":".","kind":"text"},{"text":"Input","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseStats\/Input","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO5InputV"},{"text":".","kind":"text"},{"text":"Headers","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseStats\/Input\/Headers-swift.struct","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO5InputV7HeadersV"},{"text":" = .init()) ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> ","kind":"text"},{"text":"Operations","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"getReleaseStats","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseStats","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO"},{"text":".","kind":"text"},{"text":"Output","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseStats\/Output","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO6OutputO"}],"platforms":["macOS"],"languages":["swift"]}]},{"kind":"content","content":[{"level":2,"text":"Discussion","anchor":"discussion","type":"heading"},{"inlineContent":[{"type":"text","text":"Retrieves the total number of “haves” (in the community’s collections) and “wants” (in the community’s wantlists) for a given release."}],"type":"paragraph"},{"content":[{"type":"paragraph","inlineContent":[{"text":"HTTP ","type":"text"},{"code":"GET \/releases\/{release_id}\/stats","type":"codeVoice"},{"text":".","type":"text"}]}],"name":"Remark","style":"note","type":"aside"},{"content":[{"type":"paragraph","inlineContent":[{"text":"Generated from ","type":"text"},{"code":"#\/paths\/\/releases\/{release_id}\/stats\/get(getReleaseStats)","type":"codeVoice"},{"text":".","type":"text"}]}],"name":"Remark","style":"note","type":"aside"}]}],"schemaVersion":{"patch":0,"major":0,"minor":3},"references":{"doc://DiscogsService/documentation/DiscogsService/Client/getReleaseStats(path:headers:)":{"title":"getReleaseStats(path:headers:)","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client\/getReleaseStats(path:headers:)","kind":"symbol","abstract":[{"text":"Get information about statistics of release.","type":"text"}],"role":"symbol","type":"topic","fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getReleaseStats","kind":"identifier"},{"text":"(","kind":"text"},{"text":"path","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"Operations","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"getReleaseStats","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO"},{"text":".","kind":"text"},{"text":"Input","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO5InputV"},{"text":".","kind":"text"},{"text":"Path","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO5InputV4PathV"},{"text":", ","kind":"text"},{"text":"headers","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"Operations","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"getReleaseStats","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO"},{"text":".","kind":"text"},{"text":"Input","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO5InputV"},{"text":".","kind":"text"},{"text":"Headers","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO5InputV7HeadersV"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> ","kind":"text"},{"text":"Operations","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"getReleaseStats","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO"},{"text":".","kind":"text"},{"text":"Output","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15getReleaseStatsO6OutputO"}],"url":"\/documentation\/discogsservice\/client\/getreleasestats(path:headers:)"},"doc://DiscogsService/documentation/DiscogsService/Operations/getReleaseStats/Input/Path-swift.struct":{"title":"Operations.getReleaseStats.Input.Path","navigatorTitle":[{"text":"Path","kind":"identifier"}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseStats\/Input\/Path-swift.struct","kind":"symbol","abstract":[],"role":"symbol","type":"topic","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Path","kind":"identifier"}],"url":"\/documentation\/discogsservice\/operations\/getreleasestats\/input\/path-swift.struct"},"doc://DiscogsService/documentation/DiscogsService/Operations/getReleaseStats/Output":{"fragments":[{"text":"enum","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Output","kind":"identifier"}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseStats\/Output","kind":"symbol","title":"Operations.getReleaseStats.Output","role":"symbol","url":"\/documentation\/discogsservice\/operations\/getreleasestats\/output","type":"topic","abstract":[],"navigatorTitle":[{"text":"Output","kind":"identifier"}]},"doc://DiscogsService/documentation/DiscogsService":{"title":"DiscogsService","role":"collection","abstract":[],"kind":"symbol","type":"topic","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService","url":"\/documentation\/discogsservice"},"doc://DiscogsService/documentation/DiscogsService/Operations/getReleaseStats/Input":{"title":"Operations.getReleaseStats.Input","navigatorTitle":[{"text":"Input","kind":"identifier"}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseStats\/Input","kind":"symbol","abstract":[],"role":"symbol","type":"topic","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Input"}],"url":"\/documentation\/discogsservice\/operations\/getreleasestats\/input"},"doc://DiscogsService/documentation/DiscogsService/Operations/getReleaseStats":{"abstract":[{"type":"text","text":"Get information about statistics of release."}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseStats","type":"topic","kind":"symbol","url":"\/documentation\/discogsservice\/operations\/getreleasestats","role":"symbol","navigatorTitle":[{"text":"getReleaseStats","kind":"identifier"}],"fragments":[{"text":"enum","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getReleaseStats","kind":"identifier"}],"title":"Operations.getReleaseStats"},"doc://DiscogsService/documentation/DiscogsService/Operations":{"type":"topic","title":"Operations","navigatorTitle":[{"text":"Operations","kind":"identifier"}],"abstract":[{"type":"text","text":"API operations, with input and output types, generated from "},{"type":"codeVoice","code":"#\/paths"},{"type":"text","text":" in the OpenAPI document."}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations","role":"symbol","url":"\/documentation\/discogsservice\/operations","fragments":[{"text":"enum","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Operations","kind":"identifier"}],"kind":"symbol"},"doc://DiscogsService/documentation/DiscogsService/Client":{"url":"\/documentation\/discogsservice\/client","type":"topic","title":"Client","kind":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Client","kind":"identifier"}],"navigatorTitle":[{"text":"Client","kind":"identifier"}],"abstract":[{"text":"The Discogs API v2.0 is a RESTful interface to Discogs data. You can access JSON-formatted information about Database objects such as ","type":"text"},{"inlineContent":[{"type":"text","text":"Artists"}],"type":"emphasis"},{"text":", ","type":"text"},{"inlineContent":[{"type":"text","text":"Releases"}],"type":"emphasis"},{"text":", and ","type":"text"},{"inlineContent":[{"type":"text","text":"Labels"}],"type":"emphasis"},{"text":". Your application can also manage ","type":"text"},{"inlineContent":[{"type":"text","text":"User Collections"}],"type":"emphasis"},{"text":" and ","type":"text"},{"inlineContent":[{"type":"text","text":"Wantlists"}],"type":"emphasis"},{"text":", create ","type":"text"},{"inlineContent":[{"type":"text","text":"Marketplace"}],"type":"emphasis"},{"text":" listings, and more.","type":"text"}],"role":"symbol","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client"},"doc://DiscogsService/documentation/DiscogsService/Operations/getReleaseStats/Input/Headers-swift.struct":{"title":"Operations.getReleaseStats.Input.Headers","navigatorTitle":[{"text":"Headers","kind":"identifier"}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/getReleaseStats\/Input\/Headers-swift.struct","kind":"symbol","abstract":[],"role":"symbol","type":"topic","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Headers","kind":"identifier"}],"url":"\/documentation\/discogsservice\/operations\/getreleasestats\/input\/headers-swift.struct"}}} |