/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ package dev.plexapi.sdk.models.operations; import com.fasterxml.jackson.core.type.TypeReference; import dev.plexapi.sdk.utils.LazySingletonValue; import dev.plexapi.sdk.utils.Options; import dev.plexapi.sdk.utils.RetryConfig; import dev.plexapi.sdk.utils.Utils; import java.lang.String; import java.util.Optional; public class GetServerResourcesRequestBuilder { private Optional includeHttps = Utils.readDefaultOrConstValue( "includeHttps", "0", new TypeReference>() {}); private Optional includeRelay = Utils.readDefaultOrConstValue( "includeRelay", "0", new TypeReference>() {}); private Optional includeIPv6 = Utils.readDefaultOrConstValue( "includeIPv6", "0", new TypeReference>() {}); private Optional clientID = Optional.empty(); private Optional serverURL = Optional.empty(); private Optional retryConfig = Optional.empty(); private final SDKMethodInterfaces.MethodCallGetServerResources sdk; public GetServerResourcesRequestBuilder(SDKMethodInterfaces.MethodCallGetServerResources sdk) { this.sdk = sdk; } public GetServerResourcesRequestBuilder includeHttps(IncludeHttps includeHttps) { Utils.checkNotNull(includeHttps, "includeHttps"); this.includeHttps = Optional.of(includeHttps); return this; } public GetServerResourcesRequestBuilder includeHttps(Optional includeHttps) { Utils.checkNotNull(includeHttps, "includeHttps"); this.includeHttps = includeHttps; return this; } public GetServerResourcesRequestBuilder includeRelay(IncludeRelay includeRelay) { Utils.checkNotNull(includeRelay, "includeRelay"); this.includeRelay = Optional.of(includeRelay); return this; } public GetServerResourcesRequestBuilder includeRelay(Optional includeRelay) { Utils.checkNotNull(includeRelay, "includeRelay"); this.includeRelay = includeRelay; return this; } public GetServerResourcesRequestBuilder includeIPv6(IncludeIPv6 includeIPv6) { Utils.checkNotNull(includeIPv6, "includeIPv6"); this.includeIPv6 = Optional.of(includeIPv6); return this; } public GetServerResourcesRequestBuilder includeIPv6(Optional includeIPv6) { Utils.checkNotNull(includeIPv6, "includeIPv6"); this.includeIPv6 = includeIPv6; return this; } public GetServerResourcesRequestBuilder clientID(String clientID) { Utils.checkNotNull(clientID, "clientID"); this.clientID = Optional.of(clientID); return this; } public GetServerResourcesRequestBuilder clientID(Optional clientID) { Utils.checkNotNull(clientID, "clientID"); this.clientID = clientID; return this; } public GetServerResourcesRequestBuilder serverURL(String serverURL) { Utils.checkNotNull(serverURL, "serverURL"); this.serverURL = Optional.of(serverURL); return this; } public GetServerResourcesRequestBuilder serverURL(Optional serverURL) { Utils.checkNotNull(serverURL, "serverURL"); this.serverURL = serverURL; return this; } public GetServerResourcesRequestBuilder retryConfig(RetryConfig retryConfig) { Utils.checkNotNull(retryConfig, "retryConfig"); this.retryConfig = Optional.of(retryConfig); return this; } public GetServerResourcesRequestBuilder retryConfig(Optional retryConfig) { Utils.checkNotNull(retryConfig, "retryConfig"); this.retryConfig = retryConfig; return this; } public GetServerResourcesResponse call() throws Exception { if (includeHttps == null) { includeHttps = _SINGLETON_VALUE_IncludeHttps.value(); } if (includeRelay == null) { includeRelay = _SINGLETON_VALUE_IncludeRelay.value(); } if (includeIPv6 == null) { includeIPv6 = _SINGLETON_VALUE_IncludeIPv6.value(); } Optional options = Optional.of(Options.builder() .retryConfig(retryConfig) .build()); return sdk.getServerResources( includeHttps, includeRelay, includeIPv6, clientID, serverURL, options); } private static final LazySingletonValue> _SINGLETON_VALUE_IncludeHttps = new LazySingletonValue<>( "includeHttps", "0", new TypeReference>() {}); private static final LazySingletonValue> _SINGLETON_VALUE_IncludeRelay = new LazySingletonValue<>( "includeRelay", "0", new TypeReference>() {}); private static final LazySingletonValue> _SINGLETON_VALUE_IncludeIPv6 = new LazySingletonValue<>( "includeIPv6", "0", new TypeReference>() {}); }