Files
discogs-service/docs/data/documentation/discogsservice/client/init(serverurl:configuration:transport:middlewares:).json
T
javier 791ebf4f78 Implemented the User Agent middleware (#6)
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>
2025-10-13 00:54:17 +00:00

1 line
7.1 KiB
JSON

{"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client\/init(serverURL:configuration:transport:middlewares:)"},"abstract":[{"type":"text","text":"Creates a new client."}],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/discogsservice\/client\/init(serverurl:configuration:transport:middlewares:)"]}],"metadata":{"modules":[{"name":"DiscogsService"}],"externalID":"s:14DiscogsService6ClientV9serverURL13configuration9transport11middlewaresAC10Foundation0E0V_14OpenAPIRuntime13ConfigurationVAK0C9Transport_pSayAK0C10Middleware_pGtcfc","symbolKind":"init","title":"init(serverURL:configuration:transport:middlewares:)","roleHeading":"Initializer","fragments":[{"text":"init","kind":"identifier"},{"kind":"text","text":"("},{"kind":"externalParam","text":"serverURL"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"URL","preciseIdentifier":"s:10Foundation3URLV"},{"text":", ","kind":"text"},{"kind":"externalParam","text":"configuration"},{"text":": ","kind":"text"},{"kind":"typeIdentifier","text":"Configuration","preciseIdentifier":"s:14OpenAPIRuntime13ConfigurationV"},{"kind":"text","text":", "},{"kind":"externalParam","text":"transport"},{"kind":"text","text":": any "},{"kind":"typeIdentifier","text":"ClientTransport","preciseIdentifier":"s:14OpenAPIRuntime15ClientTransportP"},{"kind":"text","text":", "},{"kind":"externalParam","text":"middlewares"},{"text":": [any ","kind":"text"},{"kind":"typeIdentifier","text":"ClientMiddleware","preciseIdentifier":"s:14OpenAPIRuntime16ClientMiddlewareP"},{"kind":"text","text":"])"}],"role":"symbol"},"primaryContentSections":[{"declarations":[{"languages":["swift"],"platforms":["macOS"],"tokens":[{"kind":"keyword","text":"init"},{"text":"(","kind":"text"},{"text":"serverURL","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"URL","kind":"typeIdentifier","preciseIdentifier":"s:10Foundation3URLV"},{"text":", ","kind":"text"},{"text":"configuration","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"Configuration","kind":"typeIdentifier","preciseIdentifier":"s:14OpenAPIRuntime13ConfigurationV"},{"text":" = .init(), ","kind":"text"},{"text":"transport","kind":"externalParam"},{"text":": any ","kind":"text"},{"text":"ClientTransport","kind":"typeIdentifier","preciseIdentifier":"s:14OpenAPIRuntime15ClientTransportP"},{"text":", ","kind":"text"},{"text":"middlewares","kind":"externalParam"},{"text":": [any ","kind":"text"},{"text":"ClientMiddleware","kind":"typeIdentifier","preciseIdentifier":"s:14OpenAPIRuntime16ClientMiddlewareP"},{"text":"] = [])","kind":"text"}]}],"kind":"declarations"},{"parameters":[{"name":"serverURL","content":[{"inlineContent":[{"type":"text","text":"The server URL that the client connects to. Any server"},{"type":"text","text":" "},{"type":"text","text":"URLs defined in the OpenAPI document are available as static methods"},{"text":" ","type":"text"},{"text":"on the ","type":"text"},{"type":"reference","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Servers","isActive":true},{"type":"text","text":" type."}],"type":"paragraph"}]},{"name":"configuration","content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"A set of configuration values for the client."}]}]},{"name":"transport","content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"A transport that performs HTTP operations."}]}]},{"name":"middlewares","content":[{"inlineContent":[{"text":"A list of middlewares to call before the transport.","type":"text"}],"type":"paragraph"}]}],"kind":"parameters"}],"kind":"symbol","schemaVersion":{"major":0,"patch":0,"minor":3},"sections":[],"hierarchy":{"paths":[["doc:\/\/DiscogsService\/documentation\/DiscogsService","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client"]]},"references":{"doc://DiscogsService/documentation/DiscogsService/Client/init(serverURL:configuration:transport:middlewares:)":{"role":"symbol","title":"init(serverURL:configuration:transport:middlewares:)","kind":"symbol","type":"topic","abstract":[{"text":"Creates a new client.","type":"text"}],"url":"\/documentation\/discogsservice\/client\/init(serverurl:configuration:transport:middlewares:)","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client\/init(serverURL:configuration:transport:middlewares:)","fragments":[{"text":"init","kind":"identifier"},{"text":"(","kind":"text"},{"text":"serverURL","kind":"externalParam"},{"text":": ","kind":"text"},{"text":"URL","preciseIdentifier":"s:10Foundation3URLV","kind":"typeIdentifier"},{"text":", ","kind":"text"},{"kind":"externalParam","text":"configuration"},{"kind":"text","text":": "},{"kind":"typeIdentifier","preciseIdentifier":"s:14OpenAPIRuntime13ConfigurationV","text":"Configuration"},{"text":", ","kind":"text"},{"text":"transport","kind":"externalParam"},{"text":": any ","kind":"text"},{"preciseIdentifier":"s:14OpenAPIRuntime15ClientTransportP","text":"ClientTransport","kind":"typeIdentifier"},{"text":", ","kind":"text"},{"text":"middlewares","kind":"externalParam"},{"text":": [any ","kind":"text"},{"preciseIdentifier":"s:14OpenAPIRuntime16ClientMiddlewareP","text":"ClientMiddleware","kind":"typeIdentifier"},{"text":"])","kind":"text"}]},"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/Servers":{"title":"Servers","kind":"symbol","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Servers","abstract":[{"type":"text","text":"Server URLs defined in the OpenAPI document."}],"navigatorTitle":[{"text":"Servers","kind":"identifier"}],"fragments":[{"text":"enum","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Servers","kind":"identifier"}],"role":"symbol","type":"topic","url":"\/documentation\/discogsservice\/servers"},"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"}}}