-
Notifications
You must be signed in to change notification settings - Fork 7
81 implement guild template api #90
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ea7091e
81 implement guild template api
surajkumar d46a8a4
Fix for Optional values
notyourhabibti 2c31c93
Removed comment, OffsetDateTime is already in ISO-8601
notyourhabibti b1ce2dc
Removed comment, object is complete
notyourhabibti 588549b
Implement X-Audit-Log-Reason
notyourhabibti 978611b
Removed TODO, IllegalArgumentException is sufficient
notyourhabibti 1ae167a
Implemented TODO comment and created WidgetStyle
notyourhabibti 8215dd3
Added Forum Media Thread Message Param object
notyourhabibti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
.../java/com/javadiscord/jdi/internal/api/guild_template/CreateGuildFromTemplateRequest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.javadiscord.jdi.internal.api.guild_template; | ||
|
||
import com.javadiscord.jdi.internal.api.DiscordRequest; | ||
import com.javadiscord.jdi.internal.api.DiscordRequestBuilder; | ||
|
||
import java.util.Map; | ||
|
||
public record CreateGuildFromTemplateRequest(String templateCode, String name, String icon) | ||
implements DiscordRequest { | ||
|
||
@Override | ||
public DiscordRequestBuilder create() { | ||
return new DiscordRequestBuilder() | ||
.post() | ||
.path("/guilds/templates/%s".formatted(templateCode)) | ||
.body( | ||
Map.of( | ||
"name", name, | ||
"icon", icon)); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...main/java/com/javadiscord/jdi/internal/api/guild_template/CreateGuildTemplateRequest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.javadiscord.jdi.internal.api.guild_template; | ||
|
||
import com.javadiscord.jdi.internal.api.DiscordRequest; | ||
import com.javadiscord.jdi.internal.api.DiscordRequestBuilder; | ||
|
||
import java.util.Map; | ||
|
||
public record CreateGuildTemplateRequest(long guildId, String name, String description) | ||
surajkumar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
implements DiscordRequest { | ||
|
||
@Override | ||
public DiscordRequestBuilder create() { | ||
return new DiscordRequestBuilder() | ||
.post() | ||
.path("/guilds/%s/templates".formatted(guildId)) | ||
.body( | ||
Map.of( | ||
"name", name, | ||
"description", description)); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
api/src/main/java/com/javadiscord/jdi/internal/api/guild_template/DeleteGuildTemplate.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.javadiscord.jdi.internal.api.guild_template; | ||
|
||
import com.javadiscord.jdi.internal.api.DiscordRequest; | ||
import com.javadiscord.jdi.internal.api.DiscordRequestBuilder; | ||
|
||
public record DeleteGuildTemplate(long guildId, String templateCode) implements DiscordRequest { | ||
surajkumar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
@Override | ||
public DiscordRequestBuilder create() { | ||
return new DiscordRequestBuilder() | ||
.delete() | ||
.path("/guilds/%s/templates/%s".formatted(guildId, templateCode)); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...main/java/com/javadiscord/jdi/internal/api/guild_template/DeleteGuildTemplateRequest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.javadiscord.jdi.internal.api.guild_template; | ||
|
||
import com.javadiscord.jdi.internal.api.DiscordRequest; | ||
import com.javadiscord.jdi.internal.api.DiscordRequestBuilder; | ||
|
||
import java.util.Map; | ||
|
||
public record DeleteGuildTemplateRequest( | ||
surajkumar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
long guildId, String templateCode, String name, String description) | ||
surajkumar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
implements DiscordRequest { | ||
|
||
@Override | ||
public DiscordRequestBuilder create() { | ||
return new DiscordRequestBuilder() | ||
.patch() | ||
.path("/guilds/%s/templates/%s".formatted(guildId, templateCode)) | ||
.body( | ||
Map.of( | ||
"name", name, | ||
"description", description)); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...rc/main/java/com/javadiscord/jdi/internal/api/guild_template/GetGuildTemplateRequest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.javadiscord.jdi.internal.api.guild_template; | ||
|
||
import com.javadiscord.jdi.internal.api.DiscordRequest; | ||
import com.javadiscord.jdi.internal.api.DiscordRequestBuilder; | ||
|
||
public record GetGuildTemplateRequest(String templateCode) implements DiscordRequest { | ||
|
||
@Override | ||
public DiscordRequestBuilder create() { | ||
return new DiscordRequestBuilder() | ||
.get() | ||
.path("/guilds/templates/%s".formatted(templateCode)); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...c/main/java/com/javadiscord/jdi/internal/api/guild_template/GetGuildTemplatesRequest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.javadiscord.jdi.internal.api.guild_template; | ||
|
||
import com.javadiscord.jdi.internal.api.DiscordRequest; | ||
import com.javadiscord.jdi.internal.api.DiscordRequestBuilder; | ||
|
||
public record GetGuildTemplatesRequest(long guildId) implements DiscordRequest { | ||
|
||
@Override | ||
public DiscordRequestBuilder create() { | ||
return new DiscordRequestBuilder().get().path("/guilds/%s/templates".formatted(guildId)); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...c/main/java/com/javadiscord/jdi/internal/api/guild_template/SyncGuildTemplateRequest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.javadiscord.jdi.internal.api.guild_template; | ||
|
||
import com.javadiscord.jdi.internal.api.DiscordRequest; | ||
import com.javadiscord.jdi.internal.api.DiscordRequestBuilder; | ||
|
||
public record SyncGuildTemplateRequest(long guildId, String templateCode) | ||
implements DiscordRequest { | ||
|
||
@Override | ||
public DiscordRequestBuilder create() { | ||
return new DiscordRequestBuilder() | ||
.put() | ||
.path("/guilds/%s/templates/%s".formatted(guildId, templateCode)); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.