From c6a87e5b3aa686f9b8d419fa5b28c97f4cf909d6 Mon Sep 17 00:00:00 2001
From: Duncan Jones <46377904+Gruncan@users.noreply.github.com>
Date: Sat, 23 Sep 2023 20:49:26 +0100
Subject: [PATCH 1/4] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index f45f00f..f9bef08 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ Demonstrated usage of OAuth 2.0 and java reflections, generics, networking, and
```
## Version Roadmap
-- v1.0.0: WebAPI
+- **v1.0.0: WebAPI**
- v2.0.0: AdAPI
- v3.0.0: Embeds
- v4.0.0: Open Access
From 62e58a16e70d4aa4d4bfd48b8458a71afdbfad99 Mon Sep 17 00:00:00 2001
From: Duncan Jones <46377904+Gruncan@users.noreply.github.com>
Date: Sat, 23 Sep 2023 20:50:01 +0100
Subject: [PATCH 2/4] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index f9bef08..bd63454 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,12 @@
# Spotify for Java (Still under development)
-
Spotify api wrapper for java. JavaDocs
Written for enjoyment and a way to learn java concepts that I have rarely/never used.
Demonstrated usage of OAuth 2.0 and java reflections, generics, networking, and concurrency.
+Latest: v1.5.0
## Maven
```XML
From 1f22c5803df221da68e255b951424229a3a3d049 Mon Sep 17 00:00:00 2001
From: Duncan Jones <46377904+Gruncan@users.noreply.github.com>
Date: Mon, 30 Oct 2023 19:03:34 +0000
Subject: [PATCH 3/4] Create maven.yml
---
.github/workflows/maven.yml | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
create mode 100644 .github/workflows/maven.yml
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
new file mode 100644
index 0000000..b72363f
--- /dev/null
+++ b/.github/workflows/maven.yml
@@ -0,0 +1,35 @@
+# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
+# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
+
+# This workflow uses actions that are not certified by GitHub.
+# They are provided by a third-party and are governed by
+# separate terms of service, privacy policy, and support
+# documentation.
+
+name: Java CI with Maven
+
+on:
+ push:
+ branches: [ "development" ]
+ pull_request:
+ branches: [ "development" ]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up JDK 17
+ uses: actions/setup-java@v3
+ with:
+ java-version: '17'
+ distribution: 'temurin'
+ cache: maven
+ - name: Build with Maven
+ run: mvn -B package --file pom.xml
+
+ # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
+ - name: Update dependency graph
+ uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
From e6bbf0e8b41a7ae200bcd5b5b8cd104ef73b9879 Mon Sep 17 00:00:00 2001
From: Duncan Jones <46377904+Gruncan@users.noreply.github.com>
Date: Sun, 5 May 2024 23:15:38 +0100
Subject: [PATCH 4/4] Added back HowRequestsWork.md
---
src/main/HowRequestsWork.md | 98 +++++++++++++++++++++++++++++++++++++
1 file changed, 98 insertions(+)
diff --git a/src/main/HowRequestsWork.md b/src/main/HowRequestsWork.md
index e69de29..e430cd2 100644
--- a/src/main/HowRequestsWork.md
+++ b/src/main/HowRequestsWork.md
@@ -0,0 +1,98 @@
+## Adding custom requests
+
+1. Create a new class
+2. Make `SpotifyRequestVariant` its interface
+
+```java
+public class MyClass implements SpotifyRequestVariant {
+}
+```
+
+3. Annotated it with
+
+```Java
+@SpotifyRequest("")
+```
+
+replacing `` with the request you are wanting to call E.g. It will be evaluated
+as `"https://api.spotify.com/v1/"`
+
+So for ` = albums`,
+
+```java
+
+@SpotifyRequest("albums")
+public class MyClass implements SpotifyRequestVariant {
+}
+```
+
+the url will be `"https://api.spotify.com/v1/albums"`
+
+4. If there are variables within the URL like `"https://api.spotify.com/v1/albums/{id}"`
+
+Add `@SpotifySubRequest` to the required field
+
+```java
+
+@SpotifyRequest("albums")
+public class MyClass implements SpotifyRequestVariant {
+
+ @SpotifySubRequest
+ private final String id;
+}
+```
+
+(For SubRequest annotated fields, they will be evaluated in order of declaration in the class, therefore **order
+matters**)
+
+5. For parameters within the url like `https://api.spotify.com/v1/albums/{id}?parameter=value`
+
+Add `@SpotifyRequestField` to the required fields
+
+```java
+
+@SpotifyRequest("albums")
+public class MyClass implements SpotifyRequestVariant {
+
+ @SpotifySubRequest
+ private final String id;
+
+ @SpotifyRequestField
+ private Market market;
+}
+```
+
+Where `parameter` is the field name, in this case "`market`". The `value` is the value within the specific field
+
+So for
+
+```java
+
+@SpotifyRequest("albums")
+public class MyClass implements SpotifyRequestVariant {
+
+ @SpotifySubRequest
+ private final String id = "382ObEPsp2rxGrnsizN5TX";
+
+ @SpotifyRequestField
+ private Market market = Market.ES;
+}
+```
+
+the url will be evaluated as `https://api.spotify.com/v1/albums/382ObEPsp2rxGrnsizN5TX?market=ES`
+
+Fields with types other than String will call `toString`
+
+Fields with the type of array, the array contents will be put into a comma seperated list of their respected string
+contents.
+
+(RequestField will again be evaluated in order of declaration within the class however order doesn't matter with url
+parameters)
+
+and finally to execute the request, after creating a SpotifyClient instance,
+
+```java
+MyClass myClass = new MyClass();
+SpotifyRepsonse sr = spotifyClient.executeRequest(myClass);
+JSONObject json = sr.getJsonObject();
+```