-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into feature/#314/gith…
…ub-action-release-workflow
- Loading branch information
Showing
77 changed files
with
2,877 additions
and
50 deletions.
There are no files selected for viewing
This file contains 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
41 changes: 41 additions & 0 deletions
41
bigbone-rx/src/main/kotlin/social/bigbone/rx/admin/RxAdminMeasuresMethods.kt
This file contains 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,41 @@ | ||
package social.bigbone.rx.admin | ||
|
||
import io.reactivex.rxjava3.core.Single | ||
import social.bigbone.MastodonClient | ||
import social.bigbone.api.entity.admin.AdminMeasure | ||
import social.bigbone.api.entity.admin.AdminMeasure.Key | ||
import social.bigbone.api.method.admin.AdminMeasureMethods | ||
import social.bigbone.api.method.admin.RequestMeasure | ||
import java.time.Instant | ||
|
||
/** | ||
* Reactive implementation of [AdminMeasureMethods]. | ||
* | ||
* Obtain quantitative metrics about the server. | ||
* @see <a href="https://docs.joinmastodon.org/methods/admin/measures/">Mastodon admin/measures API methods</a> | ||
*/ | ||
class RxAdminMeasuresMethods(client: MastodonClient) { | ||
|
||
private val adminMeasureMethods = AdminMeasureMethods(client) | ||
|
||
/** | ||
* Obtain statistical measures for your server. | ||
* | ||
* @param measures Request specific measures. Uses helper wrapper [RequestMeasure] to ensure that required fields are set for any given [Key]. | ||
* @param startAt The start date for the time period. If a time is provided, it will be ignored. | ||
* @param endAt The end date for the time period. If a time is provided, it will be ignored. | ||
* | ||
* @see <a href="https://docs.joinmastodon.org/methods/admin/measures/#get">Mastodon API documentation: admin/measures/#get</a> | ||
*/ | ||
fun getMeasurableDate( | ||
measures: List<RequestMeasure>, | ||
startAt: Instant, | ||
endAt: Instant | ||
): Single<List<AdminMeasure>> = Single.fromCallable { | ||
adminMeasureMethods.getMeasurableData( | ||
measures = measures, | ||
startAt = startAt, | ||
endAt = endAt | ||
).execute() | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.