@@ -50,57 +50,89 @@ default SELF method(String method) {
5050 return self ();
5151 }
5252
53+ /**
54+ * Sets the endpoint URI for the HTTP call.
55+ *
56+ * @param endpoint the URI to call
57+ * @return this builder instance for method chaining
58+ */
5359 default SELF endpoint (URI endpoint ) {
5460 ((CallHTTP ) this .self ().getTask ())
5561 .getWith ()
5662 .setEndpoint (new Endpoint ().withUriTemplate (new UriTemplate ().withLiteralUri (endpoint )));
5763 return self ();
5864 }
5965
66+ /**
67+ * Sets the endpoint URI for the HTTP call with authentication configuration.
68+ *
69+ * @param endpoint the URI to call
70+ * @param auth consumer to configure authentication policy
71+ * @return this builder instance for method chaining
72+ */
6073 default SELF endpoint (URI endpoint , Consumer <ReferenceableAuthenticationPolicyBuilder > auth ) {
6174 final ReferenceableAuthenticationPolicyBuilder policy =
6275 new ReferenceableAuthenticationPolicyBuilder ();
63- final UriTemplate uriTemplate = new UriTemplate ().withLiteralUri (endpoint );
6476 auth .accept (policy );
6577 ((CallHTTP ) this .self ().getTask ())
6678 .getWith ()
6779 .setEndpoint (
6880 new Endpoint ()
6981 .withEndpointConfiguration (
7082 new EndpointConfiguration ()
71- .withUri (new EndpointUri ().withLiteralEndpointURI (uriTemplate ))
72- .withAuthentication (policy .build ()))
73- .withUriTemplate (uriTemplate ));
83+ .withUri (
84+ new EndpointUri ()
85+ .withLiteralEndpointURI (new UriTemplate ().withLiteralUri (endpoint )))
86+ .withAuthentication (policy .build ())));
7487 return self ();
7588 }
7689
90+ /**
91+ * Sets the endpoint using a runtime expression or URI string.
92+ *
93+ * @param expr the runtime expression or URI string for the endpoint
94+ * @return this builder instance for method chaining
95+ */
7796 default SELF endpoint (String expr ) {
7897 ((CallHTTP ) this .self ().getTask ()).getWith ().setEndpoint (EndpointUtil .fromString (expr ));
7998 return self ();
8099 }
81100
101+ /**
102+ * Sets the endpoint using a runtime expression or URI string with authentication configuration.
103+ *
104+ * @param expr the runtime expression or URI string for the endpoint
105+ * @param auth consumer to configure authentication policy
106+ * @return this builder instance for method chaining
107+ */
82108 default SELF endpoint (String expr , Consumer <ReferenceableAuthenticationPolicyBuilder > auth ) {
83109 final ReferenceableAuthenticationPolicyBuilder policy =
84110 new ReferenceableAuthenticationPolicyBuilder ();
85111 auth .accept (policy );
86112
87- final Endpoint endpoint = EndpointUtil .fromString (expr );
88- endpoint .setEndpointConfiguration (
89- new EndpointConfiguration ().withAuthentication (policy .build ()));
90-
91- ((CallHTTP ) this .self ().getTask ()).getWith ().setEndpoint (endpoint );
113+ ((CallHTTP ) this .self ().getTask ())
114+ .getWith ()
115+ .setEndpoint (EndpointUtil .fromString (expr , policy .build ()));
92116 return self ();
93117 }
94118
119+ /**
120+ * Sets the endpoint using a runtime expression or URI string with authentication policy
121+ * reference.
122+ *
123+ * @param expr the runtime expression or URI string for the endpoint
124+ * @param authUse the name of the authentication policy to reference
125+ * @return this builder instance for method chaining
126+ */
95127 default SELF endpoint (String expr , String authUse ) {
96- final Endpoint endpoint = EndpointUtil .fromString (expr );
97- endpoint .withEndpointConfiguration (
98- new EndpointConfiguration ()
99- .withAuthentication (
128+ ((CallHTTP ) this .self ().getTask ())
129+ .getWith ()
130+ .setEndpoint (
131+ EndpointUtil .fromString (
132+ expr ,
100133 new ReferenceableAuthenticationPolicy ()
101134 .withAuthenticationPolicyReference (
102135 new AuthenticationPolicyReference (authUse ))));
103- ((CallHTTP ) this .self ().getTask ()).getWith ().setEndpoint (endpoint );
104136 return self ();
105137 }
106138
0 commit comments