ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.484.1

This commit is contained in:
speakeasybot
2025-02-06 00:27:45 +00:00
parent f33408b177
commit a4a2130978
59 changed files with 4903 additions and 58 deletions

View File

@@ -161,6 +161,8 @@ public class PlexAPI {
*/
private final Updater updater;
private final Users users;
/**
* Operations against the Plex Media Server System.
*
@@ -299,6 +301,10 @@ public class PlexAPI {
return updater;
}
public Users users() {
return users;
}
private final SDKConfiguration sdkConfiguration;
/**
@@ -518,5 +524,6 @@ public class PlexAPI {
this.statistics = new Statistics(sdkConfiguration);
this.sessions = new Sessions(sdkConfiguration);
this.updater = new Updater(sdkConfiguration);
this.users = new Users(sdkConfiguration);
this.sdkConfiguration.initialize();
}}

View File

@@ -43,7 +43,7 @@ class SDKConfiguration {
} };
private static final String LANGUAGE = "java";
public static final String OPENAPI_DOC_VERSION = "0.0.3";
public static final String SDK_VERSION = "0.11.4";
public static final String SDK_VERSION = "0.11.5";
public static final String GEN_VERSION = "2.503.2";
private static final String BASE_PACKAGE = "dev.plexapi.sdk";
public static final String USER_AGENT =

View File

@@ -0,0 +1,212 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk;
import com.fasterxml.jackson.core.type.TypeReference;
import dev.plexapi.sdk.models.errors.GetUsersBadRequest;
import dev.plexapi.sdk.models.errors.GetUsersUnauthorized;
import dev.plexapi.sdk.models.errors.SDKError;
import dev.plexapi.sdk.models.operations.GetUsersRequest;
import dev.plexapi.sdk.models.operations.GetUsersRequestBuilder;
import dev.plexapi.sdk.models.operations.GetUsersResponse;
import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.HTTPRequest;
import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl;
import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl;
import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Exception;
import java.lang.String;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Optional;
public class Users implements
MethodCallGetUsers {
/**
* GET_USERS_SERVERS contains the list of server urls available to the SDK.
*/
public static final String[] GET_USERS_SERVERS = {
"https://plex.tv/api",
};
private final SDKConfiguration sdkConfiguration;
Users(SDKConfiguration sdkConfiguration) {
this.sdkConfiguration = sdkConfiguration;
}
/**
* Get list of all connected users
* Get list of all users that are friends and have library access with the provided Plex authentication token
* @return The call builder
*/
public GetUsersRequestBuilder getUsers() {
return new GetUsersRequestBuilder(this);
}
/**
* Get list of all connected users
* Get list of all users that are friends and have library access with the provided Plex authentication token
* @param request The request object containing all of the parameters for the API call.
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetUsersResponse getUsers(
GetUsersRequest request) throws Exception {
return getUsers(request, Optional.empty());
}
/**
* Get list of all connected users
* Get list of all users that are friends and have library access with the provided Plex authentication token
* @param request The request object containing all of the parameters for the API call.
* @param serverURL Overrides the server URL.
* @return The response from the API call
* @throws Exception if the API call fails
*/
public GetUsersResponse getUsers(
GetUsersRequest request,
Optional<String> serverURL) throws Exception {
String _baseUrl = Utils.templateUrl(GET_USERS_SERVERS[0], new HashMap<String, String>());
if (serverURL.isPresent() && !serverURL.get().isBlank()) {
_baseUrl = serverURL.get();
}
String _url = Utils.generateURL(
_baseUrl,
"/users");
HTTPRequest _req = new HTTPRequest(_url, "GET");
_req.addHeader("Accept", "application/xml")
.addHeader("user-agent",
SDKConfiguration.USER_AGENT);
_req.addHeaders(Utils.getHeadersFromMetadata(request, null));
Optional<SecuritySource> _hookSecuritySource = Optional.empty();
HTTPClient _client = this.sdkConfiguration.defaultClient;
HttpRequest _r =
sdkConfiguration.hooks()
.beforeRequest(
new BeforeRequestContextImpl(
"get-users",
Optional.of(List.of()),
_hookSecuritySource),
_req.build());
HttpResponse<InputStream> _httpRes;
try {
_httpRes = _client.send(_r);
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"get-users",
Optional.of(List.of()),
_hookSecuritySource),
Optional.of(_httpRes),
Optional.empty());
} else {
_httpRes = sdkConfiguration.hooks()
.afterSuccess(
new AfterSuccessContextImpl(
"get-users",
Optional.of(List.of()),
_hookSecuritySource),
_httpRes);
}
} catch (Exception _e) {
_httpRes = sdkConfiguration.hooks()
.afterError(
new AfterErrorContextImpl(
"get-users",
Optional.of(List.of()),
_hookSecuritySource),
Optional.empty(),
Optional.of(_e));
}
String _contentType = _httpRes
.headers()
.firstValue("Content-Type")
.orElse("application/octet-stream");
GetUsersResponse.Builder _resBuilder =
GetUsersResponse
.builder()
.contentType(_contentType)
.statusCode(_httpRes.statusCode())
.rawResponse(_httpRes);
GetUsersResponse _res = _resBuilder.build();
if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) {
if (Utils.contentTypeMatches(_contentType, "application/xml")) {
return _res;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetUsersBadRequest _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetUsersBadRequest>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) {
if (Utils.contentTypeMatches(_contentType, "application/json")) {
GetUsersUnauthorized _out = Utils.mapper().readValue(
Utils.toUtf8AndClose(_httpRes.body()),
new TypeReference<GetUsersUnauthorized>() {});
_out.withRawResponse(Optional.ofNullable(_httpRes));
throw _out;
} else {
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected content-type received: " + _contentType,
Utils.extractByteArrayFromBody(_httpRes));
}
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) {
// no content
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"API error occurred",
Utils.extractByteArrayFromBody(_httpRes));
}
throw new SDKError(
_httpRes,
_httpRes.statusCode(),
"Unexpected status code received: " + _httpRes.statusCode(),
Utils.extractByteArrayFromBody(_httpRes));
}
}

View File

