replaceAutoscalingV2beta2NamespacedHorizontalPodAutoscaler method

Future<HorizontalPodAutoscaler> replaceAutoscalingV2beta2NamespacedHorizontalPodAutoscaler({
  1. required HorizontalPodAutoscaler body,
  2. required String name,
  3. required String namespace,
  4. bool? pretty,
})

Replace the specified HorizontalPodAutoscaler.

name Name of the HorizontalPodAutoscaler.

namespace Object name and auth scope, such as for teams and projects.

pretty If true, then the output is pretty printed.

Implementation

Future<api_autoscaling_v2beta2.HorizontalPodAutoscaler>
    replaceAutoscalingV2beta2NamespacedHorizontalPodAutoscaler({
  required api_autoscaling_v2beta2.HorizontalPodAutoscaler body,
  required String name,
  required String namespace,
  bool? pretty,
}) async {
  final queryStrings = <String, Object>{};
  if (pretty != null) {
    queryStrings['pretty'] = pretty;
  }

  final query =
      queryStrings.isEmpty ? '' : '?${_joinQueryStrings(queryStrings)}';

  final jsonBody = jsonEncode(body.toJson());
  final result = await _putJsonMap(
      '/apis/autoscaling/v2beta2/namespaces/$namespace/horizontalpodautoscalers/$name$query',
      jsonBody);
  return api_autoscaling_v2beta2.HorizontalPodAutoscaler.fromJson(result);
}