A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
VaRestTypes.h
Go to the documentation of this file.
1// Copyright 2014-2019 Vladimir Alyamkin. All Rights Reserved.
2
3#pragma once
4
5#include "Engine/EngineBaseTypes.h"
6
7#include "VaRestTypes.generated.h"
8
10UENUM(BlueprintType)
11enum class EVaRestRequestVerb : uint8
12{
13 GET,
15 PUT,
16 DEL UMETA(DisplayName = "DELETE"),
18 CUSTOM
19};
20
21// clang-format off
23UENUM(BlueprintType)
24enum class EVaRestRequestContentType : uint8
25{
26 x_www_form_urlencoded_url UMETA(DisplayName = "x-www-form-urlencoded (URL)"),
27 x_www_form_urlencoded_body UMETA(DisplayName = "x-www-form-urlencoded (Request Body)"),
28 json,
29 binary,
31};
32// clang-format on
33
35UENUM(BlueprintType)
36enum class EVaRestRequestStatus : uint8
37{
43 Failed,
48};
49
50// Taken from Interfaces/IHttpResponse.h (had to make BlueprintType :/)
51UENUM(BlueprintType)
53{
57enum Type
58{
59 // status code not set yet
60 Unknown = 0 UMETA(DisplayName = "Unknown = 0"),
61 // the request can be continued.
62 Continue = 100 UMETA(DisplayName = "Continue = 100"),
63 // the server has switched protocols in an upgrade header.
64 SwitchProtocol = 101 UMETA(DisplayName = "SwitchProtocol = 101"),
65 // the request completed successfully.
66 Ok = 200 UMETA(DisplayName = "Ok = 200"),
67 // the request has been fulfilled and resulted in the creation of a new resource.
68 Created = 201 UMETA(DisplayName = "Created = 201"),
69 // the request has been accepted for processing, but the processing has not been completed.
70 Accepted = 202 UMETA(DisplayName = "Accepted = 202"),
71 // the returned meta information in the entity-header is not the definitive set available from the origin server.
72 Partial = 203 UMETA(DisplayName = "Partial = 203"),
73 // the server has fulfilled the request, but there is no new information to send back.
74 NoContent = 204 UMETA(DisplayName = "NoContent = 204"),
75 // the request has been completed, and the client program should reset the document view that caused the request to be sent to allow the user to easily initiate another input action.
76 ResetContent = 205 UMETA(DisplayName = "ResetContent = 205"),
77 // the server has fulfilled the partial get request for the resource.
78 PartialContent = 206 UMETA(DisplayName = "PartialContent = 206"),
79 // the server couldn't decide what to return.
80 Ambiguous = 300 UMETA(DisplayName = "Ambiguous = 300"),
81 // the requested resource has been assigned to a new permanent uri (uniform resource identifier), and any future references to this resource should be done using one of the returned uris.
82 Moved = 301 UMETA(DisplayName = "Moved = 301"),
83 // the requested resource resides temporarily under a different uri (uniform resource identifier).
84 Redirect = 302 UMETA(DisplayName = "Redirect = 302"),
85 // the response to the request can be found under a different uri (uniform resource identifier) and should be retrieved using a get http verb on that resource.
86 RedirectMethod = 303 UMETA(DisplayName = "RedirectMethod = 303"),
87 // the requested resource has not been modified.
88 NotModified = 304 UMETA(DisplayName = "NotModified = 304"),
89 // the requested resource must be accessed through the proxy given by the location field.
90 UseProxy = 305 UMETA(DisplayName = "UseProxy = 305"),
91 // the redirected request keeps the same http verb. http/1.1 behavior.
92 RedirectKeepVerb = 307 UMETA(DisplayName = "RedirectKeepVerb = 307"),
93 // the request could not be processed by the server due to invalid syntax.
94 BadRequest = 400 UMETA(DisplayName = "BadRequest = 400"),
95 // the requested resource requires user authentication.
96 Denied = 401 UMETA(DisplayName = "Denied = 401"),
97 // not currently implemented in the http protocol.
98 PaymentReq = 402 UMETA(DisplayName = "PaymentReq = 402"),
99 // the server understood the request, but is refusing to fulfill it.
100 Forbidden = 403 UMETA(DisplayName = "Forbidden = 403"),
101 // the server has not found anything matching the requested uri (uniform resource identifier).
102 NotFound = 404 UMETA(DisplayName = "NotFound = 404"),
103 // the http verb used is not allowed.
104 BadMethod = 405 UMETA(DisplayName = "BadMethod = 405"),
105 // no responses acceptable to the client were found.
106 NoneAcceptable = 406 UMETA(DisplayName = "NoneAcceptable = 406"),
107 // proxy authentication required.
108 ProxyAuthReq = 407 UMETA(DisplayName = "ProxyAuthReq = 407"),
109 // the server timed out waiting for the request.
110 RequestTimeout = 408 UMETA(DisplayName = "RequestTimeout = 408"),
111 // the request could not be completed due to a conflict with the current state of the resource. the user should resubmit with more information.
112 Conflict = 409 UMETA(DisplayName = "Conflict = 409"),
113 // the requested resource is no longer available at the server, and no forwarding address is known.
114 Gone = 410 UMETA(DisplayName = "Gone = 410"),
115 // the server refuses to accept the request without a defined content length.
116 LengthRequired = 411 UMETA(DisplayName = "LengthRequired = 411"),
117 // the precondition given in one or more of the request header fields evaluated to false when it was tested on the server.
118 PrecondFailed = 412 UMETA(DisplayName = "PrecondFailed = 412"),
119 // the server is refusing to process a request because the request entity is larger than the server is willing or able to process.
120 RequestTooLarge = 413 UMETA(DisplayName = "RequestTooLarge = 413"),
121 // the server is refusing to service the request because the request uri (uniform resource identifier) is longer than the server is willing to interpret.
122 UriTooLong = 414 UMETA(DisplayName = "UriTooLong = 414"),
123 // the server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method.
124 UnsupportedMedia = 415 UMETA(DisplayName = "UnsupportedMedia = 415"),
125 // too many requests, the server is throttling
126 TooManyRequests = 429 UMETA(DisplayName = "TooManyRequests = 429"),
127 // the request should be retried after doing the appropriate action.
128 RetryWith = 449 UMETA(DisplayName = "RetryWith = 449"),
129 // the server encountered an unexpected condition that prevented it from fulfilling the request.
130 ServerError = 500 UMETA(DisplayName = "ServerError = 500"),
131 // the server does not support the functionality required to fulfill the request.
132 NotSupported = 501 UMETA(DisplayName = "NotSupported = 501"),
133 // the server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the request.
134 BadGateway = 502 UMETA(DisplayName = "BadGateway = 502"),
135 // the service is temporarily overloaded.
136 ServiceUnavail = 503 UMETA(DisplayName = "ServiceUnavail = 503"),
137 // the request was timed out waiting for a gateway.
138 GatewayTimeout = 504 UMETA(DisplayName = "GatewayTimeout = 504"),
139 // the server does not support, or refuses to support, the http protocol version that was used in the request message.
140 VersionNotSup = 505 UMETA(DisplayName = "VersionNotSup = 505")
141};
142} // namespace EVaRestHttpStatusCode
143
147USTRUCT(BlueprintType)
148struct VAREST_API FVaRestURL
149{
150 GENERATED_BODY()
151
152
153 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "URL")
154 FString Protocol;
155
157 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "URL")
158 FString Host;
159
161 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "URL")
162 int32 Port;
164 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "URL")
165 int32 Valid;
166
168 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "URL")
169 FString Map;
170
172 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "URL")
173 FString RedirectURL;
174
176 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "URL")
177 TArray<FString> Op;
178
180 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "URL")
181 FString Portal;
182
183 FVaRestURL()
184 : Port(0)
185 , Valid(0)
186 {
187 }
188
189 FVaRestURL(FURL& InUrl)
190 : Protocol(InUrl.Protocol)
191 , Host(InUrl.Host)
192 , Port(InUrl.Port)
193 , Valid(InUrl.Valid)
194 , Map(InUrl.Map)
195 , RedirectURL(InUrl.RedirectURL)
196 , Op(InUrl.Op)
197 , Portal(InUrl.Portal)
198 {
199 }
200};
EVaRestRequestContentType
UENUM(BlueprintType)
Definition VaRestTypes.h:31
EVaRestRequestVerb
UENUM(BlueprintType)
Definition VaRestTypes.h:15
EVaRestRequestStatus
UENUM(BlueprintType)
Definition VaRestTypes.h:46
UENUM(BlueprintType)
Definition VaRestTypes.h:65
USTRUCT(BlueprintType)
FString Protocol
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "URL")
FVaRestURL(FURL &InUrl)
FString Host
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "URL")
FString RedirectURL
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "URL")
FString Map
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "URL")
FString Portal
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "URL")
TArray< FString > Op
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "URL")
int32 Port
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "URL")
int32 Valid
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "URL")