/* * 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.SpeakeasyMetadata; 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.List; import java.util.Objects; import java.util.Optional; public class GetSearchAllLibrariesRequest { /** * The search query term. */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=query") private String query; /** * 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; /** * Limit the number of results returned. */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") private Optional limit; /** * A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv. * */ @SpeakeasyMetadata("queryParam:style=form,explode=false,name=searchTypes") private Optional> searchTypes; /** * Whether to include collections in the search results. */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeCollections") private Optional includeCollections; /** * Whether to include external media in the search results. */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeExternalMedia") private Optional includeExternalMedia; @JsonCreator public GetSearchAllLibrariesRequest( String query, String clientID, Optional limit, Optional> searchTypes, Optional includeCollections, Optional includeExternalMedia) { Utils.checkNotNull(query, "query"); Utils.checkNotNull(clientID, "clientID"); Utils.checkNotNull(limit, "limit"); Utils.checkNotNull(searchTypes, "searchTypes"); Utils.checkNotNull(includeCollections, "includeCollections"); Utils.checkNotNull(includeExternalMedia, "includeExternalMedia"); this.query = query; this.clientID = clientID; this.limit = limit; this.searchTypes = searchTypes; this.includeCollections = includeCollections; this.includeExternalMedia = includeExternalMedia; } public GetSearchAllLibrariesRequest( String query, String clientID) { this(query, clientID, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } /** * The search query term. */ @JsonIgnore public String query() { return query; } /** * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ @JsonIgnore public String clientID() { return clientID; } /** * Limit the number of results returned. */ @JsonIgnore public Optional limit() { return limit; } /** * A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv. * */ @SuppressWarnings("unchecked") @JsonIgnore public Optional> searchTypes() { return (Optional>) searchTypes; } /** * Whether to include collections in the search results. */ @SuppressWarnings("unchecked") @JsonIgnore public Optional includeCollections() { return (Optional) includeCollections; } /** * Whether to include external media in the search results. */ @SuppressWarnings("unchecked") @JsonIgnore public Optional includeExternalMedia() { return (Optional) includeExternalMedia; } public final static Builder builder() { return new Builder(); } /** * The search query term. */ public GetSearchAllLibrariesRequest withQuery(String query) { Utils.checkNotNull(query, "query"); this.query = query; return this; } /** * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ public GetSearchAllLibrariesRequest withClientID(String clientID) { Utils.checkNotNull(clientID, "clientID"); this.clientID = clientID; return this; } /** * Limit the number of results returned. */ public GetSearchAllLibrariesRequest withLimit(long limit) { Utils.checkNotNull(limit, "limit"); this.limit = Optional.ofNullable(limit); return this; } /** * Limit the number of results returned. */ public GetSearchAllLibrariesRequest withLimit(Optional limit) { Utils.checkNotNull(limit, "limit"); this.limit = limit; return this; } /** * A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv. * */ public GetSearchAllLibrariesRequest withSearchTypes(List searchTypes) { Utils.checkNotNull(searchTypes, "searchTypes"); this.searchTypes = Optional.ofNullable(searchTypes); return this; } /** * A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv. * */ public GetSearchAllLibrariesRequest withSearchTypes(Optional> searchTypes) { Utils.checkNotNull(searchTypes, "searchTypes"); this.searchTypes = searchTypes; return this; } /** * Whether to include collections in the search results. */ public GetSearchAllLibrariesRequest withIncludeCollections(QueryParamIncludeCollections includeCollections) { Utils.checkNotNull(includeCollections, "includeCollections"); this.includeCollections = Optional.ofNullable(includeCollections); return this; } /** * Whether to include collections in the search results. */ public GetSearchAllLibrariesRequest withIncludeCollections(Optional includeCollections) { Utils.checkNotNull(includeCollections, "includeCollections"); this.includeCollections = includeCollections; return this; } /** * Whether to include external media in the search results. */ public GetSearchAllLibrariesRequest withIncludeExternalMedia(QueryParamIncludeExternalMedia includeExternalMedia) { Utils.checkNotNull(includeExternalMedia, "includeExternalMedia"); this.includeExternalMedia = Optional.ofNullable(includeExternalMedia); return this; } /** * Whether to include external media in the search results. */ public GetSearchAllLibrariesRequest withIncludeExternalMedia(Optional includeExternalMedia) { Utils.checkNotNull(includeExternalMedia, "includeExternalMedia"); this.includeExternalMedia = includeExternalMedia; return this; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } GetSearchAllLibrariesRequest other = (GetSearchAllLibrariesRequest) o; return Objects.deepEquals(this.query, other.query) && Objects.deepEquals(this.clientID, other.clientID) && Objects.deepEquals(this.limit, other.limit) && Objects.deepEquals(this.searchTypes, other.searchTypes) && Objects.deepEquals(this.includeCollections, other.includeCollections) && Objects.deepEquals(this.includeExternalMedia, other.includeExternalMedia); } @Override public int hashCode() { return Objects.hash( query, clientID, limit, searchTypes, includeCollections, includeExternalMedia); } @Override public String toString() { return Utils.toString(GetSearchAllLibrariesRequest.class, "query", query, "clientID", clientID, "limit", limit, "searchTypes", searchTypes, "includeCollections", includeCollections, "includeExternalMedia", includeExternalMedia); } public final static class Builder { private String query; private String clientID; private Optional limit = Optional.empty(); private Optional> searchTypes = Optional.empty(); private Optional includeCollections; private Optional includeExternalMedia; private Builder() { // force use of static builder() method } /** * The search query term. */ public Builder query(String query) { Utils.checkNotNull(query, "query"); this.query = query; return this; } /** * 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; } /** * Limit the number of results returned. */ public Builder limit(long limit) { Utils.checkNotNull(limit, "limit"); this.limit = Optional.ofNullable(limit); return this; } /** * Limit the number of results returned. */ public Builder limit(Optional limit) { Utils.checkNotNull(limit, "limit"); this.limit = limit; return this; } /** * A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv. * */ public Builder searchTypes(List searchTypes) { Utils.checkNotNull(searchTypes, "searchTypes"); this.searchTypes = Optional.ofNullable(searchTypes); return this; } /** * A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv. * */ public Builder searchTypes(Optional> searchTypes) { Utils.checkNotNull(searchTypes, "searchTypes"); this.searchTypes = searchTypes; return this; } /** * Whether to include collections in the search results. */ public Builder includeCollections(QueryParamIncludeCollections includeCollections) { Utils.checkNotNull(includeCollections, "includeCollections"); this.includeCollections = Optional.ofNullable(includeCollections); return this; } /** * Whether to include collections in the search results. */ public Builder includeCollections(Optional includeCollections) { Utils.checkNotNull(includeCollections, "includeCollections"); this.includeCollections = includeCollections; return this; } /** * Whether to include external media in the search results. */ public Builder includeExternalMedia(QueryParamIncludeExternalMedia includeExternalMedia) { Utils.checkNotNull(includeExternalMedia, "includeExternalMedia"); this.includeExternalMedia = Optional.ofNullable(includeExternalMedia); return this; } /** * Whether to include external media in the search results. */ public Builder includeExternalMedia(Optional includeExternalMedia) { Utils.checkNotNull(includeExternalMedia, "includeExternalMedia"); this.includeExternalMedia = includeExternalMedia; return this; } public GetSearchAllLibrariesRequest build() { if (includeCollections == null) { includeCollections = _SINGLETON_VALUE_IncludeCollections.value(); } if (includeExternalMedia == null) { includeExternalMedia = _SINGLETON_VALUE_IncludeExternalMedia.value(); } return new GetSearchAllLibrariesRequest( query, clientID, limit, searchTypes, includeCollections, includeExternalMedia); } private static final LazySingletonValue> _SINGLETON_VALUE_IncludeCollections = new LazySingletonValue<>( "includeCollections", "0", new TypeReference>() {}); private static final LazySingletonValue> _SINGLETON_VALUE_IncludeExternalMedia = new LazySingletonValue<>( "includeExternalMedia", "0", new TypeReference>() {}); } }