4545import com .google .api .gax .rpc .UnaryCallSettings ;
4646import com .google .api .gax .rpc .UnaryCallable ;
4747import com .google .cloud .memcache .v1beta2 .ApplyParametersRequest ;
48+ import com .google .cloud .memcache .v1beta2 .ApplySoftwareUpdateRequest ;
4849import com .google .cloud .memcache .v1beta2 .CreateInstanceRequest ;
4950import com .google .cloud .memcache .v1beta2 .DeleteInstanceRequest ;
5051import com .google .cloud .memcache .v1beta2 .GetInstanceRequest ;
@@ -123,6 +124,10 @@ public class CloudMemcacheStubSettings extends StubSettings<CloudMemcacheStubSet
123124 private final UnaryCallSettings <ApplyParametersRequest , Operation > applyParametersSettings ;
124125 private final OperationCallSettings <ApplyParametersRequest , Instance , OperationMetadata >
125126 applyParametersOperationSettings ;
127+ private final UnaryCallSettings <ApplySoftwareUpdateRequest , Operation >
128+ applySoftwareUpdateSettings ;
129+ private final OperationCallSettings <ApplySoftwareUpdateRequest , Instance , OperationMetadata >
130+ applySoftwareUpdateOperationSettings ;
126131
127132 private static final PagedListDescriptor <ListInstancesRequest , ListInstancesResponse , Instance >
128133 LIST_INSTANCES_PAGE_STR_DESC =
@@ -243,6 +248,17 @@ public UnaryCallSettings<ApplyParametersRequest, Operation> applyParametersSetti
243248 return applyParametersOperationSettings ;
244249 }
245250
251+ /** Returns the object with the settings used for calls to applySoftwareUpdate. */
252+ public UnaryCallSettings <ApplySoftwareUpdateRequest , Operation > applySoftwareUpdateSettings () {
253+ return applySoftwareUpdateSettings ;
254+ }
255+
256+ /** Returns the object with the settings used for calls to applySoftwareUpdate. */
257+ public OperationCallSettings <ApplySoftwareUpdateRequest , Instance , OperationMetadata >
258+ applySoftwareUpdateOperationSettings () {
259+ return applySoftwareUpdateOperationSettings ;
260+ }
261+
246262 @ BetaApi ("A restructuring of stub classes is planned, so this may break in the future" )
247263 public CloudMemcacheStub createStub () throws IOException {
248264 if (getTransportChannelProvider ()
@@ -324,6 +340,9 @@ protected CloudMemcacheStubSettings(Builder settingsBuilder) throws IOException
324340 deleteInstanceOperationSettings = settingsBuilder .deleteInstanceOperationSettings ().build ();
325341 applyParametersSettings = settingsBuilder .applyParametersSettings ().build ();
326342 applyParametersOperationSettings = settingsBuilder .applyParametersOperationSettings ().build ();
343+ applySoftwareUpdateSettings = settingsBuilder .applySoftwareUpdateSettings ().build ();
344+ applySoftwareUpdateOperationSettings =
345+ settingsBuilder .applySoftwareUpdateOperationSettings ().build ();
327346 }
328347
329348 /** Builder for CloudMemcacheStubSettings. */
@@ -354,6 +373,11 @@ public static class Builder extends StubSettings.Builder<CloudMemcacheStubSettin
354373 applyParametersSettings ;
355374 private final OperationCallSettings .Builder <ApplyParametersRequest , Instance , OperationMetadata >
356375 applyParametersOperationSettings ;
376+ private final UnaryCallSettings .Builder <ApplySoftwareUpdateRequest , Operation >
377+ applySoftwareUpdateSettings ;
378+ private final OperationCallSettings .Builder <
379+ ApplySoftwareUpdateRequest , Instance , OperationMetadata >
380+ applySoftwareUpdateOperationSettings ;
357381 private static final ImmutableMap <String , ImmutableSet <StatusCode .Code >>
358382 RETRYABLE_CODE_DEFINITIONS ;
359383
@@ -400,6 +424,8 @@ protected Builder(ClientContext clientContext) {
400424 deleteInstanceOperationSettings = OperationCallSettings .newBuilder ();
401425 applyParametersSettings = UnaryCallSettings .newUnaryCallSettingsBuilder ();
402426 applyParametersOperationSettings = OperationCallSettings .newBuilder ();
427+ applySoftwareUpdateSettings = UnaryCallSettings .newUnaryCallSettingsBuilder ();
428+ applySoftwareUpdateOperationSettings = OperationCallSettings .newBuilder ();
403429
404430 unaryMethodSettingsBuilders =
405431 ImmutableList .<UnaryCallSettings .Builder <?, ?>>of (
@@ -409,7 +435,8 @@ protected Builder(ClientContext clientContext) {
409435 updateInstanceSettings ,
410436 updateParametersSettings ,
411437 deleteInstanceSettings ,
412- applyParametersSettings );
438+ applyParametersSettings ,
439+ applySoftwareUpdateSettings );
413440 initDefaults (this );
414441 }
415442
@@ -428,6 +455,9 @@ protected Builder(CloudMemcacheStubSettings settings) {
428455 deleteInstanceOperationSettings = settings .deleteInstanceOperationSettings .toBuilder ();
429456 applyParametersSettings = settings .applyParametersSettings .toBuilder ();
430457 applyParametersOperationSettings = settings .applyParametersOperationSettings .toBuilder ();
458+ applySoftwareUpdateSettings = settings .applySoftwareUpdateSettings .toBuilder ();
459+ applySoftwareUpdateOperationSettings =
460+ settings .applySoftwareUpdateOperationSettings .toBuilder ();
431461
432462 unaryMethodSettingsBuilders =
433463 ImmutableList .<UnaryCallSettings .Builder <?, ?>>of (
@@ -437,7 +467,8 @@ protected Builder(CloudMemcacheStubSettings settings) {
437467 updateInstanceSettings ,
438468 updateParametersSettings ,
439469 deleteInstanceSettings ,
440- applyParametersSettings );
470+ applyParametersSettings ,
471+ applySoftwareUpdateSettings );
441472 }
442473
443474 private static Builder createDefault () {
@@ -487,6 +518,11 @@ private static Builder initDefaults(Builder builder) {
487518 .setRetryableCodes (RETRYABLE_CODE_DEFINITIONS .get ("no_retry_0_codes" ))
488519 .setRetrySettings (RETRY_PARAM_DEFINITIONS .get ("no_retry_0_params" ));
489520
521+ builder
522+ .applySoftwareUpdateSettings ()
523+ .setRetryableCodes (RETRYABLE_CODE_DEFINITIONS .get ("no_retry_0_codes" ))
524+ .setRetrySettings (RETRY_PARAM_DEFINITIONS .get ("no_retry_0_params" ));
525+
490526 builder
491527 .createInstanceOperationSettings ()
492528 .setInitialCallSettings (
@@ -607,6 +643,30 @@ private static Builder initDefaults(Builder builder) {
607643 .setTotalTimeout (Duration .ofMillis (300000L ))
608644 .build ()));
609645
646+ builder
647+ .applySoftwareUpdateOperationSettings ()
648+ .setInitialCallSettings (
649+ UnaryCallSettings
650+ .<ApplySoftwareUpdateRequest , OperationSnapshot >newUnaryCallSettingsBuilder ()
651+ .setRetryableCodes (RETRYABLE_CODE_DEFINITIONS .get ("no_retry_0_codes" ))
652+ .setRetrySettings (RETRY_PARAM_DEFINITIONS .get ("no_retry_0_params" ))
653+ .build ())
654+ .setResponseTransformer (
655+ ProtoOperationTransformers .ResponseTransformer .create (Instance .class ))
656+ .setMetadataTransformer (
657+ ProtoOperationTransformers .MetadataTransformer .create (OperationMetadata .class ))
658+ .setPollingAlgorithm (
659+ OperationTimedPollAlgorithm .create (
660+ RetrySettings .newBuilder ()
661+ .setInitialRetryDelay (Duration .ofMillis (5000L ))
662+ .setRetryDelayMultiplier (1.5 )
663+ .setMaxRetryDelay (Duration .ofMillis (45000L ))
664+ .setInitialRpcTimeout (Duration .ZERO )
665+ .setRpcTimeoutMultiplier (1.0 )
666+ .setMaxRpcTimeout (Duration .ZERO )
667+ .setTotalTimeout (Duration .ofMillis (300000L ))
668+ .build ()));
669+
610670 return builder ;
611671 }
612672
@@ -704,6 +764,20 @@ public UnaryCallSettings.Builder<ApplyParametersRequest, Operation> applyParamet
704764 return applyParametersOperationSettings ;
705765 }
706766
767+ /** Returns the builder for the settings used for calls to applySoftwareUpdate. */
768+ public UnaryCallSettings .Builder <ApplySoftwareUpdateRequest , Operation >
769+ applySoftwareUpdateSettings () {
770+ return applySoftwareUpdateSettings ;
771+ }
772+
773+ /** Returns the builder for the settings used for calls to applySoftwareUpdate. */
774+ @ BetaApi (
775+ "The surface for use by generated code is not stable yet and may change in the future." )
776+ public OperationCallSettings .Builder <ApplySoftwareUpdateRequest , Instance , OperationMetadata >
777+ applySoftwareUpdateOperationSettings () {
778+ return applySoftwareUpdateOperationSettings ;
779+ }
780+
707781 @ Override
708782 public CloudMemcacheStubSettings build () throws IOException {
709783 return new CloudMemcacheStubSettings (this );
0 commit comments