Skip to content

Commit 34a9ee0

Browse files
committed
update remaining enum entries to use PascalCase
1 parent 99d6c98 commit 34a9ee0

File tree

33 files changed

+300
-298
lines changed

33 files changed

+300
-298
lines changed

src/androidMain/kotlin/com/adamratzman/spotify/utils/PlatformUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ internal actual fun String.encodeUrl() = URLEncoder.encode(this, "UTF-8")!!
1313
/**
1414
* Actual platform that this program is run on.
1515
*/
16-
public actual val currentApiPlatform: Platform = Platform.ANDROID
16+
public actual val currentApiPlatform: Platform = Platform.Android
1717

1818
public actual typealias ConcurrentHashMap<K, V> = java.util.concurrent.ConcurrentHashMap<K, V>
1919

src/commonMain/kotlin/com.adamratzman.spotify/SpotifyApiBuilder.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -683,10 +683,10 @@ public class SpotifyApiBuilder(
683683

684684
/**
685685
* Create a [SpotifyApi] instance with the given [SpotifyApiBuilder] parameters and the type -
686-
* [AuthorizationType.CLIENT] for client authentication, or otherwise [AuthorizationType.APPLICATION]
686+
* [AuthorizationType.Client] for client authentication, or otherwise [AuthorizationType.Application]
687687
*/
688688
public suspend fun build(type: AuthorizationType): GenericSpotifyApi {
689-
return if (type == AuthorizationType.CLIENT) {
689+
return if (type == AuthorizationType.Client) {
690690
buildClient()
691691
} else {
692692
buildCredentialed()
@@ -695,7 +695,7 @@ public class SpotifyApiBuilder(
695695

696696
/**
697697
* Create a [SpotifyApi] instance with the given [SpotifyApiBuilder] parameters and the type -
698-
* [AuthorizationType.CLIENT] for client authentication, or otherwise [AuthorizationType.APPLICATION]
698+
* [AuthorizationType.Client] for client authentication, or otherwise [AuthorizationType.Application]
699699
*/
700700
public fun buildRestAction(type: AuthorizationType): SpotifyRestAction<GenericSpotifyApi> = SpotifyRestAction {
701701
build(type)
@@ -758,14 +758,14 @@ public enum class AuthorizationType {
758758
*
759759
* [Spotify application settings page](https://developer.spotify.com/documentation/general/guides/app-settings/)
760760
*/
761-
CLIENT,
761+
Client,
762762

763763
/**
764764
* Authorization through application client id and secret, allowing access only to public endpoints and data
765765
*
766766
* [Spotify application settings page](https://developer.spotify.com/documentation/general/guides/app-settings/)
767767
*/
768-
APPLICATION;
768+
Application;
769769
}
770770

771771
/**

src/commonMain/kotlin/com.adamratzman.spotify/SpotifyRestAction.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public open class SpotifyRestAction<T> internal constructor(public val supplier:
106106
@JvmOverloads
107107
public fun queueAfter(
108108
quantity: Int,
109-
timeUnit: TimeUnit = TimeUnit.SECONDS,
109+
timeUnit: TimeUnit = TimeUnit.Seconds,
110110
scope: CoroutineScope = GlobalScope,
111111
failure: (Throwable) -> Unit = { throw it },
112112
consumer: (T) -> Unit

src/commonMain/kotlin/com.adamratzman.spotify/SpotifyScope.kt

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,131 +16,131 @@ public enum class SpotifyScope(public val uri: String) {
1616
*
1717
* **Visible to users**: Communicate with the Spotify app on your device.
1818
*/
19-
APP_REMOTE_CONTROL("app-remote-control"),
19+
AppRemoteControl("app-remote-control"),
2020

2121
/**
2222
* Read access to user's private playlists.
2323
*
2424
* **Visible to users**: Access your private playlists.
2525
*/
26-
PLAYLIST_READ_PRIVATE("playlist-read-private"),
26+
PlaylistReadPrivate("playlist-read-private"),
2727

2828
/**
2929
* Include collaborative playlists when requesting a user's playlists.
3030
*
3131
* **Visible to users**: Access your collaborative playlists.
3232
*/
33-
PLAYLIST_READ_COLLABORATIVE("playlist-read-collaborative"),
33+
PlaylistReadCollaborative("playlist-read-collaborative"),
3434

3535
/**
3636
* Write access to a user's public playlists.
3737
*
3838
* **Visible to users**: Manage your public playlists.
3939
*/
40-
PLAYLIST_MODIFY_PUBLIC("playlist-modify-public"),
40+
PlaylistModifyPublic("playlist-modify-public"),
4141

4242
/**
4343
* Write access to a user's private playlists.
4444
*
4545
* **Visible to users**: Manage your private playlists.
4646
*/
47-
PLAYLIST_MODIFY_PRIVATE("playlist-modify-private"),
47+
PlaylistModifyPrivate("playlist-modify-private"),
4848

4949
/**
5050
* Control playback of a Spotify track. This scope is currently available to Spotify Playback SDKs, including the iOS SDK, Android SDK and Web Playback SDK. The user must have a Spotify Premium account.
5151
*
5252
* **Visible to users**: Play music and control playback on your other devices.
5353
*/
54-
STREAMING("streaming"),
54+
Streaming("streaming"),
5555

5656
/**
5757
* Let the application upload playlist covers and profile images
5858
*
5959
* **Visible to users**: Upload images to personalize your profile or playlist cover
6060
*/
61-
UGC_IMAGE_UPLOAD("ugc-image-upload"),
61+
UgcImageUpload("ugc-image-upload"),
6262

6363
/**
6464
* Write/delete access to the list of artists and other users that the user follows.
6565
*
6666
* **Visible to users**: Manage who you are following.
6767
*/
68-
USER_FOLLOW_MODIFY("user-follow-modify"),
68+
UserFollowModify("user-follow-modify"),
6969

7070
/**
7171
* Read access to the list of artists and other users that the user follows.
7272
*
7373
* **Visible to users**: Access your followers and who you are following.
7474
*/
75-
USER_FOLLOW_READ("user-follow-read"),
75+
UserFollowRead("user-follow-read"),
7676

7777
/**
7878
* Read access to a user's "Your Music" library.
7979
*
8080
* **Visible to users**: Access your saved tracks and albums.
8181
*/
82-
USER_LIBRARY_READ("user-library-read"),
82+
UserLibraryRead("user-library-read"),
8383

8484
/**
8585
* Write/delete access to a user's "Your Music" library.
8686
*
8787
* **Visible to users**: Manage your saved tracks and albums.
8888
*/
89-
USER_LIBRARY_MODIFY("user-library-modify"),
89+
UserLibraryModify("user-library-modify"),
9090

9191
/**
9292
* Write access to a user’s playback state
9393
*
9494
* **Visible to users**: Control playback on your Spotify clients and Spotify Connect devices.
9595
*/
96-
USER_MODIFY_PLAYBACK_STATE("user-modify-playback-state"),
96+
UserModifyPlaybackState("user-modify-playback-state"),
9797

9898
/**
9999
* Read access to user’s subscription details (type of user account).
100100
*
101101
* **Visible to users**: Access your subscription details.
102102
*/
103-
USER_READ_PRIVATE("user-read-private"),
103+
UserReadPrivate("user-read-private"),
104104

105105
/**
106106
* Read access to user’s email address.
107107
*
108108
* **Visible to users**: Get your real email address.
109109
*/
110-
USER_READ_EMAIL("user-read-email"),
110+
UserReadEmail("user-read-email"),
111111

112112
/**
113113
* Read access to a user's top artists and tracks.
114114
*
115115
* **Visible to users**: Read your top artists and tracks.
116116
*/
117-
USER_TOP_READ("user-top-read"),
117+
UserTopRead("user-top-read"),
118118

119119
/**
120120
* Read access to a user’s player state.
121121
*
122122
* **Visible to users**: Read your currently playing track and Spotify Connect devices information.
123123
*/
124-
USER_READ_PLAYBACK_STATE("user-read-playback-state"),
124+
UserReadPlaybackState("user-read-playback-state"),
125125

126126
/**
127127
* Read access to a user’s playback position in a content.
128128
*
129129
* **Visible to users**: Read your position in content you have played.
130130
*/
131-
USER_READ_PLAYBACK_POSITION("user-read-playback-position"),
131+
UserReadPlaybackPosition("user-read-playback-position"),
132132

133133
/**
134134
* Read access to a user’s currently playing track
135135
*
136136
* **Visible to users**: Read your currently playing track
137137
*/
138-
USER_READ_CURRENTLY_PLAYING("user-read-currently-playing"),
138+
UserReadCurrentlyPlaying("user-read-currently-playing"),
139139

140140
/**
141141
* Read access to a user’s recently played tracks.
142142
*
143143
* **Visible to users**: Access your recently played items.
144144
*/
145-
USER_READ_RECENTLY_PLAYED("user-read-recently-played");
145+
UserReadRecentlyPlayed("user-read-recently-played");
146146
}

src/commonMain/kotlin/com.adamratzman.spotify/endpoints/client/ClientEpisodeApi.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class ClientEpisodeApi(api: GenericSpotifyApi) : EpisodeApi(api) {
2323
* Get Spotify catalog information for a single episode identified by its unique Spotify ID. The [Market] associated with
2424
* the user account will be used.
2525
*
26-
* **Reading the user’s resume points on episode objects requires the [SpotifyScope.USER_READ_PLAYBACK_POSITION] scope**
26+
* **Reading the user’s resume points on episode objects requires the [SpotifyScope.UserReadPlaybackPosition] scope**
2727
*
2828
* **[Api Reference](https://developer.spotify.com/documentation/web-api/reference/episodes/get-an-episode/)**
2929
*
@@ -45,7 +45,7 @@ public class ClientEpisodeApi(api: GenericSpotifyApi) : EpisodeApi(api) {
4545
*
4646
* **Invalid episode ids will result in a [BadRequestException]
4747
*
48-
* **Reading the user’s resume points on episode objects requires the [SpotifyScope.USER_READ_PLAYBACK_POSITION] scope**
48+
* **Reading the user’s resume points on episode objects requires the [SpotifyScope.UserReadPlaybackPosition] scope**
4949
*
5050
* **[Api Reference](https://developer.spotify.com/documentation/web-api/reference/episodes/get-several-episodes/)**
5151
*
@@ -55,7 +55,7 @@ public class ClientEpisodeApi(api: GenericSpotifyApi) : EpisodeApi(api) {
5555
* @throws BadRequestException If any invalid show id is provided
5656
*/
5757
public suspend fun getEpisodes(vararg ids: String): List<Episode?> {
58-
requireScopes(SpotifyScope.USER_READ_PLAYBACK_POSITION)
58+
requireScopes(SpotifyScope.UserReadPlaybackPosition)
5959
checkBulkRequesting(50, ids.size)
6060

6161
return bulkStatelessRequest(50, ids.toList()) { chunk ->

0 commit comments

Comments
 (0)