Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generated catalog models #17

Closed
wants to merge 2 commits into from

Conversation

michpohl
Copy link
Contributor

@michpohl michpohl commented Jun 18, 2024

This adds generated catalog code made using openapi-generator-cli from our catalog API endpoint definitions.
Only changes necessary to make it compile in our codebase have been made (see commit descriptions).

This is a temporary version intended for prototyping. It will be subject to change.
The generated code has a lot of small issues, but if you're looking to use just the types, you'll be fine.

This will also not be released publicly. If you have trouble creating a local release to work with this hit me up, and I'll shoe you how.

@michpohl michpohl force-pushed the michael/Add-generated-catalog-models branch from 5f22230 to ba8d46a Compare June 18, 2024 15:47
michpohl added 2 commits June 19, 2024 07:21
The following commit will contain generated code that does not at all comply with our lint settings. This commit changes them so it will pass.
It's an isolated commit so it can be reversed once we've fixed this in the future
This is an API client generated by openapi-generator-cli

Only changes made to this are:
- Adding dependencies to our version catalog
- Changing package structure to fit with the SDK paradigm

This state is temporary.
@michpohl michpohl force-pushed the michael/Add-generated-catalog-models branch from ba8d46a to 12e663e Compare June 19, 2024 05:35
@michpohl michpohl requested review from a team and ksloginov June 19, 2024 05:37
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The namings of the files are weird (APIApi) - intended?


package com.tidal.sdk.catalog.models

import com.squareup.moshi.Json

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is using moshi instead of kotlinx.serialization. Any reason for that?

*/
@Suppress("UNCHECKED_CAST")
@Throws(IllegalStateException::class, IOException::class)
fun getArtistWithHttpInfo(id: kotlin.String, countryCode: kotlin.String, include: kotlin.collections.List<kotlin.String>?) : ApiResponse<ArtistDataDocument?> {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come these are not suspend funs?


val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody()

@TargetApi(26)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we cool to raise the app api to 26?


val apiKey: MutableMap<String, String> = mutableMapOf()
val apiKeyPrefix: MutableMap<String, String> = mutableMapOf()
var username: String? = null

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these seem to be unused

protected const val XML_MEDIA_TYPE = "application/xml"
protected const val OCTET_MEDIA_TYPE = "application/octet-stream"

val apiKey: MutableMap<String, String> = mutableMapOf()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exposing mutable maps is quite meh, no?

@michpohl michpohl closed this Jun 19, 2024
@michpohl michpohl deleted the michael/Add-generated-catalog-models branch June 19, 2024 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants