1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.bremersee.apiclient.webflux;
18
19 import java.net.URI;
20 import java.util.function.BiConsumer;
21 import java.util.function.BiFunction;
22 import javax.validation.Valid;
23 import javax.validation.constraints.NotNull;
24 import org.immutables.value.Value;
25 import org.immutables.value.Value.Style.ImplementationVisibility;
26 import org.reactivestreams.Publisher;
27 import org.springframework.http.HttpHeaders;
28 import org.springframework.util.MultiValueMap;
29 import org.springframework.web.reactive.function.client.WebClient;
30 import org.springframework.web.reactive.function.client.WebClient.RequestBodyUriSpec;
31 import org.springframework.web.reactive.function.client.WebClient.RequestHeadersUriSpec;
32 import org.springframework.web.reactive.function.client.WebClient.ResponseSpec;
33 import org.springframework.web.util.UriBuilder;
34
35
36
37
38
39
40 @Value.Immutable
41 @Value.Style(visibility = ImplementationVisibility.PACKAGE)
42 @Valid
43 public interface ReactiveContract {
44
45
46
47
48
49
50 static ImmutableReactiveContract.Builder builder() {
51 return ImmutableReactiveContract.builder();
52 }
53
54
55
56
57
58
59 @NotNull
60 BiConsumer<Invocation, MultiValueMap<String, String>> getCookiesConsumer();
61
62
63
64
65
66
67 @NotNull
68 BiConsumer<Invocation, HttpHeaders> getHeadersConsumer();
69
70
71
72
73
74
75 @NotNull
76 BiFunction<Invocation, UriBuilder, URI> getRequestUriFunction();
77
78
79
80
81
82
83 @NotNull
84 BiFunction<Invocation, WebClient, RequestHeadersUriSpec<?>> getRequestUriSpecFunction();
85
86
87
88
89
90
91 @NotNull
92 BiFunction<Invocation, RequestBodyUriSpec, RequestHeadersUriSpec<?>>
93 getRequestBodyInserterFunction();
94
95
96
97
98
99
100 @NotNull
101 BiFunction<Invocation, ResponseSpec, Publisher<?>> getResponseFunction();
102
103 }