-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSDKConfiguration.java
More file actions
155 lines (123 loc) · 4.3 KB
/
Copy pathSDKConfiguration.java
File metadata and controls
155 lines (123 loc) · 4.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package com.apideck.unify;
import com.apideck.unify.hooks.SDKHooks;
import com.apideck.unify.utils.AsyncHooks;
import com.apideck.unify.utils.Globals;
import com.apideck.unify.utils.HTTPClient;
import com.apideck.unify.utils.Hooks;
import com.apideck.unify.utils.RetryConfig;
import com.apideck.unify.utils.SpeakeasyHTTPClient;
import com.apideck.unify.utils.Utils;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.Optional;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
public class SDKConfiguration {
private static final String LANGUAGE = "java";
public static final String OPENAPI_DOC_VERSION = "10.21.15";
public static final String SDK_VERSION = "0.27.4";
public static final String GEN_VERSION = "2.755.0";
private static final String BASE_PACKAGE = "com.apideck.unify";
public static final String USER_AGENT =
String.format("speakeasy-sdk/%s %s %s %s %s",
LANGUAGE, SDK_VERSION, GEN_VERSION, OPENAPI_DOC_VERSION, BASE_PACKAGE);
private SecuritySource securitySource = SecuritySource.of(null);
public SecuritySource securitySource() {
return securitySource;
}
public void setSecuritySource(SecuritySource securitySource) {
Utils.checkNotNull(securitySource, "securitySource");
this.securitySource = securitySource;
}
private HTTPClient client = new SpeakeasyHTTPClient();
public HTTPClient client() {
return client;
}
public void setClient(HTTPClient client) {
Utils.checkNotNull(client, "client");
this.client = client;
}
private String serverUrl;
public String serverUrl() {
return serverUrl;
}
public void setServerUrl(String serverUrl) {
Utils.checkNotNull(serverUrl, "serverUrl");
this.serverUrl = trimFinalSlash(serverUrl);
}
private static String trimFinalSlash(String url) {
if (url == null) {
return null;
} else if (url.endsWith("/")) {
return url.substring(0, url.length() - 1);
} else {
return url;
}
}
public String resolvedServerUrl() {
return serverUrl;
}
private int serverIdx = 0;
public void setServerIdx(int serverIdx) {
this.serverIdx = serverIdx;
}
public int serverIdx() {
return serverIdx;
}
private Hooks _hooks = createHooks();
private static Hooks createHooks() {
Hooks hooks = new Hooks();
return hooks;
}
public Hooks hooks() {
return _hooks;
}
public void setHooks(Hooks hooks) {
this._hooks = hooks;
}
/**
* Initializes state (for example hooks).
**/
public void initialize() {
SDKHooks.initialize(_hooks);
SDKHooks.initialize(_asyncHooks);
}
@SuppressWarnings("serial")
public Globals globals = new Globals();
/**
* Sets the globals configuration. Used by Spring Boot auto-configuration.
*
* @param globals The globals configuration to set.
*/
public void setGlobals(Globals globals) {
Utils.checkNotNull(globals, "globals");
this.globals = globals;
}
private Optional<RetryConfig> retryConfig = Optional.empty();
public Optional<RetryConfig> retryConfig() {
return retryConfig;
}
public void setRetryConfig(Optional<RetryConfig> retryConfig) {
Utils.checkNotNull(retryConfig, "retryConfig");
this.retryConfig = retryConfig;
}
private ScheduledExecutorService retryScheduler = Executors.newSingleThreadScheduledExecutor();
public ScheduledExecutorService retryScheduler() {
return retryScheduler;
}
public void setAsyncRetryScheduler(ScheduledExecutorService retryScheduler) {
Utils.checkNotNull(retryScheduler, "retryScheduler");
this.retryScheduler = retryScheduler;
}
private AsyncHooks _asyncHooks = new AsyncHooks();
public AsyncHooks asyncHooks() {
return _asyncHooks;
}
public void setAsyncHooks(AsyncHooks asyncHooks) {
Utils.checkNotNull(asyncHooks, "asyncHooks");
this._asyncHooks = asyncHooks;
}
}