@@ -0,0 +1,173 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* GetUsersBadRequest - Bad Request - A parameter was not specified, or was specified incorrectly.
*/
@SuppressWarnings("serial")
public class GetUsersBadRequest extends RuntimeException {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("errors")
private Optional<? extends List<GetUsersErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetUsersBadRequest(
@JsonProperty("errors") Optional<? extends List<GetUsersErrors>> errors,
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
Utils.checkNotNull(errors, "errors");
Utils.checkNotNull(rawResponse, "rawResponse");
this.errors = errors;
this.rawResponse = rawResponse;
}
public GetUsersBadRequest() {
this(Optional.empty(), Optional.empty());
}
@SuppressWarnings("unchecked")
public Optional<List<GetUsersErrors>> errors(){
return (Optional<List<GetUsersErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetUsersBadRequest withErrors(List<GetUsersErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetUsersBadRequest withErrors(Optional<? extends List<GetUsersErrors>> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = errors;
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetUsersBadRequest withRawResponse(HttpResponse<InputStream> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = Optional.ofNullable(rawResponse);
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetUsersBadRequest withRawResponse(Optional<? extends HttpResponse<InputStream>> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = rawResponse;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetUsersBadRequest other = (GetUsersBadRequest) o;
return
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetUsersBadRequest.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetUsersErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetUsersErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends List<GetUsersErrors>> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = errors;
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public Builder rawResponse(HttpResponse<InputStream> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = Optional.ofNullable(rawResponse);
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public Builder rawResponse(Optional<? extends HttpResponse<InputStream>> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = rawResponse;
return this;
}
public GetUsersBadRequest build() {
return new GetUsersBadRequest(
errors,
rawResponse);
}
}
}

View File

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Integer;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetUsersErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Integer> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Integer> status;
@JsonCreator
public GetUsersErrors(
@JsonProperty("code") Optional<Integer> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<Integer> status) {
Utils.checkNotNull(code, "code");
Utils.checkNotNull(message, "message");
Utils.checkNotNull(status, "status");
this.code = code;
this.message = message;
this.status = status;
}
public GetUsersErrors() {
this(Optional.empty(), Optional.empty(), Optional.empty());
}
@JsonIgnore
public Optional<Integer> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Integer> status() {
return status;
}
public final static Builder builder() {
return new Builder();
}
public GetUsersErrors withCode(int code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetUsersErrors withCode(Optional<Integer> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetUsersErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetUsersErrors withMessage(Optional<String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetUsersErrors withStatus(int status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetUsersErrors withStatus(Optional<Integer> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetUsersErrors other = (GetUsersErrors) o;
return
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetUsersErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Integer> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<Integer> status = Optional.empty();
private Builder() {
// force use of static builder() method
}
public Builder code(int code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public Builder code(Optional<Integer> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public Builder message(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public Builder message(Optional<String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public Builder status(int status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public Builder status(Optional<Integer> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetUsersErrors build() {
return new GetUsersErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,173 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* GetUsersUnauthorized - Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
*/
@SuppressWarnings("serial")
public class GetUsersUnauthorized extends RuntimeException {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("errors")
private Optional<? extends List<GetUsersUsersErrors>> errors;
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("RawResponse")
private Optional<? extends HttpResponse<InputStream>> rawResponse;
@JsonCreator
public GetUsersUnauthorized(
@JsonProperty("errors") Optional<? extends List<GetUsersUsersErrors>> errors,
@JsonProperty("RawResponse") Optional<? extends HttpResponse<InputStream>> rawResponse) {
Utils.checkNotNull(errors, "errors");
Utils.checkNotNull(rawResponse, "rawResponse");
this.errors = errors;
this.rawResponse = rawResponse;
}
public GetUsersUnauthorized() {
this(Optional.empty(), Optional.empty());
}
@SuppressWarnings("unchecked")
public Optional<List<GetUsersUsersErrors>> errors(){
return (Optional<List<GetUsersUsersErrors>>) errors;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@SuppressWarnings("unchecked")
public Optional<HttpResponse<InputStream>> rawResponse(){
return (Optional<HttpResponse<InputStream>>) rawResponse;
}
public final static Builder builder() {
return new Builder();
}
public GetUsersUnauthorized withErrors(List<GetUsersUsersErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public GetUsersUnauthorized withErrors(Optional<? extends List<GetUsersUsersErrors>> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = errors;
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetUsersUnauthorized withRawResponse(HttpResponse<InputStream> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = Optional.ofNullable(rawResponse);
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetUsersUnauthorized withRawResponse(Optional<? extends HttpResponse<InputStream>> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = rawResponse;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetUsersUnauthorized other = (GetUsersUnauthorized) o;
return
Objects.deepEquals(this.errors, other.errors) &&
Objects.deepEquals(this.rawResponse, other.rawResponse);
}
@Override
public int hashCode() {
return java.util.Objects.hash(
errors,
rawResponse);
}
@Override
public String toString() {
return Utils.toString(GetUsersUnauthorized.class,
"errors", errors,
"rawResponse", rawResponse);
}
public final static class Builder {
private Optional<? extends List<GetUsersUsersErrors>> errors = Optional.empty();
private Optional<? extends HttpResponse<InputStream>> rawResponse;
private Builder() {
// force use of static builder() method
}
public Builder errors(List<GetUsersUsersErrors> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = Optional.ofNullable(errors);
return this;
}
public Builder errors(Optional<? extends List<GetUsersUsersErrors>> errors) {
Utils.checkNotNull(errors, "errors");
this.errors = errors;
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public Builder rawResponse(HttpResponse<InputStream> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = Optional.ofNullable(rawResponse);
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public Builder rawResponse(Optional<? extends HttpResponse<InputStream>> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = rawResponse;
return this;
}
public GetUsersUnauthorized build() {
return new GetUsersUnauthorized(
errors,
rawResponse);
}
}
}

View File

@@ -0,0 +1,194 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.errors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Integer;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetUsersUsersErrors {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("code")
private Optional<Integer> code;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("message")
private Optional<String> message;
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("status")
private Optional<Integer> status;
@JsonCreator
public GetUsersUsersErrors(
@JsonProperty("code") Optional<Integer> code,
@JsonProperty("message") Optional<String> message,
@JsonProperty("status") Optional<Integer> status) {
Utils.checkNotNull(code, "code");
Utils.checkNotNull(message, "message");
Utils.checkNotNull(status, "status");
this.code = code;
this.message = message;
this.status = status;
}
public GetUsersUsersErrors() {
this(Optional.empty(), Optional.empty(), Optional.empty());
}
@JsonIgnore
public Optional<Integer> code() {
return code;
}
@JsonIgnore
public Optional<String> message() {
return message;
}
@JsonIgnore
public Optional<Integer> status() {
return status;
}
public final static Builder builder() {
return new Builder();
}
public GetUsersUsersErrors withCode(int code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public GetUsersUsersErrors withCode(Optional<Integer> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public GetUsersUsersErrors withMessage(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public GetUsersUsersErrors withMessage(Optional<String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public GetUsersUsersErrors withStatus(int status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public GetUsersUsersErrors withStatus(Optional<Integer> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetUsersUsersErrors other = (GetUsersUsersErrors) o;
return
Objects.deepEquals(this.code, other.code) &&
Objects.deepEquals(this.message, other.message) &&
Objects.deepEquals(this.status, other.status);
}
@Override
public int hashCode() {
return Objects.hash(
code,
message,
status);
}
@Override
public String toString() {
return Utils.toString(GetUsersUsersErrors.class,
"code", code,
"message", message,
"status", status);
}
public final static class Builder {
private Optional<Integer> code = Optional.empty();
private Optional<String> message = Optional.empty();
private Optional<Integer> status = Optional.empty();
private Builder() {
// force use of static builder() method
}
public Builder code(int code) {
Utils.checkNotNull(code, "code");
this.code = Optional.ofNullable(code);
return this;
}
public Builder code(Optional<Integer> code) {
Utils.checkNotNull(code, "code");
this.code = code;
return this;
}
public Builder message(String message) {
Utils.checkNotNull(message, "message");
this.message = Optional.ofNullable(message);
return this;
}
public Builder message(Optional<String> message) {
Utils.checkNotNull(message, "message");
this.message = message;
return this;
}
public Builder status(int status) {
Utils.checkNotNull(status, "status");
this.status = Optional.ofNullable(status);
return this;
}
public Builder status(Optional<Integer> status) {
Utils.checkNotNull(status, "status");
this.status = status;
return this;
}
public GetUsersUsersErrors build() {
return new GetUsersUsersErrors(
code,
message,
status);
}
}
}

View File

@@ -0,0 +1,37 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import java.util.Optional;
/**
* AllLibraries - Indicates if the user has access to all libraries.
*/
public enum AllLibraries {
Disable(0),
Enable(1);
@JsonValue
private final int value;
private AllLibraries(int value) {
this.value = value;
}
public int value() {
return value;
}
public static Optional<AllLibraries> fromValue(int value) {
for (AllLibraries o: AllLibraries.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
}

View File

@@ -0,0 +1,37 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import java.util.Optional;
/**
* AllowCameraUpload - Indicates if the user is allowed to upload from a camera.
*/
public enum AllowCameraUpload {
Disable(0),
Enable(1);
@JsonValue
private final int value;
private AllowCameraUpload(int value) {
this.value = value;
}
public int value() {
return value;
}
public static Optional<AllowCameraUpload> fromValue(int value) {
for (AllowCameraUpload o: AllowCameraUpload.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
}

View File

@@ -0,0 +1,37 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import java.util.Optional;
/**
* AllowChannels - Indicates if the user has access to channels.
*/
public enum AllowChannels {
Disable(0),
Enable(1);
@JsonValue
private final int value;
private AllowChannels(int value) {
this.value = value;
}
public int value() {
return value;
}
public static Optional<AllowChannels> fromValue(int value) {
for (AllowChannels o: AllowChannels.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
}

View File

@@ -0,0 +1,37 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import java.util.Optional;
/**
* AllowSubtitleAdmin - Indicates if the user can manage subtitles.
*/
public enum AllowSubtitleAdmin {
Disable(0),
Enable(1);
@JsonValue
private final int value;
private AllowSubtitleAdmin(int value) {
this.value = value;
}
public int value() {
return value;
}
public static Optional<AllowSubtitleAdmin> fromValue(int value) {
for (AllowSubtitleAdmin o: AllowSubtitleAdmin.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
}

View File

@@ -0,0 +1,37 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import java.util.Optional;
/**
* AllowSync - Indicates if the user is allowed to sync media.
*/
public enum AllowSync {
Disable(0),
Enable(1);
@JsonValue
private final int value;
private AllowSync(int value) {
this.value = value;
}
public int value() {
return value;
}
public static Optional<AllowSync> fromValue(int value) {
for (AllowSync o: AllowSync.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
}

View File

@@ -0,0 +1,37 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import java.util.Optional;
/**
* AllowTuners - Indicates if the user is allowed to use tuners.
*/
public enum AllowTuners {
Disable(0),
Enable(1);
@JsonValue
private final int value;
private AllowTuners(int value) {
this.value = value;
}
public int value() {
return value;
}
public static Optional<AllowTuners> fromValue(int value) {
for (AllowTuners o: AllowTuners.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
}

View File

@@ -151,7 +151,7 @@ public class GetTopWatchedContentMetadata {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("User")
private Optional<? extends List<User>> user;
private Optional<? extends List<GetTopWatchedContentUser>> user;
@JsonCreator
public GetTopWatchedContentMetadata(
@@ -186,7 +186,7 @@ public class GetTopWatchedContentMetadata {
@JsonProperty("Country") Optional<? extends List<GetTopWatchedContentCountry>> country,
@JsonProperty("Guid") Optional<? extends List<GetTopWatchedContentGuids>> guids,
@JsonProperty("Role") Optional<? extends List<GetTopWatchedContentRole>> role,
@JsonProperty("User") Optional<? extends List<User>> user) {
@JsonProperty("User") Optional<? extends List<GetTopWatchedContentUser>> user) {
Utils.checkNotNull(ratingKey, "ratingKey");
Utils.checkNotNull(key, "key");
Utils.checkNotNull(guid, "guid");
@@ -418,8 +418,8 @@ public class GetTopWatchedContentMetadata {
@SuppressWarnings("unchecked")
@JsonIgnore
public Optional<List<User>> user() {
return (Optional<List<User>>) user;
public Optional<List<GetTopWatchedContentUser>> user() {
return (Optional<List<GetTopWatchedContentUser>>) user;
}
public final static Builder builder() {
@@ -798,13 +798,13 @@ public class GetTopWatchedContentMetadata {
return this;
}
public GetTopWatchedContentMetadata withUser(List<User> user) {
public GetTopWatchedContentMetadata withUser(List<GetTopWatchedContentUser> user) {
Utils.checkNotNull(user, "user");
this.user = Optional.ofNullable(user);
return this;
}
public GetTopWatchedContentMetadata withUser(Optional<? extends List<User>> user) {
public GetTopWatchedContentMetadata withUser(Optional<? extends List<GetTopWatchedContentUser>> user) {
Utils.checkNotNull(user, "user");
this.user = user;
return this;
@@ -992,7 +992,7 @@ public class GetTopWatchedContentMetadata {
private Optional<? extends List<GetTopWatchedContentRole>> role = Optional.empty();
private Optional<? extends List<User>> user = Optional.empty();
private Optional<? extends List<GetTopWatchedContentUser>> user = Optional.empty();
private Builder() {
// force use of static builder() method
@@ -1370,13 +1370,13 @@ public class GetTopWatchedContentMetadata {
return this;
}
public Builder user(List<User> user) {
public Builder user(List<GetTopWatchedContentUser> user) {
Utils.checkNotNull(user, "user");
this.user = Optional.ofNullable(user);
return this;
}
public Builder user(Optional<? extends List<User>> user) {
public Builder user(Optional<? extends List<GetTopWatchedContentUser>> user) {
Utils.checkNotNull(user, "user");
this.user = user;
return this;

View File

@@ -0,0 +1,110 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Integer;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetTopWatchedContentUser {
@JsonInclude(Include.NON_ABSENT)
@JsonProperty("id")
private Optional<Integer> id;
@JsonCreator
public GetTopWatchedContentUser(
@JsonProperty("id") Optional<Integer> id) {
Utils.checkNotNull(id, "id");
this.id = id;
}
public GetTopWatchedContentUser() {
this(Optional.empty());
}
@JsonIgnore
public Optional<Integer> id() {
return id;
}
public final static Builder builder() {
return new Builder();
}
public GetTopWatchedContentUser withId(int id) {
Utils.checkNotNull(id, "id");
this.id = Optional.ofNullable(id);
return this;
}
public GetTopWatchedContentUser withId(Optional<Integer> id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetTopWatchedContentUser other = (GetTopWatchedContentUser) o;
return
Objects.deepEquals(this.id, other.id);
}
@Override
public int hashCode() {
return Objects.hash(
id);
}
@Override
public String toString() {
return Utils.toString(GetTopWatchedContentUser.class,
"id", id);
}
public final static class Builder {
private Optional<Integer> id = Optional.empty();
private Builder() {
// force use of static builder() method
}
public Builder id(int id) {
Utils.checkNotNull(id, "id");
this.id = Optional.ofNullable(id);
return this;
}
public Builder id(Optional<Integer> id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;
}
public GetTopWatchedContentUser build() {
return new GetTopWatchedContentUser(
id);
}
}
}

View File

@@ -0,0 +1,292 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.util.List;
import java.util.Objects;
/**
* GetUsersMediaContainer - Container holding user and server details.
*/
public class GetUsersMediaContainer {
/**
* The friendly name of the Plex instance.
*/
private String friendlyName;
private String identifier;
/**
* Unique Machine identifier of the Plex server.
*/
private String machineIdentifier;
/**
* Total number of users.
*/
private long totalSize;
/**
* Number of users in the current response.
*/
private long size;
/**
* List of users with access to the Plex server.
*/
private List<User> user;
@JsonCreator
public GetUsersMediaContainer(
String friendlyName,
String identifier,
String machineIdentifier,
long totalSize,
long size,
List<User> user) {
Utils.checkNotNull(friendlyName, "friendlyName");
Utils.checkNotNull(identifier, "identifier");
Utils.checkNotNull(machineIdentifier, "machineIdentifier");
Utils.checkNotNull(totalSize, "totalSize");
Utils.checkNotNull(size, "size");
Utils.checkNotNull(user, "user");
this.friendlyName = friendlyName;
this.identifier = identifier;
this.machineIdentifier = machineIdentifier;
this.totalSize = totalSize;
this.size = size;
this.user = user;
}
/**
* The friendly name of the Plex instance.
*/
@JsonIgnore
public String friendlyName() {
return friendlyName;
}
@JsonIgnore
public String identifier() {
return identifier;
}
/**
* Unique Machine identifier of the Plex server.
*/
@JsonIgnore
public String machineIdentifier() {
return machineIdentifier;
}
/**
* Total number of users.
*/
@JsonIgnore
public long totalSize() {
return totalSize;
}
/**
* Number of users in the current response.
*/
@JsonIgnore
public long size() {
return size;
}
/**
* List of users with access to the Plex server.
*/
@JsonIgnore
public List<User> user() {
return user;
}
public final static Builder builder() {
return new Builder();
}
/**
* The friendly name of the Plex instance.
*/
public GetUsersMediaContainer withFriendlyName(String friendlyName) {
Utils.checkNotNull(friendlyName, "friendlyName");
this.friendlyName = friendlyName;
return this;
}
public GetUsersMediaContainer withIdentifier(String identifier) {
Utils.checkNotNull(identifier, "identifier");
this.identifier = identifier;
return this;
}
/**
* Unique Machine identifier of the Plex server.
*/
public GetUsersMediaContainer withMachineIdentifier(String machineIdentifier) {
Utils.checkNotNull(machineIdentifier, "machineIdentifier");
this.machineIdentifier = machineIdentifier;
return this;
}
/**
* Total number of users.
*/
public GetUsersMediaContainer withTotalSize(long totalSize) {
Utils.checkNotNull(totalSize, "totalSize");
this.totalSize = totalSize;
return this;
}
/**
* Number of users in the current response.
*/
public GetUsersMediaContainer withSize(long size) {
Utils.checkNotNull(size, "size");
this.size = size;
return this;
}
/**
* List of users with access to the Plex server.
*/
public GetUsersMediaContainer withUser(List<User> user) {
Utils.checkNotNull(user, "user");
this.user = user;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetUsersMediaContainer other = (GetUsersMediaContainer) o;
return
Objects.deepEquals(this.friendlyName, other.friendlyName) &&
Objects.deepEquals(this.identifier, other.identifier) &&
Objects.deepEquals(this.machineIdentifier, other.machineIdentifier) &&
Objects.deepEquals(this.totalSize, other.totalSize) &&
Objects.deepEquals(this.size, other.size) &&
Objects.deepEquals(this.user, other.user);
}
@Override
public int hashCode() {
return Objects.hash(
friendlyName,
identifier,
machineIdentifier,
totalSize,
size,
user);
}
@Override
public String toString() {
return Utils.toString(GetUsersMediaContainer.class,
"friendlyName", friendlyName,
"identifier", identifier,
"machineIdentifier", machineIdentifier,
"totalSize", totalSize,
"size", size,
"user", user);
}
public final static class Builder {
private String friendlyName;
private String identifier;
private String machineIdentifier;
private Long totalSize;
private Long size;
private List<User> user;
private Builder() {
// force use of static builder() method
}
/**
* The friendly name of the Plex instance.
*/
public Builder friendlyName(String friendlyName) {
Utils.checkNotNull(friendlyName, "friendlyName");
this.friendlyName = friendlyName;
return this;
}
public Builder identifier(String identifier) {
Utils.checkNotNull(identifier, "identifier");
this.identifier = identifier;
return this;
}
/**
* Unique Machine identifier of the Plex server.
*/
public Builder machineIdentifier(String machineIdentifier) {
Utils.checkNotNull(machineIdentifier, "machineIdentifier");
this.machineIdentifier = machineIdentifier;
return this;
}
/**
* Total number of users.
*/
public Builder totalSize(long totalSize) {
Utils.checkNotNull(totalSize, "totalSize");
this.totalSize = totalSize;
return this;
}
/**
* Number of users in the current response.
*/
public Builder size(long size) {
Utils.checkNotNull(size, "size");
this.size = size;
return this;
}
/**
* List of users with access to the Plex server.
*/
public Builder user(List<User> user) {
Utils.checkNotNull(user, "user");
this.user = user;
return this;
}
public GetUsersMediaContainer build() {
return new GetUsersMediaContainer(
friendlyName,
identifier,
machineIdentifier,
totalSize,
size,
user);
}
}
}

View File

@@ -0,0 +1,798 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import dev.plexapi.sdk.utils.SpeakeasyMetadata;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
public class GetUsersRequest {
/**
* An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
*/
@SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Client-Identifier")
private String clientID;
/**
* The name of the client application. (Plex Web, Plex Media Server, etc.)
*/
@SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Product")
private Optional<String> clientName;
/**
* A relatively friendly name for the client device
*/
@SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Device")
private Optional<String> deviceNickname;
/**
* The name of the device the client application is running on. This is used to track the client application and its usage. (Chrome, Safari, etc.)
*/
@SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Device-Name")
private Optional<String> deviceName;
/**
* The resolution of the device the client application is running on. This is used to track the client application and its usage. (1487x1165,2560x1440)
*/
@SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Device-Screen-Resolution")
private Optional<String> deviceScreenResolution;
/**
* The version of the client application.
*/
@SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Version")
private Optional<String> clientVersion;
/**
* The platform of the client application.
*/
@SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Platform")
private Optional<String> platform;
/**
* The features of the client application. This is used to track the client application and its usage. (external-media,indirect-media,hub-style-list)
*/
@SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Features")
private Optional<String> clientFeatures;
/**
* A potentially less friendly identifier for the device model
*/
@SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Model")
private Optional<String> model;
/**
* The session ID of the client application. This is used to track the client application and its usage. (97e136ef-4ddd-4ff3-89a7-a5820c96c2ca)
*/
@SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Session-Id")
private Optional<String> xPlexSessionId;
/**
* The language of the client application.
*/
@SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Language")
private Optional<String> xPlexLanguage;
/**
* The version of the platform
*/
@SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Platform-Version")
private Optional<String> platformVersion;
/**
* An authentication token, obtained from plex.tv
*/
@SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Token")
private String xPlexToken;
@JsonCreator
public GetUsersRequest(
String clientID,
Optional<String> clientName,
Optional<String> deviceNickname,
Optional<String> deviceName,
Optional<String> deviceScreenResolution,
Optional<String> clientVersion,
Optional<String> platform,
Optional<String> clientFeatures,
Optional<String> model,
Optional<String> xPlexSessionId,
Optional<String> xPlexLanguage,
Optional<String> platformVersion,
String xPlexToken) {
Utils.checkNotNull(clientID, "clientID");
Utils.checkNotNull(clientName, "clientName");
Utils.checkNotNull(deviceNickname, "deviceNickname");
Utils.checkNotNull(deviceName, "deviceName");
Utils.checkNotNull(deviceScreenResolution, "deviceScreenResolution");
Utils.checkNotNull(clientVersion, "clientVersion");
Utils.checkNotNull(platform, "platform");
Utils.checkNotNull(clientFeatures, "clientFeatures");
Utils.checkNotNull(model, "model");
Utils.checkNotNull(xPlexSessionId, "xPlexSessionId");
Utils.checkNotNull(xPlexLanguage, "xPlexLanguage");
Utils.checkNotNull(platformVersion, "platformVersion");
Utils.checkNotNull(xPlexToken, "xPlexToken");
this.clientID = clientID;
this.clientName = clientName;
this.deviceNickname = deviceNickname;
this.deviceName = deviceName;
this.deviceScreenResolution = deviceScreenResolution;
this.clientVersion = clientVersion;
this.platform = platform;
this.clientFeatures = clientFeatures;
this.model = model;
this.xPlexSessionId = xPlexSessionId;
this.xPlexLanguage = xPlexLanguage;
this.platformVersion = platformVersion;
this.xPlexToken = xPlexToken;
}
public GetUsersRequest(
String clientID,
String xPlexToken) {
this(clientID, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), xPlexToken);
}
/**
* An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
*/
@JsonIgnore
public String clientID() {
return clientID;
}
/**
* The name of the client application. (Plex Web, Plex Media Server, etc.)
*/
@JsonIgnore
public Optional<String> clientName() {
return clientName;
}
/**
* A relatively friendly name for the client device
*/
@JsonIgnore
public Optional<String> deviceNickname() {
return deviceNickname;
}
/**
* The name of the device the client application is running on. This is used to track the client application and its usage. (Chrome, Safari, etc.)
*/
@JsonIgnore
public Optional<String> deviceName() {
return deviceName;
}
/**
* The resolution of the device the client application is running on. This is used to track the client application and its usage. (1487x1165,2560x1440)
*/
@JsonIgnore
public Optional<String> deviceScreenResolution() {
return deviceScreenResolution;
}
/**
* The version of the client application.
*/
@JsonIgnore
public Optional<String> clientVersion() {
return clientVersion;
}
/**
* The platform of the client application.
*/
@JsonIgnore
public Optional<String> platform() {
return platform;
}
/**
* The features of the client application. This is used to track the client application and its usage. (external-media,indirect-media,hub-style-list)
*/
@JsonIgnore
public Optional<String> clientFeatures() {
return clientFeatures;
}
/**
* A potentially less friendly identifier for the device model
*/
@JsonIgnore
public Optional<String> model() {
return model;
}
/**
* The session ID of the client application. This is used to track the client application and its usage. (97e136ef-4ddd-4ff3-89a7-a5820c96c2ca)
*/
@JsonIgnore
public Optional<String> xPlexSessionId() {
return xPlexSessionId;
}
/**
* The language of the client application.
*/
@JsonIgnore
public Optional<String> xPlexLanguage() {
return xPlexLanguage;
}
/**
* The version of the platform
*/
@JsonIgnore
public Optional<String> platformVersion() {
return platformVersion;
}
/**
* An authentication token, obtained from plex.tv
*/
@JsonIgnore
public String xPlexToken() {
return xPlexToken;
}
public final static Builder builder() {
return new Builder();
}
/**
* An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
*/
public GetUsersRequest withClientID(String clientID) {
Utils.checkNotNull(clientID, "clientID");
this.clientID = clientID;
return this;
}
/**
* The name of the client application. (Plex Web, Plex Media Server, etc.)
*/
public GetUsersRequest withClientName(String clientName) {
Utils.checkNotNull(clientName, "clientName");
this.clientName = Optional.ofNullable(clientName);
return this;
}
/**
* The name of the client application. (Plex Web, Plex Media Server, etc.)
*/
public GetUsersRequest withClientName(Optional<String> clientName) {
Utils.checkNotNull(clientName, "clientName");
this.clientName = clientName;
return this;
}
/**
* A relatively friendly name for the client device
*/
public GetUsersRequest withDeviceNickname(String deviceNickname) {
Utils.checkNotNull(deviceNickname, "deviceNickname");
this.deviceNickname = Optional.ofNullable(deviceNickname);
return this;
}
/**
* A relatively friendly name for the client device
*/
public GetUsersRequest withDeviceNickname(Optional<String> deviceNickname) {
Utils.checkNotNull(deviceNickname, "deviceNickname");
this.deviceNickname = deviceNickname;
return this;
}
/**
* The name of the device the client application is running on. This is used to track the client application and its usage. (Chrome, Safari, etc.)
*/
public GetUsersRequest withDeviceName(String deviceName) {
Utils.checkNotNull(deviceName, "deviceName");
this.deviceName = Optional.ofNullable(deviceName);
return this;
}
/**
* The name of the device the client application is running on. This is used to track the client application and its usage. (Chrome, Safari, etc.)
*/
public GetUsersRequest withDeviceName(Optional<String> deviceName) {
Utils.checkNotNull(deviceName, "deviceName");
this.deviceName = deviceName;
return this;
}
/**
* The resolution of the device the client application is running on. This is used to track the client application and its usage. (1487x1165,2560x1440)
*/
public GetUsersRequest withDeviceScreenResolution(String deviceScreenResolution) {
Utils.checkNotNull(deviceScreenResolution, "deviceScreenResolution");
this.deviceScreenResolution = Optional.ofNullable(deviceScreenResolution);
return this;
}
/**
* The resolution of the device the client application is running on. This is used to track the client application and its usage. (1487x1165,2560x1440)
*/
public GetUsersRequest withDeviceScreenResolution(Optional<String> deviceScreenResolution) {
Utils.checkNotNull(deviceScreenResolution, "deviceScreenResolution");
this.deviceScreenResolution = deviceScreenResolution;
return this;
}
/**
* The version of the client application.
*/
public GetUsersRequest withClientVersion(String clientVersion) {
Utils.checkNotNull(clientVersion, "clientVersion");
this.clientVersion = Optional.ofNullable(clientVersion);
return this;
}
/**
* The version of the client application.
*/
public GetUsersRequest withClientVersion(Optional<String> clientVersion) {
Utils.checkNotNull(clientVersion, "clientVersion");
this.clientVersion = clientVersion;
return this;
}
/**
* The platform of the client application.
*/
public GetUsersRequest withPlatform(String platform) {
Utils.checkNotNull(platform, "platform");
this.platform = Optional.ofNullable(platform);
return this;
}
/**
* The platform of the client application.
*/
public GetUsersRequest withPlatform(Optional<String> platform) {
Utils.checkNotNull(platform, "platform");
this.platform = platform;
return this;
}
/**
* The features of the client application. This is used to track the client application and its usage. (external-media,indirect-media,hub-style-list)
*/
public GetUsersRequest withClientFeatures(String clientFeatures) {
Utils.checkNotNull(clientFeatures, "clientFeatures");
this.clientFeatures = Optional.ofNullable(clientFeatures);
return this;
}
/**
* The features of the client application. This is used to track the client application and its usage. (external-media,indirect-media,hub-style-list)
*/
public GetUsersRequest withClientFeatures(Optional<String> clientFeatures) {
Utils.checkNotNull(clientFeatures, "clientFeatures");
this.clientFeatures = clientFeatures;
return this;
}
/**
* A potentially less friendly identifier for the device model
*/
public GetUsersRequest withModel(String model) {
Utils.checkNotNull(model, "model");
this.model = Optional.ofNullable(model);
return this;
}
/**
* A potentially less friendly identifier for the device model
*/
public GetUsersRequest withModel(Optional<String> model) {
Utils.checkNotNull(model, "model");
this.model = model;
return this;
}
/**
* The session ID of the client application. This is used to track the client application and its usage. (97e136ef-4ddd-4ff3-89a7-a5820c96c2ca)
*/
public GetUsersRequest withXPlexSessionId(String xPlexSessionId) {
Utils.checkNotNull(xPlexSessionId, "xPlexSessionId");
this.xPlexSessionId = Optional.ofNullable(xPlexSessionId);
return this;
}
/**
* The session ID of the client application. This is used to track the client application and its usage. (97e136ef-4ddd-4ff3-89a7-a5820c96c2ca)
*/
public GetUsersRequest withXPlexSessionId(Optional<String> xPlexSessionId) {
Utils.checkNotNull(xPlexSessionId, "xPlexSessionId");
this.xPlexSessionId = xPlexSessionId;
return this;
}
/**
* The language of the client application.
*/
public GetUsersRequest withXPlexLanguage(String xPlexLanguage) {
Utils.checkNotNull(xPlexLanguage, "xPlexLanguage");
this.xPlexLanguage = Optional.ofNullable(xPlexLanguage);
return this;
}
/**
* The language of the client application.
*/
public GetUsersRequest withXPlexLanguage(Optional<String> xPlexLanguage) {
Utils.checkNotNull(xPlexLanguage, "xPlexLanguage");
this.xPlexLanguage = xPlexLanguage;
return this;
}
/**
* The version of the platform
*/
public GetUsersRequest withPlatformVersion(String platformVersion) {
Utils.checkNotNull(platformVersion, "platformVersion");
this.platformVersion = Optional.ofNullable(platformVersion);
return this;
}
/**
* The version of the platform
*/
public GetUsersRequest withPlatformVersion(Optional<String> platformVersion) {
Utils.checkNotNull(platformVersion, "platformVersion");
this.platformVersion = platformVersion;
return this;
}
/**
* An authentication token, obtained from plex.tv
*/
public GetUsersRequest withXPlexToken(String xPlexToken) {
Utils.checkNotNull(xPlexToken, "xPlexToken");
this.xPlexToken = xPlexToken;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetUsersRequest other = (GetUsersRequest) o;
return
Objects.deepEquals(this.clientID, other.clientID) &&
Objects.deepEquals(this.clientName, other.clientName) &&
Objects.deepEquals(this.deviceNickname, other.deviceNickname) &&
Objects.deepEquals(this.deviceName, other.deviceName) &&
Objects.deepEquals(this.deviceScreenResolution, other.deviceScreenResolution) &&
Objects.deepEquals(this.clientVersion, other.clientVersion) &&
Objects.deepEquals(this.platform, other.platform) &&
Objects.deepEquals(this.clientFeatures, other.clientFeatures) &&
Objects.deepEquals(this.model, other.model) &&
Objects.deepEquals(this.xPlexSessionId, other.xPlexSessionId) &&
Objects.deepEquals(this.xPlexLanguage, other.xPlexLanguage) &&
Objects.deepEquals(this.platformVersion, other.platformVersion) &&
Objects.deepEquals(this.xPlexToken, other.xPlexToken);
}
@Override
public int hashCode() {
return Objects.hash(
clientID,
clientName,
deviceNickname,
deviceName,
deviceScreenResolution,
clientVersion,
platform,
clientFeatures,
model,
xPlexSessionId,
xPlexLanguage,
platformVersion,
xPlexToken);
}
@Override
public String toString() {
return Utils.toString(GetUsersRequest.class,
"clientID", clientID,
"clientName", clientName,
"deviceNickname", deviceNickname,
"deviceName", deviceName,
"deviceScreenResolution", deviceScreenResolution,
"clientVersion", clientVersion,
"platform", platform,
"clientFeatures", clientFeatures,
"model", model,
"xPlexSessionId", xPlexSessionId,
"xPlexLanguage", xPlexLanguage,
"platformVersion", platformVersion,
"xPlexToken", xPlexToken);
}
public final static class Builder {
private String clientID;
private Optional<String> clientName = Optional.empty();
private Optional<String> deviceNickname = Optional.empty();
private Optional<String> deviceName = Optional.empty();
private Optional<String> deviceScreenResolution = Optional.empty();
private Optional<String> clientVersion = Optional.empty();
private Optional<String> platform = Optional.empty();
private Optional<String> clientFeatures = Optional.empty();
private Optional<String> model = Optional.empty();
private Optional<String> xPlexSessionId = Optional.empty();
private Optional<String> xPlexLanguage = Optional.empty();
private Optional<String> platformVersion = Optional.empty();
private String xPlexToken;
private Builder() {
// force use of static builder() method
}
/**
* An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
*/
public Builder clientID(String clientID) {
Utils.checkNotNull(clientID, "clientID");
this.clientID = clientID;
return this;
}
/**
* The name of the client application. (Plex Web, Plex Media Server, etc.)
*/
public Builder clientName(String clientName) {
Utils.checkNotNull(clientName, "clientName");
this.clientName = Optional.ofNullable(clientName);
return this;
}
/**
* The name of the client application. (Plex Web, Plex Media Server, etc.)
*/
public Builder clientName(Optional<String> clientName) {
Utils.checkNotNull(clientName, "clientName");
this.clientName = clientName;
return this;
}
/**
* A relatively friendly name for the client device
*/
public Builder deviceNickname(String deviceNickname) {
Utils.checkNotNull(deviceNickname, "deviceNickname");
this.deviceNickname = Optional.ofNullable(deviceNickname);
return this;
}
/**
* A relatively friendly name for the client device
*/
public Builder deviceNickname(Optional<String> deviceNickname) {
Utils.checkNotNull(deviceNickname, "deviceNickname");
this.deviceNickname = deviceNickname;
return this;
}
/**
* The name of the device the client application is running on. This is used to track the client application and its usage. (Chrome, Safari, etc.)
*/
public Builder deviceName(String deviceName) {
Utils.checkNotNull(deviceName, "deviceName");
this.deviceName = Optional.ofNullable(deviceName);
return this;
}
/**
* The name of the device the client application is running on. This is used to track the client application and its usage. (Chrome, Safari, etc.)
*/
public Builder deviceName(Optional<String> deviceName) {
Utils.checkNotNull(deviceName, "deviceName");
this.deviceName = deviceName;
return this;
}
/**
* The resolution of the device the client application is running on. This is used to track the client application and its usage. (1487x1165,2560x1440)
*/
public Builder deviceScreenResolution(String deviceScreenResolution) {
Utils.checkNotNull(deviceScreenResolution, "deviceScreenResolution");
this.deviceScreenResolution = Optional.ofNullable(deviceScreenResolution);
return this;
}
/**
* The resolution of the device the client application is running on. This is used to track the client application and its usage. (1487x1165,2560x1440)
*/
public Builder deviceScreenResolution(Optional<String> deviceScreenResolution) {
Utils.checkNotNull(deviceScreenResolution, "deviceScreenResolution");
this.deviceScreenResolution = deviceScreenResolution;
return this;
}
/**
* The version of the client application.
*/
public Builder clientVersion(String clientVersion) {
Utils.checkNotNull(clientVersion, "clientVersion");
this.clientVersion = Optional.ofNullable(clientVersion);
return this;
}
/**
* The version of the client application.
*/
public Builder clientVersion(Optional<String> clientVersion) {
Utils.checkNotNull(clientVersion, "clientVersion");
this.clientVersion = clientVersion;
return this;
}
/**
* The platform of the client application.
*/
public Builder platform(String platform) {
Utils.checkNotNull(platform, "platform");
this.platform = Optional.ofNullable(platform);
return this;
}
/**
* The platform of the client application.
*/
public Builder platform(Optional<String> platform) {
Utils.checkNotNull(platform, "platform");
this.platform = platform;
return this;
}
/**
* The features of the client application. This is used to track the client application and its usage. (external-media,indirect-media,hub-style-list)
*/
public Builder clientFeatures(String clientFeatures) {
Utils.checkNotNull(clientFeatures, "clientFeatures");
this.clientFeatures = Optional.ofNullable(clientFeatures);
return this;
}
/**
* The features of the client application. This is used to track the client application and its usage. (external-media,indirect-media,hub-style-list)
*/
public Builder clientFeatures(Optional<String> clientFeatures) {
Utils.checkNotNull(clientFeatures, "clientFeatures");
this.clientFeatures = clientFeatures;
return this;
}
/**
* A potentially less friendly identifier for the device model
*/
public Builder model(String model) {
Utils.checkNotNull(model, "model");
this.model = Optional.ofNullable(model);
return this;
}
/**
* A potentially less friendly identifier for the device model
*/
public Builder model(Optional<String> model) {
Utils.checkNotNull(model, "model");
this.model = model;
return this;
}
/**
* The session ID of the client application. This is used to track the client application and its usage. (97e136ef-4ddd-4ff3-89a7-a5820c96c2ca)
*/
public Builder xPlexSessionId(String xPlexSessionId) {
Utils.checkNotNull(xPlexSessionId, "xPlexSessionId");
this.xPlexSessionId = Optional.ofNullable(xPlexSessionId);
return this;
}
/**
* The session ID of the client application. This is used to track the client application and its usage. (97e136ef-4ddd-4ff3-89a7-a5820c96c2ca)
*/
public Builder xPlexSessionId(Optional<String> xPlexSessionId) {
Utils.checkNotNull(xPlexSessionId, "xPlexSessionId");
this.xPlexSessionId = xPlexSessionId;
return this;
}
/**
* The language of the client application.
*/
public Builder xPlexLanguage(String xPlexLanguage) {
Utils.checkNotNull(xPlexLanguage, "xPlexLanguage");
this.xPlexLanguage = Optional.ofNullable(xPlexLanguage);
return this;
}
/**
* The language of the client application.
*/
public Builder xPlexLanguage(Optional<String> xPlexLanguage) {
Utils.checkNotNull(xPlexLanguage, "xPlexLanguage");
this.xPlexLanguage = xPlexLanguage;
return this;
}
/**
* The version of the platform
*/
public Builder platformVersion(String platformVersion) {
Utils.checkNotNull(platformVersion, "platformVersion");
this.platformVersion = Optional.ofNullable(platformVersion);
return this;
}
/**
* The version of the platform
*/
public Builder platformVersion(Optional<String> platformVersion) {
Utils.checkNotNull(platformVersion, "platformVersion");
this.platformVersion = platformVersion;
return this;
}
/**
* An authentication token, obtained from plex.tv
*/
public Builder xPlexToken(String xPlexToken) {
Utils.checkNotNull(xPlexToken, "xPlexToken");
this.xPlexToken = xPlexToken;
return this;
}
public GetUsersRequest build() {
return new GetUsersRequest(
clientID,
clientName,
deviceNickname,
deviceName,
deviceScreenResolution,
clientVersion,
platform,
clientFeatures,
model,
xPlexSessionId,
xPlexLanguage,
platformVersion,
xPlexToken);
}
}
}

View File

@@ -0,0 +1,45 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import dev.plexapi.sdk.utils.Utils;
import java.lang.String;
import java.util.Optional;
public class GetUsersRequestBuilder {
private GetUsersRequest request;
private Optional<String> serverURL = Optional.empty();
private final SDKMethodInterfaces.MethodCallGetUsers sdk;
public GetUsersRequestBuilder(SDKMethodInterfaces.MethodCallGetUsers sdk) {
this.sdk = sdk;
}
public GetUsersRequestBuilder request(GetUsersRequest request) {
Utils.checkNotNull(request, "request");
this.request = request;
return this;
}
public GetUsersRequestBuilder serverURL(String serverURL) {
Utils.checkNotNull(serverURL, "serverURL");
this.serverURL = Optional.of(serverURL);
return this;
}
public GetUsersRequestBuilder serverURL(Optional<String> serverURL) {
Utils.checkNotNull(serverURL, "serverURL");
this.serverURL = serverURL;
return this;
}
public GetUsersResponse call() throws Exception {
return sdk.getUsers(
request,
serverURL);
}
}

View File

@@ -0,0 +1,233 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import dev.plexapi.sdk.utils.Response;
import dev.plexapi.sdk.utils.Utils;
import java.io.InputStream;
import java.lang.Integer;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.net.http.HttpResponse;
import java.util.Objects;
import java.util.Optional;
public class GetUsersResponse implements Response {
/**
* HTTP response content type for this operation
*/
private String contentType;
/**
* HTTP response status code for this operation
*/
private int statusCode;
/**
* Raw HTTP response; suitable for custom response parsing
*/
private HttpResponse<InputStream> rawResponse;
private Optional<? extends byte[]> body;
@JsonCreator
public GetUsersResponse(
String contentType,
int statusCode,
HttpResponse<InputStream> rawResponse,
Optional<? extends byte[]> body) {
Utils.checkNotNull(contentType, "contentType");
Utils.checkNotNull(statusCode, "statusCode");
Utils.checkNotNull(rawResponse, "rawResponse");
Utils.checkNotNull(body, "body");
this.contentType = contentType;
this.statusCode = statusCode;
this.rawResponse = rawResponse;
this.body = body;
}
public GetUsersResponse(
String contentType,
int statusCode,
HttpResponse<InputStream> rawResponse) {
this(contentType, statusCode, rawResponse, Optional.empty());
}
/**
* HTTP response content type for this operation
*/
@JsonIgnore
public String contentType() {
return contentType;
}
/**
* HTTP response status code for this operation
*/
@JsonIgnore
public int statusCode() {
return statusCode;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
@JsonIgnore
public HttpResponse<InputStream> rawResponse() {
return rawResponse;
}
@SuppressWarnings("unchecked")
@JsonIgnore
public Optional<byte[]> body() {
return (Optional<byte[]>) body;
}
public final static Builder builder() {
return new Builder();
}
/**
* HTTP response content type for this operation
*/
public GetUsersResponse withContentType(String contentType) {
Utils.checkNotNull(contentType, "contentType");
this.contentType = contentType;
return this;
}
/**
* HTTP response status code for this operation
*/
public GetUsersResponse withStatusCode(int statusCode) {
Utils.checkNotNull(statusCode, "statusCode");
this.statusCode = statusCode;
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public GetUsersResponse withRawResponse(HttpResponse<InputStream> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = rawResponse;
return this;
}
public GetUsersResponse withBody(byte[] body) {
Utils.checkNotNull(body, "body");
this.body = Optional.ofNullable(body);
return this;
}
public GetUsersResponse withBody(Optional<? extends byte[]> body) {
Utils.checkNotNull(body, "body");
this.body = body;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetUsersResponse other = (GetUsersResponse) o;
return
Objects.deepEquals(this.contentType, other.contentType) &&
Objects.deepEquals(this.statusCode, other.statusCode) &&
Objects.deepEquals(this.rawResponse, other.rawResponse) &&
Objects.deepEquals(this.body, other.body);
}
@Override
public int hashCode() {
return Objects.hash(
contentType,
statusCode,
rawResponse,
body);
}
@Override
public String toString() {
return Utils.toString(GetUsersResponse.class,
"contentType", contentType,
"statusCode", statusCode,
"rawResponse", rawResponse,
"body", body);
}
public final static class Builder {
private String contentType;
private Integer statusCode;
private HttpResponse<InputStream> rawResponse;
private Optional<? extends byte[]> body = Optional.empty();
private Builder() {
// force use of static builder() method
}
/**
* HTTP response content type for this operation
*/
public Builder contentType(String contentType) {
Utils.checkNotNull(contentType, "contentType");
this.contentType = contentType;
return this;
}
/**
* HTTP response status code for this operation
*/
public Builder statusCode(int statusCode) {
Utils.checkNotNull(statusCode, "statusCode");
this.statusCode = statusCode;
return this;
}
/**
* Raw HTTP response; suitable for custom response parsing
*/
public Builder rawResponse(HttpResponse<InputStream> rawResponse) {
Utils.checkNotNull(rawResponse, "rawResponse");
this.rawResponse = rawResponse;
return this;
}
public Builder body(byte[] body) {
Utils.checkNotNull(body, "body");
this.body = Optional.ofNullable(body);
return this;
}
public Builder body(Optional<? extends byte[]> body) {
Utils.checkNotNull(body, "body");
this.body = body;
return this;
}
public GetUsersResponse build() {
return new GetUsersResponse(
contentType,
statusCode,
rawResponse,
body);
}
}
}

View File

@@ -0,0 +1,127 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.Objects;
import java.util.Optional;
/**
* GetUsersResponseBody - Successful response with media container data in XML
*/
public class GetUsersResponseBody {
/**
* Container holding user and server details.
*/
private Optional<? extends GetUsersMediaContainer> mediaContainer;
@JsonCreator
public GetUsersResponseBody(
Optional<? extends GetUsersMediaContainer> mediaContainer) {
Utils.checkNotNull(mediaContainer, "mediaContainer");
this.mediaContainer = mediaContainer;
}
public GetUsersResponseBody() {
this(Optional.empty());
}
/**
* Container holding user and server details.
*/
@SuppressWarnings("unchecked")
@JsonIgnore
public Optional<GetUsersMediaContainer> mediaContainer() {
return (Optional<GetUsersMediaContainer>) mediaContainer;
}
public final static Builder builder() {
return new Builder();
}
/**
* Container holding user and server details.
*/
public GetUsersResponseBody withMediaContainer(GetUsersMediaContainer mediaContainer) {
Utils.checkNotNull(mediaContainer, "mediaContainer");
this.mediaContainer = Optional.ofNullable(mediaContainer);
return this;
}
/**
* Container holding user and server details.
*/
public GetUsersResponseBody withMediaContainer(Optional<? extends GetUsersMediaContainer> mediaContainer) {
Utils.checkNotNull(mediaContainer, "mediaContainer");
this.mediaContainer = mediaContainer;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetUsersResponseBody other = (GetUsersResponseBody) o;
return
Objects.deepEquals(this.mediaContainer, other.mediaContainer);
}
@Override
public int hashCode() {
return Objects.hash(
mediaContainer);
}
@Override
public String toString() {
return Utils.toString(GetUsersResponseBody.class,
"mediaContainer", mediaContainer);
}
public final static class Builder {
private Optional<? extends GetUsersMediaContainer> mediaContainer = Optional.empty();
private Builder() {
// force use of static builder() method
}
/**
* Container holding user and server details.
*/
public Builder mediaContainer(GetUsersMediaContainer mediaContainer) {
Utils.checkNotNull(mediaContainer, "mediaContainer");
this.mediaContainer = Optional.ofNullable(mediaContainer);
return this;
}
/**
* Container holding user and server details.
*/
public Builder mediaContainer(Optional<? extends GetUsersMediaContainer> mediaContainer) {
Utils.checkNotNull(mediaContainer, "mediaContainer");
this.mediaContainer = mediaContainer;
return this;
}
public GetUsersResponseBody build() {
return new GetUsersResponseBody(
mediaContainer);
}
}
}

View File

@@ -0,0 +1,451 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.core.type.TypeReference;
import dev.plexapi.sdk.utils.LazySingletonValue;
import dev.plexapi.sdk.utils.Utils;
import java.lang.Long;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.Objects;
import java.util.Optional;
public class GetUsersServer {
/**
* Unique ID of the server of the connected user
*/
private long id;
/**
* ID of the actual Plex server.
*/
private long serverId;
/**
* Machine identifier of the Plex server.
*/
private String machineIdentifier;
/**
* Name of the Plex server of the connected user.
*/
private String name;
private long lastSeenAt;
/**
* Number of libraries in the server this user has access to.
*/
private long numLibraries;
private Optional<? extends AllLibraries> allLibraries;
private Optional<? extends Owned> owned;
private Optional<? extends Pending> pending;
@JsonCreator
public GetUsersServer(
long id,
long serverId,
String machineIdentifier,
String name,
long lastSeenAt,
long numLibraries,
Optional<? extends AllLibraries> allLibraries,
Optional<? extends Owned> owned,
Optional<? extends Pending> pending) {
Utils.checkNotNull(id, "id");
Utils.checkNotNull(serverId, "serverId");
Utils.checkNotNull(machineIdentifier, "machineIdentifier");
Utils.checkNotNull(name, "name");
Utils.checkNotNull(lastSeenAt, "lastSeenAt");
Utils.checkNotNull(numLibraries, "numLibraries");
Utils.checkNotNull(allLibraries, "allLibraries");
Utils.checkNotNull(owned, "owned");
Utils.checkNotNull(pending, "pending");
this.id = id;
this.serverId = serverId;
this.machineIdentifier = machineIdentifier;
this.name = name;
this.lastSeenAt = lastSeenAt;
this.numLibraries = numLibraries;
this.allLibraries = allLibraries;
this.owned = owned;
this.pending = pending;
}
public GetUsersServer(
long id,
long serverId,
String machineIdentifier,
String name,
long lastSeenAt,
long numLibraries) {
this(id, serverId, machineIdentifier, name, lastSeenAt, numLibraries, Optional.empty(), Optional.empty(), Optional.empty());
}
/**
* Unique ID of the server of the connected user
*/
@JsonIgnore
public long id() {
return id;
}
/**
* ID of the actual Plex server.
*/
@JsonIgnore
public long serverId() {
return serverId;
}
/**
* Machine identifier of the Plex server.
*/
@JsonIgnore
public String machineIdentifier() {
return machineIdentifier;
}
/**
* Name of the Plex server of the connected user.
*/
@JsonIgnore
public String name() {
return name;
}
@JsonIgnore
public long lastSeenAt() {
return lastSeenAt;
}
/**
* Number of libraries in the server this user has access to.
*/
@JsonIgnore
public long numLibraries() {
return numLibraries;
}
@SuppressWarnings("unchecked")
@JsonIgnore
public Optional<AllLibraries> allLibraries() {
return (Optional<AllLibraries>) allLibraries;
}
@SuppressWarnings("unchecked")
@JsonIgnore
public Optional<Owned> owned() {
return (Optional<Owned>) owned;
}
@SuppressWarnings("unchecked")
@JsonIgnore
public Optional<Pending> pending() {
return (Optional<Pending>) pending;
}
public final static Builder builder() {
return new Builder();
}
/**
* Unique ID of the server of the connected user
*/
public GetUsersServer withId(long id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;
}
/**
* ID of the actual Plex server.
*/
public GetUsersServer withServerId(long serverId) {
Utils.checkNotNull(serverId, "serverId");
this.serverId = serverId;
return this;
}
/**
* Machine identifier of the Plex server.
*/
public GetUsersServer withMachineIdentifier(String machineIdentifier) {
Utils.checkNotNull(machineIdentifier, "machineIdentifier");
this.machineIdentifier = machineIdentifier;
return this;
}
/**
* Name of the Plex server of the connected user.
*/
public GetUsersServer withName(String name) {
Utils.checkNotNull(name, "name");
this.name = name;
return this;
}
public GetUsersServer withLastSeenAt(long lastSeenAt) {
Utils.checkNotNull(lastSeenAt, "lastSeenAt");
this.lastSeenAt = lastSeenAt;
return this;
}
/**
* Number of libraries in the server this user has access to.
*/
public GetUsersServer withNumLibraries(long numLibraries) {
Utils.checkNotNull(numLibraries, "numLibraries");
this.numLibraries = numLibraries;
return this;
}
public GetUsersServer withAllLibraries(AllLibraries allLibraries) {
Utils.checkNotNull(allLibraries, "allLibraries");
this.allLibraries = Optional.ofNullable(allLibraries);
return this;
}
public GetUsersServer withAllLibraries(Optional<? extends AllLibraries> allLibraries) {
Utils.checkNotNull(allLibraries, "allLibraries");
this.allLibraries = allLibraries;
return this;
}
public GetUsersServer withOwned(Owned owned) {
Utils.checkNotNull(owned, "owned");
this.owned = Optional.ofNullable(owned);
return this;
}
public GetUsersServer withOwned(Optional<? extends Owned> owned) {
Utils.checkNotNull(owned, "owned");
this.owned = owned;
return this;
}
public GetUsersServer withPending(Pending pending) {
Utils.checkNotNull(pending, "pending");
this.pending = Optional.ofNullable(pending);
return this;
}
public GetUsersServer withPending(Optional<? extends Pending> pending) {
Utils.checkNotNull(pending, "pending");
this.pending = pending;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetUsersServer other = (GetUsersServer) o;
return
Objects.deepEquals(this.id, other.id) &&
Objects.deepEquals(this.serverId, other.serverId) &&
Objects.deepEquals(this.machineIdentifier, other.machineIdentifier) &&
Objects.deepEquals(this.name, other.name) &&
Objects.deepEquals(this.lastSeenAt, other.lastSeenAt) &&
Objects.deepEquals(this.numLibraries, other.numLibraries) &&
Objects.deepEquals(this.allLibraries, other.allLibraries) &&
Objects.deepEquals(this.owned, other.owned) &&
Objects.deepEquals(this.pending, other.pending);
}
@Override
public int hashCode() {
return Objects.hash(
id,
serverId,
machineIdentifier,
name,
lastSeenAt,
numLibraries,
allLibraries,
owned,
pending);
}
@Override
public String toString() {
return Utils.toString(GetUsersServer.class,
"id", id,
"serverId", serverId,
"machineIdentifier", machineIdentifier,
"name", name,
"lastSeenAt", lastSeenAt,
"numLibraries", numLibraries,
"allLibraries", allLibraries,
"owned", owned,
"pending", pending);
}
public final static class Builder {
private Long id;
private Long serverId;
private String machineIdentifier;
private String name;
private Long lastSeenAt;
private Long numLibraries;
private Optional<? extends AllLibraries> allLibraries;
private Optional<? extends Owned> owned;
private Optional<? extends Pending> pending;
private Builder() {
// force use of static builder() method
}
/**
* Unique ID of the server of the connected user
*/
public Builder id(long id) {
Utils.checkNotNull(id, "id");
this.id = id;
return this;
}
/**
* ID of the actual Plex server.
*/
public Builder serverId(long serverId) {
Utils.checkNotNull(serverId, "serverId");
this.serverId = serverId;
return this;
}
/**
* Machine identifier of the Plex server.
*/
public Builder machineIdentifier(String machineIdentifier) {
Utils.checkNotNull(machineIdentifier, "machineIdentifier");
this.machineIdentifier = machineIdentifier;
return this;
}
/**
* Name of the Plex server of the connected user.
*/
public Builder name(String name) {
Utils.checkNotNull(name, "name");
this.name = name;
return this;
}
public Builder lastSeenAt(long lastSeenAt) {
Utils.checkNotNull(lastSeenAt, "lastSeenAt");
this.lastSeenAt = lastSeenAt;
return this;
}
/**
* Number of libraries in the server this user has access to.
*/
public Builder numLibraries(long numLibraries) {
Utils.checkNotNull(numLibraries, "numLibraries");
this.numLibraries = numLibraries;
return this;
}
public Builder allLibraries(AllLibraries allLibraries) {
Utils.checkNotNull(allLibraries, "allLibraries");
this.allLibraries = Optional.ofNullable(allLibraries);
return this;
}
public Builder allLibraries(Optional<? extends AllLibraries> allLibraries) {
Utils.checkNotNull(allLibraries, "allLibraries");
this.allLibraries = allLibraries;
return this;
}
public Builder owned(Owned owned) {
Utils.checkNotNull(owned, "owned");
this.owned = Optional.ofNullable(owned);
return this;
}
public Builder owned(Optional<? extends Owned> owned) {
Utils.checkNotNull(owned, "owned");
this.owned = owned;
return this;
}
public Builder pending(Pending pending) {
Utils.checkNotNull(pending, "pending");
this.pending = Optional.ofNullable(pending);
return this;
}
public Builder pending(Optional<? extends Pending> pending) {
Utils.checkNotNull(pending, "pending");
this.pending = pending;
return this;
}
public GetUsersServer build() {
if (allLibraries == null) {
allLibraries = _SINGLETON_VALUE_AllLibraries.value();
}
if (owned == null) {
owned = _SINGLETON_VALUE_Owned.value();
}
if (pending == null) {
pending = _SINGLETON_VALUE_Pending.value();
} return new GetUsersServer(
id,
serverId,
machineIdentifier,
name,
lastSeenAt,
numLibraries,
allLibraries,
owned,
pending);
}
private static final LazySingletonValue<Optional<? extends AllLibraries>> _SINGLETON_VALUE_AllLibraries =
new LazySingletonValue<>(
"allLibraries",
"0",
new TypeReference<Optional<? extends AllLibraries>>() {});
private static final LazySingletonValue<Optional<? extends Owned>> _SINGLETON_VALUE_Owned =
new LazySingletonValue<>(
"owned",
"0",
new TypeReference<Optional<? extends Owned>>() {});
private static final LazySingletonValue<Optional<? extends Pending>> _SINGLETON_VALUE_Pending =
new LazySingletonValue<>(
"pending",
"0",
new TypeReference<Optional<? extends Pending>>() {});
}
}

View File

@@ -0,0 +1,37 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import java.util.Optional;
/**
* Home - Indicates if the user is part of a home group.
*/
public enum Home {
Disable(0),
Enable(1);
@JsonValue
private final int value;
private Home(int value) {
this.value = value;
}
public int value() {
return value;
}
public static Optional<Home> fromValue(int value) {
for (Home o: Home.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
}

View File

@@ -0,0 +1,37 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import java.util.Optional;
/**
* Owned - Indicates if the user owns the server.
*/
public enum Owned {
Disable(0),
Enable(1);
@JsonValue
private final int value;
private Owned(int value) {
this.value = value;
}
public int value() {
return value;
}
public static Optional<Owned> fromValue(int value) {
for (Owned o: Owned.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
}

View File

@@ -0,0 +1,37 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import java.util.Optional;
/**
* Pending - Indicates if the server is pending approval.
*/
public enum Pending {
Disable(0),
Enable(1);
@JsonValue
private final int value;
private Pending(int value) {
this.value = value;
}
public int value() {
return value;
}
public static Optional<Pending> fromValue(int value) {
for (Pending o: Pending.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
}

View File

@@ -0,0 +1,37 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import java.util.Optional;
/**
* Protected - Indicates whether the account is protected.
*/
public enum Protected {
Disable(0),
Enable(1);
@JsonValue
private final int value;
private Protected(int value) {
this.value = value;
}
public int value() {
return value;
}
public static Optional<Protected> fromValue(int value) {
for (Protected o: Protected.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
}

View File

@@ -0,0 +1,37 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package dev.plexapi.sdk.models.operations;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import java.util.Optional;
/**
* Restricted - Indicates if the user has restricted access.
*/
public enum Restricted {
Disable(0),
Enable(1);
@JsonValue
private final int value;
private Restricted(int value) {
this.value = value;
}
public int value() {
return value;
}
public static Optional<Restricted> fromValue(int value) {
for (Restricted o: Restricted.values()) {
if (Objects.deepEquals(o.value, value)) {
return Optional.of(o);
}
}
return Optional.empty();
}
}

View File

@@ -501,4 +501,11 @@ public class SDKMethodInterfaces {
}
public interface MethodCallGetUsers {
GetUsersResponse getUsers(
GetUsersRequest request,
Optional<String> serverURL) throws Exception;
}
}

File diff suppressed because it is too large Load Diff